To help understand the routing logic within the MSBG, there are two key points:

1. Calls from all TDM ports routed to the local loopback IP address of the SBC: 127.0.0.1

2. Calls to TDM ports routed to 127.100.0.1 because this is the IP Address that the TDM Gateway listens on.

 

Getting Started

Log into the MSGB WebGUI and familiarize yourself with the TDM related sections

1. The Control Panel has a designated engine to start/stop the TDM Gateway


2. All the configuration options for the TDM port(s) and dialplan are located on the left colum, under Gateway

Description Details:
Global: Generic options which are not typical adjusted (leave as is unless told otherwise)
TDM Interfaces: Main configuration section to configure each TDM port:

Dialplan: Advanced PSTN dialplan.  This dialplan section is only used for advanced adjustments. It is never recommended to touch any area in this dialplan section. (SIP->TDM, TDM->SIP routing is already created by default).
SIP: For advanced SIP Protocol adjustment. It is never recommended to touch any variable in this section. 

 

Configuring E1/T1 & Signaling

1. To begin configuring the TDM ports, select TDM interfaces 

The following window will appear, displaying available/detected TDM Ports.
Below is an example of an SMBG with 4 avaialble E1/T1 ports, ready to configure


2. To begin configuring a port, select edit, located under 'Physical Config'
A window with the physical layer settings will be displayed:


3. After selecting your choice, click 'Apply to Port', where the next screen will prompt selection for link type. Select ISDN Link (PRI) for connection to a PRI telco/device




4. Select the switchtype & Signaling configuration by clicking on 'use' button. Modifications to the default profiles can be made by clicking on 'Edit Profile'


5. Port configuration is now complete. Proceed toconfiguring any other port required



*Note: Span Group number is used in the SBC dialplan configuration to specify specific ports to dial to. For example, if all 4 ports are configured and there are 4 unique PRI lines (1 for long distance, 1 for local calls..etc)each port will have a unique Span Group ID (default is 1,2,3,4). When routing the call from SIP, the unique Span Group ID is used to pass the call to that particular port. Same logic can be used for calls in the opposite direction. More on this in the SBC dialplan section.

If all your PRI lines are connected to same endpoint and want all lines to be used as a large group of channels, makesurethat 'Span Group Number' is identical for all ports (i.e. 1)


6. To apply the completed TDM configuration, navigate to the Configuration icon at the top right of the SBC menu, which will be in Orange color and select 'apply'



TDM configuration is now complete. Begin configuring the SBC SIP routing

 

TDM to SIP Routing

As mentioned, calls from any/all E1/T1 ports route towards the local loopback IP address 127.0.0.1 of the SBC.
This means the SBC needs a SIP Profile bound to 127.0.0.1 in order to catch this traffic from the PSTN, where a separatedialplan will route traffic onwards to SIP.

By default, the MSBG has a sip profile created and bound to 127.0.0.1, and called Internal_TDM. Verify this by navigating to 'Configuration'->'SIP Profiles':

 

NOTE: If you do not see this SIP Profile created click on the 'Add' button and create a new SIP Profile and select the following options:



TDM to SIPDialplan Creation

1. Navigate to 'Configuration'-> 'Routing' -> 'Call Routing', then click on 'Add' under 'Basic Call Routing'
2. Give the new dialplan a convenient name. In this example, 'from_tdm' is created to identify calls FROM the PSTN, routing TO SIP


3. Give the new dialplan a Description. (This is optional)

4. Click 'Add', under 'Rule' to create the dialplan


 

5. Under the 'Condition' section, create the filter that will match inbound PSTN calls 

To route all PSTN calls from any TDM Port, select:
-> Condition: Standard Information
-> Name: Destination Address
-> Expression: (.*)

6. Under 'Actions to perform if condition matches' create the route to SIP where to send the calls to

Depending on your network setup and the routes already created for SIP routing, select any of the available options under 'Action'.
Typically used options are:
-> Action: 'Bridge to Trunk' or 'Custom'



In the below example, therewas a sip trunk toa FreePBX pbxalready created (and bound to an internal SIP Profile), called 'to_freepbx', so all calls from PSTNwill route to the FreePBX pbx. ($1 under 'Destination' simply means that the call will route to whichever number was dialed from PSTN, since (.*) was used under 'Condition')


