Tuesday, January 17, 2023

Route Inbound calls to 3rd party PBX (Cisco) system when MS Teams respond with 404 - User Not Found error code

In the last article, we configured call forking in AudioCodes SBC to simultaneously route inbound PSTN calls to MS Teams and Cisco (If you didn't look at it, pls check it - https://m365community.blogspot.com/2023/01/call-forking-to-route-inbound-calls-to.html. 

Call forking is an interim solution until you completely migrate your users to MS Teams. Once you migrate the users to MS Teams, we want to make default route changes on the SBC. 

So, MS Teams would be your primary telephony system for your organization. However, there are some numbers you still need to route to on-prem, e.g. Security Front Desk, Lobby Phones, Elevator Phone, and Special number that needs to be routed to the on-prem gateway.

After we migrated the users & telephony service to Microsoft Teams there are scenarios where we needed to take inbound calls to the existing 3rd Party PBX system (Cisco) without disconnecting the original call to avoid any service interruptions.

There are multiple ways we can do that in a Direct Routing scenario,
  • Configure dedicated IP Routing Rules if we have a range of numbers to take the calls into Cisco.
  • We can configure Dial-Plan and map that on the IP routing rules on the SBC to route the calls.
Above both, the solution has some manual and administrative workload and management.
  • Configure the Routing table based on the SIP Response code.
This solution was easy to configure and maintain. 

In this scenario, we will configure AudioCodes SBC to capture MS Teams response and route the call accordingly to the next system without disconnecting or the user redialing.

High-level architecture design -

Note: -I assume you already have Teams Direct Routing is implemented

IP Group -

An IP Group represents a SIP entity in the network with which the device communicates. This can be a server (e.g., IP PBX or ITSP) or a group of users (e.g., LAN IP phones). For servers, the address of the IP Group is typically defined by associating it with a Proxy Set.

SBC Alternative Routing Reason - Alternative_Route_CUCM


The Alternative Reasons Set table lets you configure groups of SIP response codes for SBC call release (termination) reasons that trigger alternative routing. This feature works together with the Proxy Hot Swap feature configured in the Proxy Sets table. 

Alternative routing based on SIP responses is configured using two tables with a "parent-child" relationship: 

Alternative Reasons Set table ("parent"): 

Defines the name of the Alternative Reasons Set. 

Alternative Reasons Rules table ("child"): 

Defines SIP response codes (404 -Not Found) per Alternative Reasons Set.

To apply your configured alternative routing reason rules, you need to assign the Alternative Reasons Set for which you configured the rules to the relevant IP Group in the IP Groups table using the 'SBC Alternative Routing Reasons Set' parameter (see above in IP Group).


Configure Proxy Set -

In addition to configuring the response codes, you need to configure the Proxy Set with one or more addresses (proxy servers) and choose the 'Proxy Hot Swap Mode' parameter is configured to Enable.

An IP-to-IP Routing rule 1) whose 'Destination IP Group' parameter is a Server-type IP Group associated with the above Proxy Set that is assigned the relevant Alternative Reasons Set.

IP-to-IP Routing rule -

Alternative routing is based on SIP response codes that the device sends (outgoing) a SIP message (e.g., INVITE, OPTIONS, and SUBSCRIBE) to one of the Teams/Cisco online proxy servers (addresses) configured for the Proxy Set that is associated with the destination IP Group of the matched IP-to-IP Routing rule.

The inbound calls are sent primarily to MS Teams if the LineURI matches with the inbound called number, the calls are routed to a specific user or resource account for auto attendant. If the user is not found, the system will respond 404 - User not found.

Since you configure the alternative routing reason on the IP group, it will check the IP to IP routing Alternative Route Option under the primary route. If the route is found, the calls will be sent to the configured IP Group route.


When the inbound number matches with Teams LineURI, the call will be accepted, and the media will start.


When the Teams LineURI does not match the called number, it will use the alternate routing option based on the Teams 404 - User Not Found error code, and the call will be routed to Cisco based on the IP group/Proxy set.






No comments:

Post a Comment