Dial Plan and Carrier Entries for Asterisk and Vicidial
Configuration templates for integrating the Smart Carrier SIP carrier with Asterisk and Vicidial systems, including carrier endpoint definitions and dial plan examples for call routing.
You may need to modify these entries to suit your needs, particularly regarding prefix customization in the dial plan configurations.
sip.conf entries
[SmartCarrier-155]
context=trunkinbound
type=friend
host=155.138.235.95
insecure=port,invite
disallow=all
allow=ulaw
allow=alaw
nat=force_rport,comedia
qualify=yes
canreinvite=no
sendrpid=yes
dtmfmode=rfc2833
[SmartCarrier-64]
context=trunkinbound
type=friend
host=64.176.213.101
insecure=port,invite
disallow=all
allow=ulaw
allow=alaw
nat=force_rport,comedia
qualify=yes
canreinvite=no
sendrpid=yes
dtmfmode=rfc2833pjsip.conf entries
[SmartCarrier-155]
type=endpoint
context=trunkinbound
disallow=all
allow=ulaw,alaw
aors=SmartCarrier-155
direct_media=no
send_rpid=yes
dtmf_mode=rfc2833
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
qualify_frequency=60
transport=transport-udp
[SmartCarrier-155]
type=aor
contact=sip:155.138.235.95
[SmartCarrier-64]
type=endpoint
context=trunkinbound
disallow=all
allow=ulaw,alaw
aors=SmartCarrier-64
direct_media=no
send_rpid=yes
dtmf_mode=rfc2833
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
qualify_frequency=60
transport=transport-udp
[SmartCarrier-64]
type=aor
contact=sip:64.176.213.101Dial plans
Simple plan: routes calls through the primary carrier with a specific prefix (76101 in the example; replace with your own):
exten => _76101.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _76101.,n,SIPAddHeader(X-LeadID:${lead_id})
exten => _76101.,n,SIPAddHeader(X-DOB:${date_of_birth})
exten => _76101.,n,SIPAddHeader(X-PostalCode:${postal_code})
exten => _76101.,n,Dial(SIP/SmartCarrier-155/76101${EXTEN},,tTor)
exten => _76101.,n,HangupFailover plan: attempts the secondary carrier (SmartCarrier-64) if the primary (SmartCarrier-155) returns CONGESTION or BUSY, with a 60-second absolute timeout and custom SIP headers for lead data:
exten => _X.,1,Set(TIMEOUT(absolute)=60)
same => n,AGI(agi://127.0.0.1:4577/call_log)
same => n,SIPAddHeader(X-LeadID:${lead_id})
same => n,SIPAddHeader(X-DOB:${date_of_birth})
same => n,SIPAddHeader(X-PostalCode:${postal_code})
same => n,Dial(SIP/SmartCarrier-155/76101${EXTEN},60)
same => n,GotoIf($["${DIALSTATUS}"="CONGESTION" \
| "${DIALSTATUS}"="BUSY"]?SmartCarrier-64)
same => n,Hangup()