Final Dialplan view:



7. Last Step: Bound this newdialplanto the Internal_TDM profile so that the inbound PSTN calls have adialplanto route

Navigate back to 'SIP Profiles' and click on 'Modify' and toggle the 'Routing Plan' to select the newdialplan.



The route from PSTN to SIP is now complete.

 

SIP to TDM routing

 By default, the MSBG has an internal SIP Profile bound to any live network connections.

For example, the MSBG in the following diagram has an internal SIP Profile created and bound to the eth0-10.10.12.12.

This profile will be used for calls coming FROM sip to be captured on the SBC for routing to PSTN.

 

If there are no SIP Profiles created (other than the TDM SIP Profile), one must be created  
To Create a SIP Profile, simply navigate to 'Configuration'->'SIP Profiles' and click 'Add'
Verify the following settings are met:

 

Also by default, the MSBG has a SIP Trunk, called TDM_Trunk, used to route calls to the TDM Gateway.

As seen below, TDM_Trunk points towards the IP address 127.100.0.1 which is the IP Address that the TDM Gateway listens on. It is also bound on the Internal_TDM SIP Profile.


If your MSGB does not have a SIP Trunk pointing towards the TDM Gateway, create one now:
Navigate to 'Configuration'-> 'SIP Trunks' and click on 'Add' (as seen above)

Verify the following settings are met:

 

SIP to TDM Dialplan Creation

To route all SIP calls to all TDM ports

1. Navigate to 'Configuration'-> 'Routing' -> 'Call Routing', then click on 'Add' under 'Basic Call Routing'
2. Give the newdialplan a convenient name. In this example, 'from_sip' is created to identify calls FROM the SIP, routing TO PSTN

 

3. Give the new dialplan a Description. (This is optional)


4. Click 'Add', under 'Rule' to create thedialplan

 

5. Under the 'Condition' section, create the filter that will match inbound SIP calls. 

Toroute calls from SIP to all TDM Port, select:
-> Condition: Standard Information
-> Name: Destination Address
-> Expression: (.*)

6. Under 'Actions to perform if condition matches' create the route to TDM where to send the calls to

Select::
ActionBridge to Trunk 
TrunkTDM_Trunk    (This is the trunk that points towards the TDM Gatway at 127.100.0.1, bound to the Internal_TDM trunk) 
Destination$1         (Any number that was dialed and captured under 'Condition' with (.*) will be used to call out to the PSTN.

 

*The above dialplanwill route all SIP calls to ALL TDM ports, starting with port 1.
 If yourdeployement requires you to send calls out to specific TDM ports, follow the below details

 

To route SIP calls through specific TDM Ports:

To route calls out designated TDM ports only, the Span Group Number must be used when dialing out from SIP to TDM. 

The SBC Dialplan must call the 'g' variable to indicate that a particular Group (i.e. Span Group) is to be dialed.
Add -g-gX at the end of the Destination information: 
- To route calls to TDM port 1 only: $1-g=g1
- To route calls to TDM port 2 only: $1-g=g2

(lower case 'gx' specifies ascending channel dialing order. To send calls starting from last channel use 'G', as in $1-g=Gx)

 

Thedialplanto dial out TDM port 2 would look like:


However, the above dialplanrule is not yet complete because the 'Condition' statement is capturing every dialed destination, so all calls will go out TDM port 2.

Multiple dialplan rules MUST be created so that only specific rules are triggered which pass calls to unique TDM ports.
One Solution is to create multiple rules to filter on dialing prefix.

Example:

route to port 1:
Calls from SIP with prefix of 5555 will be stripped of the prefix and routed out TDM port 1

 

route to port 2:
Calls from SIP with prefix of 4444 will be stripped of the prefix and routed out TDM port 2


Final Dialplan view (for SIP calls to unique TDM ports):

 

Last Step: Bound this new dialplanto the Internal profile so that the inbound SIP calls have a dialplanto route
Navigate back to 'SIP Profiles' and click on 'Modify' and toggle the 'Routing Plan' to select the newdialplan.


The route from SIP to PSTN is now complete.

 

To apply the completed TDM configuration, navigate to the Configuration icon at the top right of the SBC menu, which will be in Orange color and select 'apply

 

Start the Netborder Session Controller and TDM Gateway and make some test calls!