- Go to "Configuration -> Signaling -> SIP Profiles", modify and edit a SIP Profile.
- Under "Session Routing", toggle "Manual Redirect Routing" to "Disable" for "Auto" mode and "Enable" for "Manual" mode.
In Manual mode. We must specify a "redirected" dialplan extension as follow:
In the above example, "sip_redirect_context" Channel Variable must be set before the bridge application. This instructs the system which dialplan to look for the redirect instruction. The "user-" is a prefix which must be there literally, followed by the name of the dialplan. In the above, this dialplan must be named "dialplan_name". Once this is specified, when a SIP 3XX Redirect is received when the call is bridging, an extension named "redirected" in dialplan "dialplan_name" will be used for the redirection. Here, the bridge application uses a different trunk to establish the new leg.
The following further modify the "redirected" extension to log the value of each of the above output Channel Variables.
If we receive the below SIP 302, the above dialplan extension will have the following output:
SIP/2.0 302 Temporarily Moved
The first redirect contact is <sip:email@example.com:6600;transport=UDP>
The first redirect contact host is 192.168.10.102
SIP redirect parameters in the first redirect contact are transport=UDP
The first redirect dialstring is sofia/trunk/trunk1/sip:firstname.lastname@example.org:6600;transport=UDP
All dialstrings sofia/trunk/trunk1/sip:email@example.com:6600;transport=UDP
To Header value <sip:firstname.lastname@example.org:6600;transport=UDP>