How do I connect an AsteriskNOW system with FreePBX to a Digium gateway?

« Go Back


Product FamilyAsterisk


How do I connect an AsteriskNOW system with FreePBX to a Digium gateway?


These instructions should be adaptable to other FreePBX distributions, such as Elastix or PBX in a Flash.  These instructions also assume you already have a working PRI configuration on port1 or port2 of your Digium gateway.


Initial Setup

On the Gateway

  1. Open a web browser and navigate to your Digium gateway's IP address (for these instructions, we'll us
  2. Log in to the admin account.
  3. Navigate to 'Configuration/SIP Endpoints'.
  4. Click 'Create SIP Endpoint'.
  5. Under the 'Main Endpoint Settings'...
    • 'Enable Advanced Options' - NO
    • Select a name for the endpoint, which the gateway will use in the GUI for reference.  We will use AstNOW
    • Set the 'Username and Password', and be sure to remember it for the AsteriskNOW steps below.  For these instructions, we'll use the username user1 and password pass1.
    • The Registration field should be one of the following (the AsteriskNOW system will have to be complementary):
      • Endpoint registers with this gateway
      • This gateway registers to the endpoint
    • If 'Endpoint registers with this gateway' is chosen, dynamic will be set for the 'Hostname or IP Address', and the field will be grayed out (i.e., unchangeable).
    • Otherwise, set the AsteriskNOW system's 'Hostname or IP Address'. 
    • Unless your network requirements dictate SIP be transmitted in TCP, set 'Use UDP' to YES and 'Use TCP' to NO.
    • If there is Network Address Translation between the gateway and the AsteriskNOW system, set 'NAT Traversal' to NO.  Otherwise, set the parameter appropriately for your network.
  6. Click 'Save Endpoint'when finished configuring the gateway's SIP Endpoint.


On AsteriskNOW

  1. Open a web browser and navigate to your AsteriskNOW/FreePBX administration GUI.
  2. Log in to the admin account.
  3. Click 'Connectivity/Trunks'.
  4. Click 'Add SIP Trunk'.
  5. Set the 'Trunk Name' (it will refer to the Digium gateway).  These instructions set it to G200.
  6. Set your Outbound CallerID.  This can be anything;  these instructions will set it to 2564286161 (US number for Digium Technical Support).
  7. Under 'Outgoing Settings':
    • Set the 'Trunk Name' (G200)
    • Under 'PEER Details', set the following:
      • host=
      • defaultuser=user1
      • secret=pass1
      • type=friend
      • context=from-trunk
  8. 'Incoming Settings' can be cleared and ignored (they're covered by type=friend above).
  9. The registration string should be set to the following:
    • user1:pass1@
  10. Click 'Submit Changes'.
  11. Click 'Apply Changes' to have these changes take effect.
Once the above halves are complete, the Digium gateway should show AsteriskNOW is registered under 'Diagnostics/Connection Status/SIP Endpoints'.  If it says unregistered, or any other error message, compare the settings between the two systems and make sure that the gateway shows 'Registered' before proceeding to the next steps.

Call Routing

On the Gateway 

For simplicity's sake, we will not place the AsteriskNOW endpoint into a call routing group.
  1. Navigate to 'Configuration/Call Routing Rules'.
  2. Click 'Create Call Routing Rule'.
  3. Leave 'Simple Entry Mode' set to YES.
  4. Name this rule (e.g. PRItoAsteriskNOW)
  5. Set 'Call Comes in From' to port1 (or whatever PRI port you wish).
  6. Set 'Send Call Through' choose AstNOW.
  7. Click 'Save Call Routing Rule'.
Those instructions will allow calls to pass from the PRI port1 to the AsteriskNOW system.  We must define an opposite rule for calls passing in the other direction:
  1. Click 'Create Call Routing Rule'.
  2. As before, leave 'Simple Entry Mode' set to YES.
  3. Name this rule (e.g  AstNOWtoPRI)
  4. Set 'Call Comes in From'  to AstNOW
  5. Set 'Send Call Through' to port1 (or whatever complements the first rule above).
  6. Click 'Save Call Routing Rule'

On AsteriskNOW

An inbound route isn't strictly necessary, as we have already set any calls inbound to AsteriskNOW to be processed in the 'from-trunk' dialplan context.  Any preexisting inbound routes should be used in that case. 

Create an outbound route for the G200 trunk.
  1. Click 'Connectivity/Outbound Routes'.
  2. Under 'Add Route', set the 'Route Name' (e.g.OutG200)
  3. Set a dial pattern so users can dial through the G200 trunk.
  4. Set the first (0 position) trunk under 'Trunk Sequence for Matched Routes' to G200
  5. Click 'Submit Changes'.
  6. Click 'Apply Config' to 

Final notes

The above represents the bare minimum for getting AsteriskNOW to work with a Digium gateway (G100/G200, or any later model).  Fine-grained control of DIDs and CallerID is outside the scope of this article, but many options are available.  If you've tried the instructions here, and you're still having trouble, please call Digium Technical Support at +1.256.428.6161, option #2, and we will assist.

Knowledgebase Home | Product