Misc. Dialplan Tools att xfer

From FreeSWITCH Wiki
Jump to: navigation, search


Attended Transfer

Make an attended transfer.


att_xfer <channel_url>


Make a dialplan feature which read the number to make an attended transfer.

<extension name="att_xfer">
     <condition field="destination_number" expression="^att_xfer$">
       <action application="read" data="3 4 sounds/getdigits.wav attxfer_callthis 30000 #"/>
       <action application="att_xfer" data="sofia/default/${attxfer_callthis}"/>

Then bind this feature to DTMF 3.

<action application="bind_meta_app" data="3 a a execute_extension::att_xfer XML features"/>

During call press *3 to activate the feature. Feed it the number then it will make the call.

If you hang up (after the other leg answered and you decided what to do), then it will transfer the call and bridge them together.

If the other leg hang up thus indicating it doesn't want the transfer then you get it back.

If the other leg is a voicemail or doesn't answered you can hangup that leg by pressing DTMF # (fixed in r14438)

If you press DTMF 0 then it will convert it to a three-way, hangup and complete the transfer.

See also bind_meta_app and read


In your dialplan add bind_meta_app key that will transfer the call to the extensions that will execute the att_xfer application.


<extension name="local_number">
  <condition field="destination_number" expression="^(\d{3})$">
    <action application="set" data="dialed_extension=$1"/>
    <action application="export" data="dialed_extension=$1"/>
    <action application="bind_meta_app" data="1 b s execute_extension::attented_xfer XML features"/>
    <action application="set" data="transfer_ringback=$${hold_music}"/>
    <action application="set" data="call_timeout=10"/>
    <action application="set" data="hangup_after_bridge=true"/>
    <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>

In the features.xml add the extensions attended_xfer. The extensions below first waits for input from the user (30sec) and then makes attended transfer to the entered extension.


<extension name="attented_xfer">
    <condition field="destination_number" expression="^attented_xfer$">
      <action application="set" data="continue_on_fail=true"/>
      <action application="read" data="3 4 ivr/ivr-enter_ext.wav attxfer_callthis 30000 #"/>
      <action application="set" data="origination_cancel_key=#"/>
      <action application="att_xfer" data="user/${attxfer_callthis}@${domain_name}"/>

From revision 14650, there is new parameter that can be set - origination_cancel_key. This feature is used when you want to cancel a transfer and to return to the first caller.

Feature code Purpose When to use
0 it will convert the call to three-way conference After the last party answers the call
# to hangup the B leg and return you to the caller After the last party answers the call
* it will hangup the B leg and bridge A to C (fixed in r15013) After the last party answers the call
# it will cancel the B leg and will return you the caller Before the answer of the call by the last party


att_xfer will not work with loopback channels because the application blocks when bridged to the C leg. If the C leg hangs up, it will bridge back to A. Since loopback hangs up to replace the legs to the correct legs, att_xfer will detect that and bridge it back to the A leg automatically.

See Also