When the SBC recevies a REFER message you can choose to route the REFER message in the dial plan. The reason for this is to have control over which SIP profile or SIP trunk the call is sent. In the example below we will show the common scenario where a PBX will send a REFER and a new call back to the SBC will be generated.
1) Determine which SIP profile the call is orginating from. In the example below the call comes from the ITSP through the "External" SIP profile. Then the call is routed to the PBX based on the External SIP profile routing plan. The PBX then sends the REFER back to the SBC. This REFER is handled in the "External" SIP Profiles routing plan because the call was originally routed there. To begin edit the External routing plan as shown below. Then click "add" to make a new routing plan.
2) Below is the dial plan you need to add to handling the REFER message. The explanation of this is the following:
Rank - Set this to a value that is higher then your other routes that could bridge the call somewhere else.
Stop Policy - Stop On Sucesss - The reason for this is the call will stop routing if it is a REFER
Condition - Variable "sip_refer_to" we know it is refer method because it has a refer-to sip header in the "SIP:<user>@<host>" format.
Actions - Use the custom action with the application bridge. It is required to use a custom action for all bridges with in the dial plan, in order for REFERs to be routed.
Once done click SAVE
Variable Name - sip_refer_to
Expression - ^.*sip:[\+]?(.*);
Variable - sip_force_full_to
Value - sip:$1
Data - sip/trunk/PBX/$1
3) Next edit any previous rules that bridged calls using the action "bridge/bridge to *" and replace them as shown below with the custom application. It is required to use a custom action for all bridges with in the dial plan, in order for REFERs to be routed.
4) Once done Save, apply the configuration and test. The dial plan summary page should look as shown below.