Home / ComXchange / ComXchange PBX Configuration / ComXchange Trunk Configuration

ComXchange Trunk Configuration


Overview

As the ComXchange is a VoIP PBX it will send and receive calls natively over SIP so any trunk calls will either need to be a direct SIP connection or use a gateway to convert non SIP trunks such as T1, PRI, or FXS trunks to SIP and then delivered to the ComXchange.  PJSIP trunks are generally used for direct SIP connections to a carrier over the WAN interface, however there are still cases where you may see ChanSIP trunks being used.  This is typical when connecting to a carrier as a peer over the local LAN network or connecting to a gateway.  In the ComXchange the Trunks Module will be where you can create and see the trunks that are configured on the server.  If you are using Clearly IP trunks as your carrier you can use the integrated Clearly Trunking module to automatically set up the Clearly IP trunks in the Trunks Module with the use of a token.  Click on the link for more information on using the Clearly Trunking module 
2024-09-23_11h46_39

SIP Trunks to the Carrier

Sip Trunks can be configured using chan_pjsip or chan_sip the following will show configuration examples of both in the ComXchange Trunks Module.  These Trunks can either be Direct connections to a SIP provider over the internet using registration, a local SIP handoff using IP authentication or a SIP trunk to a gateway that will convert the SIP call to a legacy analog or PRI handoff. 

PJSIP Trunk Examples

Chan_pjsip Trunk to SIP Provider using Registration

Pjsip is the current channel driver used by asterisk based phone systems.  The configuration of chan_pjsip trunks in the trunking module offers more configuration fields than what is available when creating a Chan_sip trunk.  This can be helpful when there are specific configurations specified for different carriers.  The following are some basic Configurations of a trunk using chan_pjsip to register to a SIP provider.  Since we are not using registration, it is important that the provider send calls to whatever port pjsip is bound to which is configured to port 5160 by default.
Navigate to Core Configuration > Trunks
  • Click on Add Trunk
  • Choose + Add SIP(chan_pjsip) Trunk
  • Under the General Tab:
    • Trunk name - descriptive name for the trunk often set the same as the username and auth username from the provider
    • Outbound CallerID - This will usually be the Hotel's main number
    • CID Options - this will usually be set to Allow and CID which will allow extensions to dial out with a CID other than the Trunk caller ID however some carriers will require the use of forcing the trunk CallerID or blocking foreign CID's to force the trunk CID on transferred calls off of the system while CID's for extensions will still be allowed.
2024-09-20_11h14_04
Under the pjsip Settings tab you will configure the settings to connect to the provider.  These are settings that should be provided to you from the provider.
  • PJSIP Settings tab - General tab.
    • Username - the trunk username provided by the SIP provider
      • Auth Username - only needs to be filled in if different than the Username.
    • Secret - the trunk password provided by the SIP provider.
    • Set Authentication to outbound.
    • Set Registration to Send.
    • Sip Server - add the FQDN or the IP address of the SIP server in this field.
    • Sip Server Port - add the port that the trunk will use to register
2024-09-20_11h37_57
There are fields in the PJSIP Settings Advanced tab that can manipulate where the SIP traffic is sent as well as the ability to manipulate the SIP invite for carriers that require specific settings.  Below are some of the fields that may be used.
  •  PJSIP Settings tab - Advanced tab.
    • The outbound Proxy can be used if the carrier requires it.
    • The Contact User field can be used to set the Contact in the SIP invite.
    • The From Domain field can be used to specify the from domain for SIP requests to this trunk.
    • The From User field can be used to set the From header for SIP requests to this trunk.
2024-09-20_11h38_58
Once the configuration is done you can verify the status of the Trunks by looking in the asterisk info under reports.
Navigate to Reports > Asterisk Info - Registries
 2024-09-23_15h28_26

Chan_pjsip Trunk Using IP Authentication

Some SIP Providers will only accept calls from a specific IP address and are not using a registration to understand where to send calls.  This can be over the internet, but more commonly this can be seen when the SIP provider is able to handoff directly on site, in most cases in this scenario they would put one interface of their SBC on the ComXchange Local Area Network (LAN) to avoid a need for routing.   When working with a Provider and they are willing to set an IP address on the LAN we suggest using 192.168.101.20 or 192.168.101.19, .20 is a typical address that we would use for an FXO or PRI gateway to route calls to the PSTN as well. 

Navigate to Core Configuration > Trunks

  • General Tab:
    • Trunk name - descriptive name for the trunk
    • Outbound CallerID - This will usually be the Hotel's main number
    • CID Options - This can be set to allow all unless specified by the Provider
2024-09-23_16h28_46
  • PJSIP Settings tab - General tab.
    • Set Authentication to None.
    • Set Registration to None.
    • Sip Server - add the IP address of the SIP server in this field.
    • Sip Server Port - add the port that the trunk will use to communicate with the provider
2024-11-22_09h12_39
This will create a pjsip peer which can be seen in Asterisk Info -peers

Chan_pjsip Trunk to a Gateway

The Clearly IP gateways will be used to translate the SIP call from the ComXchange to an FXO, T1 CAS, or a PRI call if that is what is being handed off at the site.  The Trunk is setup much like an IP authentication trunk but we can user name and password for authentication.  The trunk username (which by default will be the Trunk Name) and password will need to match the Username, Authentication name and password in the gateway.  The trunk will point to the IP addresss of the gateway which is typically set to 192.168.101.20 on the ComXchange LAN network.

