Inbound Channel Grouping

This How-To will explain how to configure certain T1/E1 Channels to go to certain PBX's based on the port the call comes in on as shown below.

1 (1).png
  1. First thing to do is simply go to "Configuration -> PSTN Config" and then go to the interface of your choice. Once this is done then simply look for the "Name" field as shown in the picture below.

    2 (1).png
  2. Now that you know the name of the interface simply go into your "Routing Rules" as shown below and find the "default_sip_out" routing rule.

  3. Next copy this entire routing rule below it and change the qvalue to "0.002" so it gets fired first.

  4. Once this is done then change the line "<condition param="pstn.in.channelName" expr=".*"/>" to be "<condition param="pstn.in.channelName" expr="B1I1"/>" so it only fires if the call is coming from "B1I1"

  5. Next change "localhost:5060" in the line "<param name="sip.out.requestUri" expr="sip:%0@localhost:5060"/>" to be the IP and port of the PBX you want to send the call to. So if the PBX was listening on port 5060 on 192.168.1.171 then it would be "<param name="sip.out.requestUri" expr="sip:%0@192.168.1.171:5060"/>"

  6. Next you should change the name to be something different then "default_sip_out" and then copy and paste this rule again for the other ports. Also keep the same qvalue of 0.002 for all the other rules as well. The only reason we changed this is so the rule looking for the certain port will be checked before the default rule, so it goes to the higher to lower qvalue when firing the rules. Also below is the changed rule for reference.

<rule name="port1_sip_out" outbound_interface="sip" qvalue="0.002">
    <condition param="transfer" expr="false"/>
    <condition param="pstn.in.channelName" expr="B1I1"/>
    <condition param="pstn.in.dnis" expr="(.*)"/>
    <condition param="pstn.in.ani" expr="(.*)"/>
    <condition param="pstn.in.callerName" expr="(.*)"/>
    <out_leg name="" media_type="sendrecv">
      <!-- To modify the target SIP destination, just change the value below -->
      <param name="sip.out.requestUri" expr="sip:%0@192.168.1.171:5060"/>
      <param name="sip.out.from.uri" expr="sip:%1@GW_HOST_IP:GW_SIP_PORT"/>
      <param name="sip.out.from.displayName" expr="%2"/>
      <param name="sip.out.transport" expr="udp"/>
    </out_leg>
  </rule>

Return to Documentation Home I Return to Sangoma Support