6.1 Overview
The SIP Trunks section allows AIUNIFY Assistant to connect directly to compatible telephone carriers and business voice systems without requiring ordinary Twilio Programmable Voice calling.
SIP stands for:
Session Initiation Protocol
A SIP Trunk can connect AIUNIFY Assistant to:
A telecommunications carrier
A business telephone provider
A cloud voice provider
A private branch exchange
A hosted PBX
A compatible Voice over IP service
An enterprise telephone network
The AIUNIFY Assistant interface describes SIP Trunks as connections to local carriers such as STC, Mobily, and Zain, as well as other SIP-compatible providers. The application also includes provider presets for services such as Twilio SIP Trunking, Telnyx, and generic SIP providers.
Understanding the SIP Architecture
6.2 SIP Trunk Versus Phone Number
A SIP Trunk and a Phone Number are separate resources.
SIP Trunk
Contains the technical connection to the carrier:
Provider host
Port
Transport method
Username
Password
Authentication realm
Codec preferences
Default caller ID
Phone Number
Represents an actual telephone number that uses the SIP Trunk.
The relationship is:
SIP Provider
↓
SIP Trunk
↓
Phone Number
↓
AI Agent
↓
Campaign or Inbound Call
Creating a SIP Trunk does not automatically create a Phone Number.
After configuring the Trunk, it must be assigned to a SIP Phone Number from the Phone Numbers section. The system rejects a Phone Number configured as SIP when no SIP Trunk has been selected.
6.3 SIP Provider Versus AIUNIFY Assistant
The SIP provider supplies the external telephone service.
AIUNIFY Assistant supplies:
AI Agent behavior
Speech recognition
AI responses
Generated voice
Campaign management
Lead management
Call Logs
Recordings
Transcripts
Appointment tools
The provider is responsible for the carrier connection, number availability, call termination, origination, permitted destinations, and applicable provider billing.
6.4 Asterisk
AIUNIFY Assistant uses Asterisk as the server-side voice engine for SIP calls.
Asterisk is responsible for functions such as:
Connecting to SIP providers
Loading SIP endpoints
Originating outbound SIP calls
Receiving inbound SIP calls
Routing telephone audio
Managing active call channels
Connecting audio to AI services
Recording calls where enabled
Ending or forwarding calls
The SIP Trunks page reports whether AIUNIFY Assistant is currently connected to Asterisk and displays the number of active SIP calls.
6.5 ARI
AIUNIFY Assistant communicates with Asterisk through the:
commonly abbreviated:
ARI allows the Assistant backend to manage active call channels, bridges, audio streams, inbound routing, outbound origination, and call termination.
A SIP Trunk may be correctly entered while SIP calling still fails when the ARI connection is offline.
6.6 PJSIP
The application uses Asterisk’s PJSIP system to represent SIP Trunks as telephone endpoints.
When SIP configuration is applied, AIUNIFY Assistant generates or refreshes Asterisk configuration information for:
SIP endpoints
Provider registration
Authentication
Transport
Dialing rules
Inbound routing
Outbound routing
Normal users should configure this through the AIUNIFY Assistant interface rather than manually editing Asterisk files.
6.7 SIP Calling Workflow
A typical outbound SIP call follows this process:
Campaign selects an AI Agent
↓
Agent uses its assigned SIP Phone Number
↓
Phone Number identifies its SIP Trunk
↓
Asterisk sends the call to the provider
↓
Provider routes the call to the Lead
↓
AIUNIFY Assistant handles the conversation
↓
Call Log, recording, and analysis are created
A typical inbound SIP call follows:
Caller dials the provider number
↓
Provider sends the call to Asterisk
↓
Asterisk identifies the called number
↓
AIUNIFY Assistant finds the matching SIP Phone Number
↓
Assigned inbound Agent answers
↓
Caller is matched to or created as a Lead
↓
Conversation is recorded in Call Logs
When to Use SIP
6.8 Appropriate SIP Use Cases
SIP can be appropriate when the organization:
Already owns telephone service through a SIP carrier
Uses an enterprise PBX
Requires local telecommunications providers
Wants carrier flexibility
Needs regional telephone numbers
Operates its own Asterisk infrastructure
Wants to avoid dependence on one voice provider
Has negotiated carrier pricing
Needs direct SIP origination or termination
6.9 When Twilio May Be Simpler
Twilio may be simpler when the organization:
Does not operate Asterisk
Does not have SIP credentials
Needs a less technical initial setup
Uses standard Twilio numbers
Does not require direct carrier integration
Has no dedicated voice-system administrator
SIP generally requires more networking and carrier-specific configuration than a standard Twilio number.
6.10 Technical Assistance
SIP configuration can involve:
Server firewall rules
Public IP addresses
SIP ports
RTP audio ports
Carrier access lists
DNS
Transport security
Codec negotiation
NAT
Asterisk configuration
Provider authentication
A normal account user can enter and test a Trunk through the interface, but some failures require assistance from:
SIP provider
Server administrator
Network administrator
AIUNIFY platform administrator
Opening SIP Trunks
6.11 Accessing the Page
After signing in:
- Locate SIP Trunks in the Sidebar.
- Select it once.
- Wait for the loading indicator.
- Review the Asterisk status.
- Review the Configured Trunks table.
The page contains:
Reload Asterisk
Add SIP Trunk
Asterisk status
Active SIP call count
Configured Trunk count
Configured Trunks table
SIP setup information
6.12 Loading Failure
When the page cannot retrieve the Trunks or Asterisk status, it can display:
Failed to load SIP trunks
Possible causes include:
Expired login session
Backend API outage
Asterisk status request failure
Network interruption
Incorrect API configuration
Server error
Refresh once, confirm another protected page works, and sign in again when necessary.
Asterisk Status Bar
6.13 Asterisk Connected
A green status displays:
This means the Assistant backend reports an active ARI connection to Asterisk.
It indicates that the Voice Engine is reachable, but it does not prove that:
Every SIP Trunk is valid
Every carrier is reachable
Every Phone Number is routed
Every call destination is permitted
Audio will be available
The credentials are correct
A Trunk test and telephone test call are still required.
6.14 Asterisk Offline
A red status displays:
This means the backend does not currently have an active ARI connection.
SIP calling will not operate normally while this condition remains.
Twilio calling can continue independently because the application treats SIP/Asterisk as a separate calling path.
6.15 Active SIP Calls
The status bar displays:
[number] active SIP calls
This value represents SIP calls currently tracked by the Assistant voice engine.
It can include:
Outbound Campaign calls
SIP test calls
Inbound SIP calls
Calls awaiting cleanup
Do not reload or restart Asterisk during active calls unless an emergency requires it.
6.16 Configured Trunk Count
The status bar displays the number of saved SIP Trunks.
Example:
This count does not mean all three are active, tested, or usable.
Review each Trunk’s:
Status
Test result
Host
Transport
Provider
Phone Number assignments
Configured Trunks
6.17 Empty Trunk Account
When no Trunks exist, the page displays:
and explains that a SIP Trunk must be added to connect to a telecommunications provider.
Select:
to begin.
6.18 Trunk Information
A saved Trunk can contain:
Trunk name
SIP host
Port
Transport
Username
Encrypted password
Authentication realm
Default caller ID
Codecs
Provider name
Region
Status
Last test date
Last test result
Owner
The database supports the statuses:
and test results:
6.19 Actions
Each Trunk provides operational actions such as:
The page also provides a separate Reload Asterisk action that applies SIP configuration to the Voice Engine.
Collecting Provider Information
6.20 Required Provider Details
Before creating a Trunk, obtain the official SIP details from the carrier.
These can include:
SIP server or registrar
SIP port
Transport method
Authentication username
Authentication password
Authentication realm
Approved source IP
Origination destination
Inbound Origination URI
Permitted caller IDs
Supported codecs
Country and region
Number formatting rules
Do not guess provider values.
6.21 Carrier Documentation
Use current documentation supplied directly by the carrier.
SIP hostnames, access rules, and regional endpoints can differ based on:
Account
Country
Region
Product
Data center
Trunk type
Security method
A host used by another organization may not work for your account.
6.22 Authentication Models
SIP providers commonly use one of two approaches.
Credential authentication
Requires:
Username
Password
Authentication realm
IP authentication
The provider authorizes the public IP address of the AIUNIFY/Asterisk server.
With IP authentication, Username and Password may be blank.
Some providers support both methods.
6.23 Public Server IP
When the carrier uses an IP Access Control List, provide the public outbound IP address of the Asterisk server.
Do not provide:
Your personal computer IP
A private 192.168 address
A localhost address
The Lead’s IP
The frontend browser IP
The carrier must authorize the server that sends the SIP traffic.
Adding a SIP Trunk
6.24 Opening the Trunk Dialog
To create a connection:
- Open SIP Trunks.
- Select Add SIP Trunk.
- Select a provider preset or manual configuration.
- Enter the provider information.
- Review every value.
- Save the Trunk.
- Test connectivity.
- Reload Asterisk.
- Assign it to a Phone Number.
6.25 Provider Presets
The application contains preset information for several SIP providers.
A preset can automatically suggest values such as:
Provider name
SIP host pattern
Port
Transport
Authentication realm
Region
Codec preference
The preset values may contain placeholders.
Example:
<YOUR_TRUNK_DOMAIN>.pstn.twilio.com
A placeholder must be replaced with the actual value supplied for the organization’s account.
Do not save placeholder text as production configuration.
6.26 Generic Provider
Use the Generic or manual option when:
The carrier is not listed
The listed preset does not match the account
The carrier supplied custom endpoints
The organization operates a private PBX
The connection uses an enterprise gateway
Trunk Name
6.27 Purpose of the Name
The Trunk Name is an internal identifier.
Recommended examples:
Primary US SIP Trunk
Detroit Outbound Carrier
Saudi STC Production
Telnyx North America
Customer Support SIP
Backup Voice Trunk
Avoid:
Trunk 1
SIP
Provider
Test
New
6.28 Unique Operational Names
Use a naming convention that distinguishes:
Provider
Region
Purpose
Environment
Example:
Telnyx-US-Production
Telnyx-US-Testing
STC-SA-Inbound
Bandwidth-US-Outbound
This reduces the risk of assigning the wrong Trunk to a Phone Number.
Provider Name and Region
6.29 Provider Name
Provider Name identifies the carrier in the interface.
Examples:
Telnyx
Bandwidth
Twilio
STC
Mobily
Zain
Generic SIP
The provider name is descriptive. The actual network connection depends on Host, Port, Transport, and authentication.
6.30 Region
Region identifies the geographic area associated with the provider endpoint.
Examples:
US
Europe
Saudi Arabia
Global
Middle East
Region does not automatically restrict Campaign Leads or calling hours.
The business must still manage:
Destination permissions
Lead time zones
Local calling rules
Provider geographic permissions
SIP Host
6.31 Host or Registrar
The Host is the network address of the SIP provider.
It may be:
A domain name
A provider-assigned registrar
A regional endpoint
An IP address
Examples of format:
sip.provider.example
us-east.sip.provider.example
203.0.113.50
Do not include:
https://
http://
A full website path
A customer dashboard URL
A leading sip: unless specifically required by the form
6.32 Host Accuracy
A single typing error can prevent:
Trunk registration
Outbound calls
Inbound routing
Connectivity tests
Copy the value from the provider documentation and remove accidental spaces.
6.33 Regional Hosts
Some providers offer different hosts for:
North America
Europe
Asia
Middle East
Australia
Choose the endpoint approved for the account and nearest to the Asterisk server where recommended by the provider.
SIP Port
6.34 Default Port
The default Trunk port is:
This is commonly used for UDP or TCP SIP signaling.
6.35 TLS Port
Secure TLS SIP commonly uses:
The exact port must match the carrier configuration.
Do not select 5061 merely because TLS was chosen unless the provider confirms it.
6.36 Valid Port
The Port field should contain only the provider-approved numeric port.
Examples:
A reachable port does not prove authentication or audio routing is correct.
Transport
6.37 Supported Transport Methods
The Trunk model supports:
6.38 UDP
UDP is commonly used for traditional SIP signaling.
Characteristics include:
Low overhead
No guaranteed delivery
No persistent connection
Provider may not respond to OPTIONS tests
Common use of port 5060
A UDP test timeout is not conclusive proof that the Trunk cannot place calls.
6.39 TCP
TCP uses a connection-oriented transport.
It can be selected when the provider requires:
Persistent signaling connection
TCP transport
Port-based reachability
The Assistant connectivity test attempts to open a TCP connection to the configured Host and Port.
6.40 TLS
TLS provides encrypted SIP signaling when supported and correctly configured.
Selecting TLS does not automatically guarantee a secure working connection. The provider may also require:
Correct certificate handling
Specific domain
TLS-compatible port
Approved cipher configuration
Server Name Indication
Trusted certificate authority
The basic interface test treats TCP and TLS as network port reachability tests. It should not be interpreted as a complete TLS certificate or SIP registration test.
6.41 Matching Provider Transport
The transport selected in AIUNIFY Assistant must match the provider’s expected connection.
Example:
Provider requires TLS on 5061
AIUNIFY configuration must use:
Transport: TLS
Port: 5061
Using UDP with a TLS-only endpoint will fail.
SIP Username
6.42 Authentication Username
The Username is the SIP authentication identity supplied by the provider.
It may differ from:
Account email
Customer portal username
Telephone number
Account number
Trunk name
Use the exact SIP username supplied for the Trunk.
6.43 Blank Username
Leave Username blank only when:
The provider uses IP authentication
The provider explicitly says credentials are unnecessary
The Trunk is designed for unauthenticated trusted traffic
Do not leave it blank merely because the provider’s customer portal uses another login.
SIP Password
6.44 Credential Password
The SIP Password authenticates the Trunk to the carrier.
It is not necessarily the same as the provider portal password.
Use the Trunk-specific credential supplied or created through the provider.
6.45 Encrypted Storage
AIUNIFY Assistant stores the SIP Password in encrypted form.
API responses do not return the encrypted value or reveal the decrypted Password. Instead, the interface receives an indication that a Password has been set.
6.46 Editing Without Changing the Password
When editing a Trunk, leaving the Password field blank preserves the currently stored Password.
This allows a user to change:
Host
Port
Transport
Caller ID
Codecs
Region
without re-entering the secret.
The frontend removes an empty Password from the update request unless the user deliberately chooses to clear the credentials.
6.47 Replacing the Password
To replace it:
- Open Edit.
- Enter the new SIP Password.
- Save the Trunk.
- Reload Asterisk.
- Test the Trunk.
- Place a controlled test call.
6.48 Clearing Credentials
When the interface provides the clear-credentials option, using it can clear both:
Use this only when converting the Trunk to IP authentication or intentionally removing access.
Clearing credentials accidentally can cause:
407 authentication errors
Registration failure
Outbound call failure
Authentication Realm
6.49 Realm Definition
The Authentication Realm identifies the SIP authentication domain.
It may be:
The provider domain
The registrar hostname
A provider-assigned realm
The Trunk domain
Example:
6.50 Realm Versus Host
Host and Realm can be the same, but they are not always identical.
Example:
Host:
us-east.sip.provider.example
Authentication Realm:
sip.provider.example
Use the provider’s exact values.
6.51 Blank Realm
Leave it blank only when the provider documentation does not require a separate Realm.
An incorrect Realm can cause authentication failures even when Username and Password are correct.
Default Caller ID
6.52 Caller ID Purpose
Default Caller ID is the number the SIP Trunk can use as the originating identity for outbound calls.
Recommended format:
The value should represent a number:
Owned by the organization
Authorized by the carrier
Assigned to the Trunk
Permitted for outbound presentation
6.53 Trunk Caller ID Versus Phone Number
The Trunk’s Default Caller ID provides carrier-level configuration.
The actual Phone Number assigned to an AI Agent also identifies the outbound number.
Keep these values consistent.
Example:
Trunk Default Caller ID:
+13135550198
Assigned SIP Phone Number:
+13135550198
Conflicting values can cause:
Provider rejection
Unexpected caller ID
Anonymous calling
Carrier substitution
6.54 Caller-ID Authorization
Do not enter a number that the provider has not approved.
The carrier may reject or rewrite unauthorized caller IDs.
The Friendly Name inside AIUNIFY Assistant does not control the caller-name text shown on the recipient’s telephone.
Codecs
6.55 Codec Definition
A codec determines how telephone audio is encoded and transmitted.
The Trunk’s Codec field accepts a comma-separated preference list.
The default is:
6.56 PCMU
PCMU is also commonly known as:
It is widely used in North American telephone environments.
6.57 PCMA
PCMA is also known as:
It is widely used internationally.
6.58 Other Codecs
A provider may support codecs such as:
Only enter codecs supported by:
The provider
Asterisk
The AI voice pipeline
The telephone route
Adding an unsupported codec does not install or license it.
6.59 Codec Order
The comma-separated order can represent preference.
Example:
means PCMU is preferred before PCMA where negotiation allows.
6.60 Audio Problems
Codec disagreement can cause:
No audio
One-way audio
Call connection followed by immediate failure
Distorted speech
Unexpected transcoding
Poor voice quality
Begin with the provider’s recommended G.711 codecs unless another requirement exists.
Saving a Trunk
6.61 Review Before Saving
Before selecting Save, confirm:
Name is recognizable
Host is exact
Port is correct
Transport matches
Username is correct
Password is secure
Realm is correct
Caller ID is authorized
Codecs are supported
Provider and Region are accurate
6.62 Creation Result
A successful operation displays:
The backend associates the Trunk with the signed-in user and attempts to regenerate and reload the Asterisk configuration after creation.
6.63 Save Error
A failure can display the backend message or:
Possible causes include:
Required field missing
Invalid Port
Invalid Transport
Expired session
Server error
Invalid request value
6.64 Ownership
Each Trunk belongs to the account that created it.
Normal users can list, edit, test, or delete only their own SIP Trunks.
A Phone Number cannot use another user’s Trunk. The backend checks ownership when the number is saved.
Reloading Asterisk
6.65 Reload Asterisk Button
The SIP Trunks page contains:
This action regenerates Asterisk SIP configuration from the active Trunks and attempts to reload Asterisk.
The backend also attempts automatic regeneration after a Trunk is created, edited, or deleted. The manual button provides a direct way to apply or retry the configuration.
6.66 When to Reload
Use Reload Asterisk after:
Creating a Trunk
Changing Host
Changing Port
Changing Transport
Changing credentials
Changing Realm
Changing codecs
Changing status
Deleting a Trunk
Correcting provider information
6.67 Reload During Calls
Avoid reloading during active SIP conversations.
Before selecting it, review:
[number] active SIP calls
Wait until the count reaches zero when practical.
6.68 Reload Success
A successful result displays the server’s confirmation message.
Afterward:
- Wait briefly.
- Confirm Asterisk remains Connected.
- Test the Trunk.
- Place a controlled telephone test call.
6.69 Reload Warning
The action can return a warning such as:
Config written with warnings
This can mean configuration files were generated but Asterisk did not confirm a complete reload.
A server administrator may need to check:
Asterisk service
File permissions
PJSIP modules
Configuration includes
ARI connection
6.70 Reload Failed
Possible causes include:
Asterisk is not installed
Asterisk is stopped
Configuration directory is unavailable
File permission problem
Invalid generated configuration
PJSIP module missing
ARI unavailable
Server command failure
Normal users should record the exact message and contact Support.
Testing Trunk Connectivity
6.71 Test Action
The Trunk Test action checks basic connectivity between the AIUNIFY server and the configured SIP Host.
It records:
Last test date
Success or failed result
Reachability message
The test is not a complete telephone call and does not validate every calling feature.
6.72 TCP and TLS Test
For a Trunk using TCP or TLS, the backend attempts a TCP connection to:
A successful result can resemble:
TCP connection to host:port successful
This confirms that the network port accepted a connection.
It does not necessarily confirm:
SIP authentication
TLS certificate validity
Provider registration
Caller ID authorization
Audio routing
Inbound routing
Outbound call permission
6.73 TCP Failure
A result such as:
TCP connection failed: [reason]
can indicate:
Incorrect Host
Incorrect Port
Provider offline
Firewall blocked
DNS failure
Carrier access control
Server network restriction
6.74 UDP Test
For UDP, the application sends a basic SIP OPTIONS request.
When the provider responds, the test can display:
SIP OPTIONS response received from host:port
6.75 UDP Timeout
The application can display:
UDP SIP OPTIONS timed out after [time]ms.
The trunk may still work — UDP doesn't guarantee a response.
This warning is important.
Some providers:
Ignore unauthenticated OPTIONS requests
Do not reply to health checks
Require approved source IPs
Respond only after registration
Filter unexpected SIP messages
Therefore, a UDP timeout should be followed by a controlled telephone test rather than treated as conclusive failure.
6.76 Test Success Is Not Call Success
A reachable Host can still reject telephone calls because of:
Incorrect credentials
Incorrect Realm
Unauthorized IP
Invalid Caller ID
Wrong destination format
Insufficient provider balance
Destination restrictions
Missing registration
Codec incompatibility
Creating the SIP Phone Number
6.77 Next Required Step
After the Trunk is configured:
- Open Phone Numbers.
- Select Add Number.
- Choose SIP Trunk as Provider.
- Enter the actual telephone number.
- Select the saved SIP Trunk.
- Assign an inbound Agent or fallback.
- Save the number.
- Test calling.
6.78 SIP Number Requirement
A SIP Phone Number must have a SIP Trunk.
The backend responds:
SIP phone numbers require a SIP trunk. Please select one.
when the Provider is SIP but no Trunk is assigned.
6.79 Number Format
Enter the provider-controlled number in international format.
Example:
The inbound SIP routing system performs flexible matching with and without certain number-format variations, but consistent international formatting is still recommended.
6.80 Selecting the Trunk
Choose the Trunk that actually carries the number.
Do not select a Trunk merely because it has a similar provider name.
Confirm:
Provider account
Region
Host
Telephone number ownership
Inbound route
Outbound route
Origination URI and Inbound Delivery
6.81 Provider Origination
For inbound SIP calls, the carrier must send calls to the public SIP address of the AIUNIFY/Asterisk server.
The provider may call this:
Origination URI
Termination URI
Inbound SIP URI
SIP Destination
Voice URI
The exact URI and port must be obtained from the AIUNIFY platform administrator or deployment configuration.
6.82 SIP Signaling Port
The application deployment can use a configured public SIP port that may differ from the provider’s registrar port.
These are separate concepts:
Provider Port:
Where AIUNIFY sends outbound SIP signaling
AIUNIFY Public SIP Port:
Where the provider sends inbound SIP signaling
Do not assume both are 5060.
6.83 RTP Audio Ports
SIP establishes the call, but the telephone audio normally travels through RTP ports.
A call can ring and connect while having no audio when RTP traffic is blocked.
The server firewall must allow the RTP range configured for AIUNIFY Assistant.
This is generally a server-administrator responsibility.
6.84 Provider IP Access
Some providers require AIUNIFY to approve their signaling addresses, while others require the carrier to approve the AIUNIFY server IP.
Confirm both directions:
AIUNIFY server → Provider
Provider → AIUNIFY server
Assigning an Inbound Agent
6.85 Inbound Agent
On the SIP Phone Number record, select the AI Agent that should answer calls received on that number.
The Agent should have:
Inbound opening message
Correct language
Correct voice
Accurate Knowledge Base
Appointment tools where needed
Transfer rules where needed
6.86 Inbound Number Matching
When Asterisk receives an inbound SIP call, AIUNIFY Assistant searches for a SIP Phone Number matching the called number.
The matching process considers number variations, including forms with or without a leading plus sign.
When no matching SIP Phone Number exists, the call is treated as unavailable and ends.
6.87 No Inbound Agent
When the SIP Phone Number has no assigned Agent, the system checks for a Fallback Number.
When no Agent and no fallback are available, the call ends.
SIP Fallback Number
6.88 Purpose
The SIP Phone Number form provides an optional Fallback Number.
It is intended for inbound calls when no AI Agent is assigned.
Example:
AI Agent unavailable
↓
Inbound call forwarded
↓
Human support number
6.89 Fallback Routing
The system attempts to route the fallback call through the same SIP Trunk.
The fallback destination must therefore be accepted by that carrier.
The inbound SIP manager checks the Phone Number’s fallback value and continues the call through the SIP dial plan when a Trunk is available.
6.90 Fallback Limitations
Fallback can fail because:
Trunk is unavailable
Destination is not permitted
Number format is incorrect
Carrier rejects the Caller ID
Asterisk dial plan is not loaded
Phone Number has no Trunk
Provider balance is insufficient
Test fallback separately before relying on it for customer calls.
6.91 Agent Versus Fallback
The reviewed SIP flow uses fallback specifically when no inbound Agent is mapped.
Do not assume fallback automatically activates when:
The Agent gives an incorrect answer
The AI service temporarily fails
The caller requests a human
The Agent times out
Human transfer behavior should be separately configured and tested through the Agent’s tools where supported.
Inbound SIP Leads
6.92 Matching an Existing Lead
For an inbound call, the caller’s number is normalized into digits and compared with Lead records owned by the same AIUNIFY user.
When a matching Lead exists, the call is associated with that Lead.
6.93 Creating a New Lead
When no Lead matches, AIUNIFY Assistant creates a new record similar to:
The Lead receives:
Tags.
The system can also trigger the configured leadCreated webhook event.
6.94 Updating the New Lead
After the call:
- Open Leads.
- Search the caller’s digits.
- Replace the generated name where known.
- Add Company and Tags.
- Confirm the country code.
- Preserve the number for future inbound matching.
Outbound SIP Calls
6.95 Assigning the SIP Number to an Agent
To place outbound calls through the Trunk:
- Create the SIP Phone Number.
- Open AI Agents.
- Edit the intended Agent.
- Select the SIP Phone Number as its outbound number.
- Save the Agent.
- Run a controlled test call.
- Use that Agent in a Campaign.
6.96 Campaign Provider Selection
The Campaign uses the provider associated with the Agent’s outbound Phone Number.
When that Phone Number is SIP, the Campaign uses the SIP/Asterisk calling path instead of Twilio.
6.97 SIP Campaign Requirements
Before a SIP Campaign starts, the system checks that:
Deepgram is configured
ElevenLabs is configured
OpenRouter is configured
Agent has an outbound Phone Number
Phone Number is connected to a SIP Trunk
Asterisk Voice Engine is connected
A SIP Campaign can return:
Asterisk Voice Engine not connected.
Ensure the server is running and ARI is configured.
when ARI is offline.
6.98 Concurrent Call Limit
The SIP voice engine enforces a maximum number of concurrent SIP calls.
When the limit is reached, additional calls can be rejected or delayed.
The default shown in the backend is server-configurable.
Normal users should not assume that every Lead in a Campaign is called simultaneously.
SIP Telephone Test Calls
6.99 Connectivity Test Versus Telephone Test
There are two different SIP tests.
Trunk connectivity test
Checks network reachability to the SIP Host.
Phone Number Test Call
Attempts to originate an actual call through Asterisk and the SIP Trunk.
The second test is more meaningful for validating production readiness.
6.100 Test Call Requirements
A SIP Phone Number test call requires:
SIP Trunk
Asterisk connection
ElevenLabs API key
At least one AI Agent
Valid destination number
Carrier permission
The application uses an Agent voice to play the test phrase.
When no Agent exists, the system can return:
Create at least one Agent (used for voice on test call).
When ElevenLabs is missing:
SIP test call requires ElevenLabs API key.
Configure it in Settings.
6.101 Test Destination
Enter the destination in full international format.
Example:
Use an approved internal telephone during initial testing.
6.102 Test Call Timeout
SIP calls can take longer to originate than basic provider checks.
The backend allows an extended test-call request period.
A timeout can display:
Test call request timed out.
Check Asterisk/SIP connectivity or increase proxy timeout.
A timeout may occur before the carrier’s final result is received.
Check:
Call Logs
Carrier portal
Asterisk status
Destination telephone
before repeating the request.
Recording SIP Calls
6.103 SIP Recording
When account recording is enabled, the SIP voice engine attempts to record calls through Asterisk.
The recording can later be associated with the Call Log.
6.104 Missing SIP Recording
Possible causes include:
Recording disabled
Asterisk recording directory unavailable
Permission problem
Call ended too quickly
Voice channel failed
RTP audio unavailable
Recording cleanup failed
6.105 Recording Compliance
SIP calls are subject to the same recording and privacy obligations as Twilio calls.
Review:
Disclosure requirements
Consent
Retention
Authorized access
Transcript privacy
Webhook destinations
Auto Hangup and SIP
6.106 Call Duration Limits
Account-level Auto Hangup settings apply to SIP calling.
Separate timeout values can affect:
Outbound SIP calls
Inbound SIP calls
6.107 One-Minute Warning
For applicable inbound SIP calls, the voice engine can provide a warning approximately one minute before the configured maximum duration.
6.108 Immediate Termination
A zero-minute timeout can cause immediate termination.
Review account Settings before diagnosing a Trunk as defective.
Editing a SIP Trunk
6.109 Opening Edit
To edit:
- Open SIP Trunks.
- Find the correct Trunk.
- Open its Actions menu.
- Select Edit.
- Review existing information.
- Update only the approved values.
- Save.
- Reload Asterisk.
- Test again.
6.110 Password Protection During Edit
The current Password is not displayed.
Leave the Password blank to preserve it.
Enter a value only when replacing it.
Use the clear-credentials control only when intentionally removing authentication.
6.111 Status
A Trunk can be set to:
through supported update behavior.
Active Trunks are included when Asterisk configuration is generated.
An inactive Trunk should not be treated as available for production calling.
6.112 Changing Host or Transport
Changes to Host, Port, or Transport can completely redirect the carrier connection.
Before saving:
Confirm provider documentation
Confirm Region
Confirm firewall rules
Confirm authentication
Confirm Phone Number assignments
6.113 Editing During Campaigns
Do not change a Trunk used by a running Campaign.
Stop or complete the Campaign first, wait for active calls to end, then make the change.
Deleting a SIP Trunk
6.114 Delete Protection
AIUNIFY Assistant prevents deletion when one or more Phone Numbers still use the Trunk.
The system responds:
Cannot delete: [number] phone number(s) are still using
this SIP trunk. Remove them first.
6.115 Safe Deletion Procedure
- Open Phone Numbers.
- Identify every number assigned to the Trunk.
- Stop affected Campaigns.
- Reassign Agents where necessary.
- Remove or change the Phone Numbers.
- Confirm no active SIP calls remain.
- Return to SIP Trunks.
- Delete the Trunk.
- Reload Asterisk.
- Confirm Asterisk remains connected.
6.116 Provider Account Remains
Deleting the AIUNIFY record does not necessarily:
Cancel the provider account
Release telephone numbers
Remove carrier billing
Delete provider credentials
Remove provider IP rules
Delete provider routing
Complete those actions with the carrier where required.
SIP Error Messages
6.117 Authentication Required — 407
A SIP 407 response generally means the provider requires authentication.
AIUNIFY Assistant translates this into guidance similar to:
SIP Trunk requires authentication (407).
Either configure credentials in your trunk settings,
or add your server IP to the provider’s IP Access Control List.
Check:
Username
Password
Authentication realm
IP Access Control List
Provider authentication method
6.118 Endpoint Not Found
A message indicating that the SIP endpoint was not found can mean:
Asterisk config was not reloaded
Trunk is inactive
Trunk ID is missing from PJSIP
Configuration generation failed
Phone Number references the wrong Trunk
Reload Asterisk and contact Support when the endpoint remains unavailable.
6.119 Provider Unreachable — 503
A 503 response can mean:
Provider is unavailable
Host is incorrect
Regional endpoint is offline
Carrier rejected the route
Service is temporarily unavailable
The application advises checking the SIP Host or Registrar and provider availability.
6.120 SIP Timeout
A timeout means the provider did not respond within the expected period.
Check:
Host
Port
Transport
Firewall
DNS
Provider access rules
Server internet connection
Carrier status
6.121 Asterisk Not Available
A SIP call can return:
Asterisk not available.
Ensure Asterisk is running and ARI is configured.
This is a Voice Engine problem rather than a Lead or Campaign problem.
6.122 Concurrent Limit Reached
When the server has reached the active SIP call limit, the user can receive a message similar to:
Concurrent SIP call limit reached.
Try again shortly.
Wait for existing calls to end.
Troubleshooting Asterisk
6.123 Asterisk Offline After Page Load
Try:
- Refreshing the SIP Trunks page once.
- Confirming the API is available.
- Confirming no maintenance is underway.
- Selecting Reload Asterisk only when authorized.
- Contacting Support.
A server administrator may need to restart the Asterisk service or repair ARI configuration.
6.124 Asterisk Connected but Calls Fail
Check:
Trunk connectivity
Phone Number assignment
Carrier credentials
Agent outbound number
Destination format
Carrier permissions
Codec settings
Provider balance
Asterisk Connected means the Assistant can communicate with its Voice Engine. It does not prove that the carrier accepted the call.
6.125 Asterisk Becomes Offline During Calls
Possible causes include:
Asterisk service restart
Server resource exhaustion
ARI disconnect
Configuration error
Network interruption
Voice process crash
Stop new Campaign activity and contact Support.
6.126 Reload Does Not Restore Connection
A configuration reload is not the same as restarting a stopped Asterisk service.
A server administrator may need to review:
Service status
ARI credentials
HTTP service
PJSIP modules
Configuration syntax
System logs
Troubleshooting Trunks
6.127 Trunk Does Not Save
Check:
Name is populated
Host is populated
Port is numeric
Transport is UDP, TCP, or TLS
Credential length is valid
Login session is active
6.128 Test Reports TCP Failure
Check:
Host spelling
Port
Transport
Provider availability
Outbound server firewall
Provider allowlist
DNS
6.129 UDP Test Times Out
Do not immediately delete the Trunk.
Confirm:
- Provider accepts UDP.
- Correct port is used.
- Server IP is approved.
- Registration requirements are met.
- Actual telephone test call works.
6.130 Test Succeeds but Call Fails
The test checks reachability, not full SIP authorization.
Review:
Credentials
Realm
Caller ID
Destination format
Provider balance
Outbound permissions
Asterisk endpoint
Phone Number assignment
6.131 Trunk Works Outbound but Not Inbound
Check:
Provider Origination URI
Public SIP port
Firewall
RTP range
Called-number format
SIP Phone Number record
Inbound Agent
Provider inbound route
6.132 Trunk Works Inbound but Not Outbound
Check:
Authentication
Caller ID authorization
Destination permissions
Agent outbound number
Provider balance
Dialing format
Campaign configuration
Audio Troubleshooting
6.133 Call Connects with No Audio
Possible causes include:
RTP ports blocked
NAT problem
Incorrect public IP
Codec mismatch
External media channel failure
Provider media restriction
This generally requires server or network review.
6.134 One-Way Audio
One-way audio often indicates:
Firewall allows only one direction
Incorrect NAT address
Provider sends media to a private IP
RTP range mismatch
Record whether:
Caller can hear the Agent
Agent can hear the caller
Neither side can hear
That distinction helps Support diagnose the media path.
6.135 Distorted Voice
Check:
Codec selection
Network packet loss
Server load
Provider quality
Transcoding
Voice-stream stability
Begin testing with PCMU or PCMA when supported by the carrier.
6.136 Delayed Conversation
Long pauses can result from:
Network latency
Speech-recognition delay
AI model response time
Voice-generation delay
RTP jitter
Provider routing
Test each provider and region before production deployment.
Number and Routing Problems
6.137 Wrong Number Receives Calls
Check:
Provider routing
Agent outbound Phone Number
Trunk Default Caller ID
Phone Number record
Campaign Agent
Destination Lead
6.138 Inbound Number Not Found
The called-number format may not match a SIP Phone Number record.
Confirm:
Country code
Leading plus
Provider-delivered destination
Phone Number provider is SIP
Correct account owns the record
6.139 Caller Reaches Fallback Instead of Agent
The SIP Phone Number may have:
No inbound Agent
Deleted Agent
Invalid Agent assignment
Edit the number and select the intended Agent.
6.140 Fallback Does Not Ring
Check:
Fallback number format
Trunk outbound permission
Carrier route
Asterisk dial plan
Provider balance
Phone Number Trunk assignment
Campaign Troubleshooting
6.141 Campaign Says Voice Engine Is Offline
Open SIP Trunks and confirm Asterisk status.
Do not recreate the Campaign. Correct the Voice Engine connection first.
6.142 Campaign Starts but Calls Fail
Review Call Logs for:
407 authentication
503 unavailable
Timeout
Endpoint missing
Invalid destination
Caller ID rejection
Concurrent limit
6.143 Campaign Uses Twilio Instead of SIP
Check the Campaign’s Agent.
The Agent’s outbound Phone Number may still be a Twilio number.
Assign the intended SIP Phone Number and save the Agent.
6.144 Campaign Uses the Wrong SIP Trunk
The selected Agent may be assigned to a SIP Phone Number linked to another Trunk.
Review:
Campaign
Agent
Outbound Phone Number
Phone Number’s SIP Trunk
Security
6.145 Protect SIP Credentials
Never place SIP credentials in:
Agent prompt
Knowledge Base
Lead record
Campaign name
Support screenshot
Webhook payload
Public document
Email
6.146 Provider Portal Security
Protect the carrier account with:
Strong password
Multifactor authentication
Restricted administrators
Access review
Billing alerts
Call-volume alerts
6.147 IP Restrictions
Where supported, restrict the Trunk to the AIUNIFY server IP rather than allowing calls from every address.
Coordinate IP changes before moving or rebuilding the server.
6.148 Toll Fraud
A compromised SIP Trunk can be used for unauthorized calls.
Watch for:
Unexpected destinations
Unusual call volume
Calls outside business hours
Unexpected international traffic
Rapid balance reduction
Unknown caller IDs
Stop the Trunk and contact the carrier when suspicious activity appears.
6.149 Credential Rotation
When rotating credentials:
- Stop active Campaigns.
- Wait for calls to end.
- Change the credential with the provider.
- Update AIUNIFY Assistant.
- Reload Asterisk.
- Test connectivity.
- Place a telephone test.
- Resume Campaigns.
Compliance
6.150 Calling Rules
Using SIP instead of Twilio does not change the organization’s responsibility for:
Consent
Do-not-call rules
Calling hours
Caller-ID accuracy
AI disclosures
Recording consent
Data privacy
Industry restrictions
6.151 Carrier Requirements
Follow the provider’s:
Acceptable-use policy
Geographic restrictions
Emergency-services rules
Number ownership requirements
Identity verification
Traffic limitations
Recommended Setup Workflow
6.152 Complete SIP Setup Order
Use this sequence:
1. Obtain the SIP provider account.
2. Obtain or port the telephone number.
3. Collect Host, Port, Transport, credentials, and codecs.
4. Authorize the AIUNIFY server IP where required.
5. Confirm Asterisk is Connected.
6. Add the SIP Trunk.
7. Replace every preset placeholder.
8. Save the Trunk.
9. Reload Asterisk.
10. Test Trunk connectivity.
11. Add the SIP Phone Number.
12. Assign the Trunk.
13. Assign an inbound Agent or fallback.
14. Configure provider inbound routing.
15. Create or edit the outbound Agent.
16. Assign the SIP Phone Number.
17. Place a controlled test call.
18. Test an inbound call.
19. Review Leads and Call Logs.
20. Run a one-Lead Campaign.
21. Expand only after successful review.
6.153 Controlled Outbound Test
- Use an internal Lead.
- Confirm Asterisk Connected.
- Confirm the Trunk test result.
- Confirm the SIP Phone Number.
- Confirm ElevenLabs.
- Confirm an Agent exists.
- Start a test call.
- Verify caller ID.
- Verify two-way audio.
- Review the Call Log.
6.154 Controlled Inbound Test
- Confirm provider Origination URI.
- Call the SIP number from an outside telephone.
- Confirm the correct Agent answers.
- Confirm the opening message.
- Test speech recognition.
- Test Knowledge Base answers.
- End the call normally.
- Find the inbound Lead.
- Review the SIP and inbound Tags.
- Review recording and transcript.
6.155 Fallback Test
- Temporarily remove the inbound Agent.
- Confirm the Fallback Number.
- Call the SIP number.
- Confirm the fallback destination rings.
- Restore the Agent after testing.
- Retest normal inbound AI handling.
Do not perform this test during production hours without approval.
Checklists
6.156 Provider Information Checklist
Confirm:
Provider account active
SIP product enabled
Telephone number active
Host confirmed
Port confirmed
Transport confirmed
Authentication method confirmed
Username confirmed
Password confirmed
Realm confirmed
Caller ID approved
Codecs confirmed
Server IP approved
Inbound URI configured
6.157 Trunk Entry Checklist
Confirm:
Trunk Name is meaningful
Preset placeholders replaced
Host has no protocol prefix
Port is numeric
Transport matches provider
Username is correct
Password is current
Realm is exact
Caller ID is authorized
Codecs are supported
Provider and Region are accurate
6.158 Asterisk Checklist
Confirm:
Asterisk Connected
No unexpected active calls
Reload completed
No reload warning remains
PJSIP endpoint is available
ARI remains connected
6.159 Phone Number Checklist
Confirm:
Provider set to SIP
Number uses international format
Correct Trunk selected
Correct inbound Agent selected
Fallback reviewed
Number saved successfully
6.160 Outbound Checklist
Confirm:
Agent has SIP Phone Number
Phone Number has SIP Trunk
Asterisk Connected
AI keys configured
Destination valid
Caller ID authorized
Provider permits destination
Telephone test succeeds
6.161 Inbound Checklist
Confirm:
Carrier sends calls to AIUNIFY server
Public SIP port correct
Firewall permits SIP
RTP ports permitted
Called number matches Phone Number
Inbound Agent exists
Fallback tested
Inbound Lead appears
Call Log appears
Two-way audio works
6.162 Security Checklist
Confirm:
Credentials are not exposed
Provider account uses strong authentication
Server IP restrictions are active
International destinations are limited
Call-volume alerts are enabled
Former administrators removed
Credentials rotated when necessary
6.163 Pre-Deletion Checklist
Confirm:
No active calls
No running Campaign
No Phone Numbers linked
No Agents depend on those numbers
Provider obligations reviewed
Backup configuration preserved
Deletion approved
Asterisk reloaded afterward
Chapter Completion
At the end of this chapter, the user should understand the difference between SIP Trunks and SIP Phone Numbers; how Asterisk, ARI, PJSIP, carriers, Phone Numbers, AI Agents, and Campaigns work together; how to create a Trunk using a provider preset or manual configuration; how to enter Host, Port, Transport, credentials, Realm, Caller ID, and Codecs; how encrypted SIP Passwords are handled; how to reload Asterisk; how TCP, TLS, and UDP connectivity tests differ; how to create inbound and outbound SIP routing; how fallback forwarding works; how inbound SIP Leads are created; how to test real telephone calls; how to recognize common SIP errors; and how to protect SIP infrastructure from unauthorized use.