...
The Asterisk PJSIP-based SIP channel driver is included with Asterisk versions 12, 13, and newer. For use with Digium SIP Trunking service, configure the following objects in the chan_pjsip configuration file, pjsip.conf, which is typically located on your filesystem in /etc/asterisk:
transport
auth
aor
endpoint
registration
identify
For more information on each chan_pjsip object type, refer to the PJSIP Configuration Sections and Relationships wiki page.
...
In this object (digium-siptrunk), an endpoint is declared that operates in Asterisk Dialplan context from-digium-siptrunk (discussed in Asterisk Dialplans), that allows, by first disallowing all, the G.722, G.711 u-law, and G.729a audio codecs, which use the authentication object (digium-siptrunk-auth), and which is associated with the address of record object ( digium-siptrunk-aor ).
Info |
---|
NOTE: G.729a is typically only allowed if you've installed Digium's G.729 Add-on for Asterisk. G.729 is a licensed algorithm that cannot be distributed or used freely without this add-on. |
Registration Configuration
...
To configure the older Asterisk chan_sip-based SIP channel driver for use with the Digium SIP Trunking service, configure the following objects in the chan_sip configuration file sip.conf, which is typically located on your filesystem in /etc/asterisk:
Outbound Registration (chan_sip Register Configuration)
...
In this sample, sip peer object, our host is set to sip.digiumcloud.net, and the defaulter and the fromuser options are set to our Digium username; secret is set to our Digium password, and an option called insecure is set to invite (because the Digium SIP Trunking servers do not reverse authenticate when sending you calls); trustrpid and sendrpid are enabled for Caller ID forwarding, and the inbound Dialplan context is set to from-digium-siptrunk, We have explicitly disabled directmedia, and, by first disallowing first, we've enabled the G.722, G.711 u-law and G.729a audio codecs.
Info |
---|
NOTE: G.729a should typically only be allowed if you have installed Digium's G.729 Add-on for Asterisk. G.729 is a licensed algorithm that cannot be distributed or used freely without this add-on. |
Asterisk Dialplans
To determine what to do with incoming calls, Asterisk uses a configuration of numbers and patterns matched with specific actions called a dialplan and configured in extensions.conf, which is typically located in /etc/asterisk. To complete your Digium SIP Trunking service setup, you need to configure your Asterisk dialplan. To learn more about the Asterisk dialplan, refer to the Dialplan wiki page and its children, available on the Asterisk wiki.
Inbound Dialplan (dialplan incoming call context)
Outbound Dialplan (dialplan outgoing call context)
Inbound Dialplan (dialplan incoming call context)
...
In this example, we have configured pattern matches for 1 + 10-digit North American dialing, 10-digit North American dialing, and International Dialing. Users of chan_sip, in lieu of chan_pjsip, may dial using the SIP technology instead of PJSIP. The ,,25 in each of the Dial statements means Asterisk will attempt the dial for no more than 25 seconds before jumping to the next step--a Hangup() as we have configured here. You need to replace your_digium_caller_id_number with your DID number as received from Digium: e.g., 8005551234.
Info |
---|
NOTE: By default, Digium SIP Trunking accounts are able to dial US48 numbers. For extended North American dialing as well as International Dialing capabilities, contact Digium Cloud Services Customer Service. |
If your account is not authorized for International dialing, International call attempts will return the following message:
...