Navigate to Core Configuration > Trunks

  • Click on Add Trunk
  • Choose + Add SIP(chan_pjsip) Trunk
  • Under the General Tab:
    • Trunk name - This name will match the Username and Authentication name used for the the gateway Sip Settings if using either inbound or both for authentication.
    • Outbound CallerID - This will usually be the Hotel's main number
    • CID Options - This can be set to allow all unless specified by the Provider

2024-09-23_16h54_53

  • PJSIP Settings tab - General tab
    • Username - When using Both or Inbound Authentication this will use the Trunk name from the General page and will not need to be set.
    • Auth Username - When using Both or Inbound Authentication this will use the Trunk name from the General page and will not need to be set.
    • Secret - This can be a random password but will need to match the Registrar Password in the Gateway.
    • Set Authentication to Both.
      • It is possible to use Inbound or None as well but in this example we are using both 
    • Sip Server - add the FQDN or the IP address of the SIP server in this field.
    • Sip Server Port - add the port that the trunk will use to talk to the gateway by default use 5060.

2024-10-10_10h07_02

These Authentication settings will need to match the settings in the Gateway.  Below is an example of the settings for a ClearlyIP PRI Gateway's SIP settings.

2024-10-10_10h11_07

Chan_sip Trunk Examples

Please note that chan_sip is the older SIP driver and chan_pjsip is the newer driver that many carriers recommend using to connect to their services but there may be instances that a Chansip connection could be used.

Chan_sip Trunk Using Registration

The following is a basic configuration of a Chan_sip trunk using registration.  The SIP settings peer details may have different configuration requirements based on the carrier or the device you are connecting to.     
Navigate to Core Configuration > Trunks
  • Click on Add Trunk
  • Choose + Add SIP(chan_sip) Trunk
  • Under the General Tab:
    • Trunk name - descriptive name for the trunk
    • Outbound CallerID - This will usually be the Hotel's main number
    • CID Options - This can be set to allow all unless specified by the Provider
2024-08-29_11h55_47
To configure the Chan_sip trunk to connect to a Service Provider you will need to configure two main items in the SIP Settings tab to connect and allow calls to be made and received.
  • SIP Peer information in the Outgoing tab - Peer details. 
    • Add A Trunk Name - this may need to match the username from the peer details.
    • Enter the Peer Details - These will need to match the settings needed by the carrier to identify the trunks Calls that are being sent to the carrier from the ComXchange.
      • The below Peer Details are some of the settings that might be needed from the Service provider for calls to work.
2024-09-03_13h50_31
The outbound registration String establishes connectivity to the SIP provider and will help the carrier identify where to send calls to the ComXchange
  • Outbound Registration in the Incoming tab - Registration String. 
    • Enter the registration details needed by the carrier
    • This string will typically contain the below paramaters but will vary depending on the carrier
      • <username>:<password>:<username>@<sip url>/<did>
2024-09-03_13h52_20

Chan_SIP Trunk Using IP authentication 

Some carriers may not rely on a registration or username and password and connect based on the IP Address of the PBX to allow calls.  This may be a connection over the internet but more commonly seen when there is a direct SIP hand off on premise.  In cases like this the SIP provider may be able to set an IP address on the local LAN of the ComXchange and external calls will be sent and received using that IP address.
Navigate to Core Configuration > Trunks
  • Click on Add Trunk
  • Choose + Add SIP(chan_sip) Trunk
  • Under the General Tab:
    • Trunk name - descriptive name for the trunk
    • Outbound CallerID - This will usually be the Hotel's main number
    • CID Options - This can be set to allow all unless specified by the Provider
2024-10-10_11h08_22

The Sip Settings Peer details under the Sip Settings Outgoing Tab will have a minimal configuration similar to the following configuration parameters:
  • Trunk Name Field -  This can be the same as the Trunk name in the General Settings and the username in the Peer Details or it can be unique
  • Peer Details
    • Hostname=<IP address of the providers equipment>
    • type=peer
    • insecure=port,invite
    • disallow=all
    • allow=ulaw


2024-09-03_16h13_32

Chan_sip Trunk to a Gateway

You can connect to gateways using Chan_sip if needed.  If you are connecting to a Clearly IP gateway you can use the Chan_pjsip option documented above or this way as well.  
Navigate to Core Configuration > Trunks.
  • Click on Add Trunk
  • Choose + Add SIP(chan_sip) Trunk
  • Under the General Tab:
    • Trunk name - This name will match the Username and Authentication name used for the the gateway Sip Settings
    • Outbound CallerID - This will usually be the Hotel's main number
    • CID Options - This can be set to allow all unless specified by the Provider
2024-10-18_16h52_41
The Sip Settings Peer details under the Sip Settings Outgoing Tab will have a minimal configuration similar to the following.
  • Trunk Name Field -  This should be the same as the Trunk name in the General Settings and the username in the Peer Details
  • Peer Details
    • username=<Match the Trunk name from the General Tab, it will also match the Username and Authentication name in the gateway SIP settings>
    • secret=<This can be a random password but will need to match the Registrar Password in the gateway SIP setttings>
    • insecure=port,invite
    • host=<Gateway IP>
2024-10-21_16h40_30





     RSS of this page