How to configure a Digium SIP Trunking account with AsteriskNOW and FreePBX

« Go Back

Information

 
Answer

FreePBX Configuration

The default behavior of FreePBX version 12 is to use chan_pjsip for endpoints and trunks.  Sections of this article will cover installations of FreePBX configured with either chan_pjsip or chan_sip. Selection of either chan_pjsip or can_sip from within your distribution can be found in the Admin Web tool under Settings -> Advanced Settings -> Dialplan and Operational -> SIP Channel Driver.  The Admin Web tool may be viewed by visiting:

http://[ip of your freepbx]/admin

To configure FreePBX to work with Digium's SIP Trunking service, you should make configuration changes in 3 areas:
  • Connectivity -> Trunks
  • Connectivity -> Inbound Routes
  • Connectivity -> Outbound Routes
Each of these is configured using the Admin Web tool provided by FreePBX.
For more information about the configuration of FreePBX, please see the FreePBX wiki.

Trunks, chan_pjsip

First, you need to create a FreePBX Trunk for your Digium SIP Trunking account.

On the Connectivity -> Trunks page, select Add SIP (chan_pjsip) Trunk

When adding the new trunk, many settings are available, and most have defaults already configured.  To configure a Digium SIP Trunking account, make modifications to the following options:
  1. General Settings
    1. Trunk Name: digium-siptrunk
    2. Outbound CallerID: your_digium_number, e.g. 2565551234
    3. CID Options: Force Trunk CID
  2. Dialed Number Manipulation Rules (This entire section can be left at defaults)
  3. PJSIP Settings
    1. Configuration Mode: Advanced
    2. Username: your_digium_username
    3. Secret: your_digium_password
    4. SIP Server: sip.digiumcloud.net
    5. SIP Server Port: 5060
    6. Client URI: sip:your_digium_username@sip.digiumcloud.net
    7. Server URI: sip:sip.digiumcloud.net
    8. AOR Contact: sip:sip.digiumcloud.net:5060
    9. Contact User: your_digium_username
    10. Codecs: Select g722, ulaw, g729
Note 1: G729 should typically only be 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.G.729 should be used on
Note 2: Session timers is not supported by our servers, you will need to disable this feature by setting timer=no  your PJSIP channel driver configuration. 

 
Once the Trunk has been configured with these settings, click the Submit Changes button at the bottom of the screen and then, when it displays at the top of the screen, the red Apply Changes button.

Trunks, chan_sip

If you are not using chan_pjsip, you may instead create a FreePBX Trunk using chan_sip.
 
On the Connectivity -> Trunks page, select Add SIP (chan_sip) Trunk

When adding the new trunk, many settings are available, and most have defaults already configured.  To configure a Digium SIP Trunking account, make modifications to the following options:
  1. General Settings
    1. Trunk Name: digium-siptrunk
    2. Outbound CallerID: your_digium_number, e.g. 2565551234
    3. CID Options: Force Trunk CID
  2. Dialed Number Manipulation Rules (This entire section can be left at defaults)
  3. Outgoing Settings
    1. Trunk Name: digium-siptrunk
    2. PEER Details:
type=peer
directmedia=no
host=sip.digiumcloud.net
defaultuser=your_digium_username
fromuser=your_digium_username
secret=your_digium_password
insecure=invite
trustrpid=yes
sendrpid=pai
disallow=all
allow=g722
allow=ulaw
allow=g729
session-timers=refuse

G729 should typically only be 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.G.729 should be used on
  1. Incoming Settings (USER Details: blank out this section)
  2. Registration
Register String: your_digum_username:your_digium_password@sip.digiumcloud.net:5060/your_digium_username
 
Once the Trunk has been configured with these settings, click the Submit Changes button at the bottom of the screen and then, when it displays at the top of the screen, the red Apply Changes button.

Inbound Routes

Once a Trunk has been created, you should next create an Inbound Route in order to handle calls coming from Digium's SIP Trunking service to your FreePBX system.  To make these configuration changes, visit the Connectivity -> Inbound Routes page.

When adding the new Inbound Route, many settings are available, and most have defaults already configured.  To configure a Digium SIP Trunking account, make modifications to the following options:

Add Incoming Route
  • Description: calls-from-your_digium_number
  • DID Number: your_digium_number, e.g. 2565551234
  • Options (This entire section can be left at defaults)
  • Privacy (This entire section can be left at defaults)
  • Call Recording (This entire section can be left at defaults)
  • CID Lookup Source (This entire section can be left at defaults)
  • Fax Detect (This entire section can be left at defaults)
  • Language (This entire section can be left at defaults)
  • Superfecta CID Lookup (This entire section can be left at defaults)
  • Set Destination: Choose an IVR or Extension or any other destination to which you want to send Inbound Calls on this Digium SIP Trunk
Once the Inbound Route has been configured with these settings, click the Submit Changes button at the bottom of the screen and then, when it displays at the top of the screen, the red Apply Changes button.

Outbound Routes

Once an Inbound Route has been created, you should next create an Outbound Route in order to send calls from internal extensions out to Digium's SIP Trunking service.  To make these configuration changes, visit the Connectivity -> Outbound Routes page.

When adding the new Outbound Route, many settings are available, and most have defaults already configured.  To configure a Digium SIP Trunking account, make modifications to the following options:
  • Outbound Route (Route Name: digium-outbound)
  • Additional Settings (This entire section can be left blank)
  • Dial Patterns that will use this Route
    • Leave Prepend and Prefix blank and add match patterns for:
      • 1+ 10-digit dialing: 1NXXNXXXXXX
      • 10-digit dialing: NXXNXXXXXX
      • International Dialing: 011. (Don't forget the trailing period in this pattern)
  • Trunk Sequence for Matched Routes
    • 0: digium-siptrunk
  • Optional Destination on Congestion (This entire section can be left blank)
Once the Inbound Route has been configured with these settings, click the Submit Changes button at the bottom of the screen and then, when it displays at the top of the screen, the red Apply Changes button.