Misc. Dialplan Tools transfer

From FreeSWITCH Wiki
Jump to: navigation, search

Immediately transfer the calling channel to a new context. If there happens to be an xml extension named <destination_number> then control is "warped" directly to that extension. Otherwise it goes through the entire context checking for a match.

Example: say caller dials 3015551212, causing conf/dialplan/public/3015551212.xml to "answer". If 3015551212.xml does an <action application="transfer" data="1047 XML cntxt_a"/>, that causes the conf/dialplan/cntxt_a/1047.xml to be parsed (assuming that file does a match on "^1047$".

If dialplan or context are not defined, they default to XML and default.

Note: The transfer app does not actually "transfer a call" (It might have been better named dialplan-jump). It changes the destination extension and/or context and restarts the parsing of the dialplan. Actual transfers are done after a call is answered by use of the bridge application. see bridge.


transfer <destination_number> [<dialplan> [<context>]]


<action application="transfer" data="500"/>

This example is found in public.xml. It transfers the call to the given extension in the default context, which is located in default.xml. Please note the use of XML as a dialplan as it is defined in freeswitch.xml

<extension name="public_extensions">
  <condition field="destination_number" expression="^(10[01][0-9])$">
    <action application="transfer" data="$1 XML default"/>

If the call is currently in a bridge it will transfer the other side of the call instead of itself:

 <action application="transfer" data="-bleg 2103"/>

This would transfer both legs of the call to the same ext. i.e a conference extension:

 <action application="transfer" data="-both 2103"/>

When a call is transferred back through the dialplan, the RDNIS value is populated with the previous destination_number value.

Note: You can also specify an inline dialplan

Note: Transfer will begin parsing extensions from the beginning of the dialplan. Be careful to avoid loops.

Note: The transfer application also works with mod_xml_curl, it just does another request to mod_xml_curl and starts over again, just like in the static dialplan.