Variable transfer on fail

From FreeSWITCH Wiki
Jump to: navigation, search


Allows you to tranfer call flow when a called party can not be reached for specific reasons ( unallocated_number, etc )


<action application="set" data="transfer_on_fail= UNALLOCATED_NUMBER"/>

in this example, if you were to attempt a bridge that resulted in "UNALLOCATED_NUMBER" , the call flow would be "transferred" to the "UNALLOCATED_NUMBER" destination in your current dialplan ( probably default xml dialplan )


<action application="set" data="transfer_on_fail=<hangupcauses> <destination> <dialplan> <context>"/>


<action application="set" data="transfer_on_fail=1"/>

<hangupcause> can be the string "auto_cause" which will be replaced by the hangup cause returned by the bridge. this is the default action if no destination, dialplan or context are specified.

<action application="set" data="hangup_on_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="set" data="transfer_on_fail=UNALLOCATED_NUMBER auto_cause xml error"/>
<action application="bridge" data="A..."/>

<action application="bridge" data="B..."/>

then have the an "Error" context in your dialplan.

<context name="error">
    <extension name="UNALLOCATED_NUMBER" continue="true">
      <condition field="${originate_disposition}" expression="UNALLOCATED_NUMBER" continue="false" break="on-true">
        <action application="playback" data="/usr/local/freeswitch/sounds/NotInService.wav"/>
        <action application="hangup" data="NORMAL_CLEARING"/>

See also: