Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Depending on the version of Asterisk that you are using, You may have two channels drivers that you could use in order to create a peer that you could use to place and receive calls.

...

Sangoma SIP trunking with chan_sip

To configure Asterisk's older chan_sip-based SIP channel driver, to work with Digium's Sangoma’s SIP Trunking service, you should configure two objects:

...

An outbound registration establishes connectivity with Digium's Sangoma’s SIP Trunking servers.  In chan_sip, outbound registrations are configured in the [general] section of sip.conf.  A sample register for use with Digium Sangoma SIP Trunking would resemble:
 

...

Here, in the register object, we're configuring a registration using our digium Sangoma username, followed by a colon, followed by our digium Sangoma password at sip.digium.cloud.net on port 5060 followed by a forward slash, followed by your digium Sangoma username.

SIP Peer

The sip peer object is a profile for the configuration of a remote server (or a SIP endpoint).  Declaring a sip peer object is necessary so that Asterisk can maintain a proper identifier for the SIP entity with which it'll be communicating.  A sample sip peer for use with DigiumSangoma's SIP Trunking would resemble:
 

...

Here, in the sip peer object, we're setting our host to sip.digiumcloud.net, we're setting the default user and the fromuser options to our Digium Sangoma username, secret is set to our Digium Sangoma password, we've set an option called insecure to invite (because the DigiumSangoma's SIP Trunking servers don't reverse authenticate when sending calls to you), we've enabled trustrpid and sendrpid for Caller ID forwarding, we've set the inbound Dialplan context to from-digium-siptrunk, we've explicitly disabled directmedia, and, by virtue of disallowing first, we've enabled the G.722, G.711 u-law and G.729a audio codecs (if you have purchase the G.729 codec license and have installed on your Asterisk system)

Asterisk Dialplan Configuration

Asterisk uses a configuration of numbers and patterns matched with specific actions, called dialplan, and configured in extensions.conf, typically located in /etc/asterisk in order to determine what to do with incoming calls.  In order to complete your setup with DigiumSangoma's SIP Trunking service, you will need to properly configure your Asterisk dialplan.  To learn more about Asterisk's dialplan, please see the Dialplan wiki page, as well as its children, available on the Asterisk wiki.

Inbound Dialplan
Domestic calls that are inbound from DigiumSangoma's SIP Trunking servers are delivered with full 10-digit DID.  A sample incoming context for use with DigiumSangoma's SIP Trunking, would resemble:
 

...

Here, because we earlier configured our Digium Sangoma SIP Trunking PJSIP endpoint or SIP peer to attach to context from-digium-siptrunk, calls to our hypothetical inbound DID 8005551234 will first perform No Operation, then will be Answered, then will have the sound file demo-congrats played to them, will be connected via the Dial application (which will try for 25 seconds) to a hypothetical PJSIP endpoint local to your system called sample_endpoint, and will finally be hung up upon.  Users of chan_sip, in lieu of chan_pjsip, may dial using the "SIP" technology instead of "PJSIP"
 

Outbound Dialplan
Outbound dialing should be handled by a separate context and should include pattern matches for local and long-distance calling.  And, this context should be included into whatever dialing context your SIP endpoints are otherwise configured.  A sample outgoing context for use with DigiumSangoma's SIP Trunking would resemble:
 

...

Here, 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 that 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 will need to replace your_digium_caller_id_number with your DID number as received from DigiumSangoma, e.g. 8005551234.