Dialplan Handling Incoming Redirect

From FreeSWITCH Wiki
Jump to: navigation, search

Contents

Overview

This page describes how to manually handle SIP redirect messages (3xx).

Channel Variables

Like everything else on FreeSWITCH, manual redirects are controlled and informed using channel variables. Next, we present the related variables dividing them by Input (change the behavior) and Output (inform what has been done or will be done). We also present the only configuration needed to enable this behavior.

Input variables

Note: These variables must be set on the B-leg. This may be counter-intuitive since it's the A-leg that is transferred. You should either set the variables in a dialstring, or set them on the A-leg then use the export app.

The advantage of this is you can set the variables in multiple locations - exported from the A-Leg, or in the dialstring in the {} global variable list or in the [] per-destination variable list. This means you can set a default then override it through a dialstring, on a per-destination basis so that different gateways handle redirects in the dialplan differently.

sip_redirect_profile

Which profile to use when dialing out to redirect contacts. Defaults to: Current profile

sip_redirect_context

Which context to transfer the call to when handling redirects. Defaults to: redirected

sip_redirect_dialplan

Which dialplan technology will be used for handling the redirection. Defaults to: XML

sip_redirect_fork

If set to true, it will set the dialstring with the ',' separator instead of the '|' separator. Defaults to: false

Output variables

sip_redirect_contact_<index>

After receiving a 3xx SIP message, this variable will be set with the contact header of each Contact header on the received message. <index> ranging from 0 to the number of contacts in the message.

sip_redirect_contact_host_<index>

After receiving a 3xx SIP message, this variable will be set with the contact host of each Contact header on the received message. <index> ranging from 0 to the number of contacts in the message.

sip_redirect_contact_params_<index>

After receiving a 3xx SIP message, this variable will be set with the contact params of each Contact header on the received message. <index> ranging from 0 to the number of contacts in the message.

sip_redirect_dialstring_<index>

After receiving a 3xx SIP message, this variable will be set with the dialstring formed from each Contact header contained on the message. <index> ranging from 0 to the number of contacts in the message.

sip_redirect_dialstring

After receiving a 3xx SIP message, this variable will be set with the dialstring formed from all Contact header contained on the message. Beware that the separator will be influenced by the sip_redirect_fork variable.

sip_redirected_by

On Aastra phones, this variable is not populated by FreeSWITCH. It's purpose is unknown.

sip_redirected_to

This variable is populated with the contact to which the call was bridged to.

Related sofia configuration

This is the only configuraion needed to be able to trigger manual redirects.

The parameter needs to be set on the profile receiving the 3xx message.

<param name="manual-redirect" value="true"/>