It is recommended that you use the PBX - IP Trunk Assistant page to configure SIP trunks.
Adding a SIP Trunk
To add a new SIP trunk, perform the following steps:
- From the PBX tab, select PBX Configuration
- From the left side column, select Trunks
- On the Add a Trunk page, which presents available trunk types, select the Add SIP Trunk link
- On the Add SIP Trunk page, enter the following:
- Trunk Name – Descriptive name for the trunk
- Outbound Caller ID (caller ID used for outgoing calls)
- Fill in all trunk specific parameters. You should configure at least the following fields:
- Outgoing Settings – PEER Name (a unique name of the trunk, i.e. the channel ID of the trunk) – this field was labeled Trunk Name in earlier releases
- Outgoing Settings – PEER Details (type, host, user name, secret, DTMF mode)
- For a registration based authenticated trunk, you will need to configure the following field as well:
- Registration – Register String (registration string in the form username:[email protected] or username:[email protected]/DID)
- Press the Submit Changes button to create the SIP trunk
Some SIP trunk providers require the registration string (e.g., username:[email protected]) to be followed by the DID number of the SIP trunk (e.g., username:[email protected]/2145551234). If your SIP trunk is provided by one of these providers, DID matching in inbound routes will not work without this registration string suffix.
The following table describes the trunk parameters under PEER Details. You should obtain the required parameters and values from your service provider and enter them into the PEER Details box.
Order of the parameters is important. For example when using the deny/permit parameters, deny should be listed before permit.
Parameter | Commonly Used Values | Description |
---|---|---|
host | xxx.xxx.xxx.xxx | IP address of the SIP trunk provider’s server |
type | peer | The supported values are: peer, user, friend. Friend is both a peer and user. |
context | from-trunk | “from-trunk” means that incoming calls from this trunk will be treated as if they are coming from an outside line, and will be routed using the rules that you setup in the Inbound Routes page. “from-internal” means that incoming calls from this trunk will be treated as if they were made by an internal phone, and will be routed directly to an extension number, a feature code, or through the outbound routes page. “from-pstn-toheader” means that incoming calls from this trunk is from an outside line where the DID number is embedded in the toheader. Generally, you use “from-trunk” when routing calls from an outside source and “from-internal” for trunks that tie two trusted systems together. |
qualify | yes | “yes” means to periodically send a request that the other system identify itself. If there is no answer within 2 seconds, your system will assume that the other system is down and stop sending calls to the system until the system responds. Instead of “yes,” you can also put a number, in miliseconds. For example, qualify=3000 means that your system will wait 3 seconds for a response, instead of 2 seconds. |
insecure | port,invite | “port” means to accept incoming calls even if they come from a port other than the one where calls are expected to come from. “invite” means to accept incoming calls even if they are not accompanied by the proper username and password. Most ITSP’s require this line. If only one is used, the comma separating them is omitted. |
deny | 0.0.0.0/0.0.0.0 | [Optional] For added security, include “deny” and “permit” to limit access based on IP address. |
permit | xxx.xxx.xxx.0/255.255.255.0 | [Optional] Allow access only to the specified IP subnet. |
callbackextension | xxxxxxxxxx | [Optional] DID number associated with the trunk. Add this field if you have more than one SIP trunk from the same SIP provider. |
The connection parameters in PEER Details are applied to both incoming and outgoing. Only in cases when you have two different PEERS for incoming and outgoing, then you would fill in the USER Context and USER Details for the second PEER. In most cases, you just leave the USER Context and USER Details blank.
Dedicated Internet Connection
If you have a dedicated internet connection for your SIP trunk, proceed to the Static Routes page to configure a static route for your SIP trunk.
Multiple SIP trunks from the same provider
If you have more than one SIP trunk from the same SIP provider, add the callbackextension=<DID number> parameter to PEER Details section to correctly identify the trunk source in the CDR records.
For example, you have two SIP trunks from the same service provider. One trunk is associated with DID number 2144277218 and another is associated with DID number 4697012911. Both trunks are registered to the same provider’s server.
For the first trunk, add callbackextension=2144277218 to the PEER Details of the first trunk.
For the second trunk, add callbackextension=4697012911 to the PEER Details of the second trunk.