[Freeswitch-users] Responding to bridge after rejected attended transfer

Troy Anderson troy at tlainvestments.com
Tue Apr 20 23:58:09 PDT 2010


I have the latest version of FS (90913b8e26265fd381318334f40e0b1a038bb066 committed Apr 21) and am using the default config with a small change that allows me to respond to the various values originate_disposition values.

First, is there a better way than what I am doing?  Everything seems to work fine until I try it with an attended transfer.  I've experienced this with Polycom, Cisco, and a soft phone client, so I don't think it's the phones, but who knows?  With 3 extensions, say 1001, 1002, 1003, each on a different phone, I can call from 1001 to 1002.  1002 initiates a transfer to 1003.  1003 rejects so 1002 starts hearing voicemail.  1002 hits transfer again to "connect" 1001 to 1003's voicemail.  With the default FS dialplan, it starts 1003's voicemail over, which is good.  With this slight modification, it hangs up on 1001.

If the feedback I get is that this modification looks fine, I can open a jira and supply a SIP trace and fs logs for the calls.

Incidentally, to keep it simple, this example does the same thing regardless of the originate_disposition.  In practice, there would be different actions taken.

Thanks for any help!

-Troy

Here's what I have:

<extension name="Local_Extension">
  <condition field="destination_number" expression="^(10[01]?[0-9])$">
    <action application="set" data="dialed_extension=$1"/>
    <action application="export" data="dialed_extension=$1"/>
    <!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
    <action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
    <action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
    <action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
    <action application="set" data="ringback=${us-ring}"/>
    <action application="set" data="transfer_ringback=$${hold_music}"/>
    <action application="set" data="call_timeout=30"/>
    <!-- <action application="set" data="sip_exclude_contact=${network_addr}"/> -->
    <action application="set" data="hangup_after_bridge=true"/>
    <!--<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
    <action application="set" data="continue_on_fail=true"/>
    <action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
    <action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
    <action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
    <!--<action application="export" data="nolocal:sip_secure_media=${user_data(${dialed_extension}@${domain_name} var sip_secure_media)}"/>-->
    <action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
    <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
    <action application="answer"/>
    <action application="sleep" data="1000"/>
<!--    <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/> -->
    <action application="transfer" data="BRIDGE-FOLLOWUP"/>
  </condition>
</extension>

<!-- CHANGES TO DEFAULT DIALPLAN HERE  -->
<extension name="BRIDGE-FOLLOWUP">
  <condition field="destination_number" expression="BRIDGE-FOLLOWUP"/>
  <condition field="${originate_disposition}" expression="^SUCCESS$" break="on-true">
    <action application="log" data="ERR (${originate_disposition})successful bridge is now done for ${dialed_extension}"/>
    <action application="hangup" data="NORMAL_CLEARING"/>
  </condition>
  <condition field="${originate_disposition}" expression="USER_BUSY|CALL_REJECTED" break="on-true">
    <action application="log" data="ERR (${originate_disposition})busy/rejected for ${dialed_extension}"/>
    <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
  </condition>
  <condition field="${originate_disposition}" expression="NO_ANSWER" break="on-true">
    <action application="log" data="ERR (${originate_disposition})no answer for ${dialed_extension}"/>
    <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
  </condition>
  <condition>
    <action application="log" data="ERR (${originate_disposition})other error for ${dialed_extension}"/>
    <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
  </condition>
</extension>

I also tried:

<extension name="Local_Extension">
  <condition field="destination_number" expression="^(10[01]?[0-9])$">
    <action application="set" data="dialed_extension=$1"/>
    <action application="export" data="dialed_extension=$1"/>
    <!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
    <action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
    <action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
    <action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
    <action application="set" data="ringback=${us-ring}"/>
    <action application="set" data="transfer_ringback=$${hold_music}"/>
    <action application="set" data="call_timeout=30"/>
    <!-- <action application="set" data="sip_exclude_contact=${network_addr}"/> -->
    <action application="set" data="hangup_after_bridge=true"/>
    <!--<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
    <action application="set" data="continue_on_fail=true"/>
    <action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
    <action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
    <action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
    <!--<action application="export" data="nolocal:sip_secure_media=${user_data(${dialed_extension}@${domain_name} var sip_secure_media)}"/>-->
    <action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
    <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
    <action application="answer"/>
    <action application="sleep" data="1000"/>
<!--    <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/> -->
  </condition>

<!-- CHANGES TO DEFAULT DIALPLAN HERE  -->
  <condition field="${originate_disposition}" expression="^SUCCESS$" break="on-true">
    <action application="log" data="ERR (${originate_disposition})successful bridge is now done for ${dialed_extension}"/>
    <action application="hangup" data="NORMAL_CLEARING"/>
  </condition>
  <condition field="${originate_disposition}" expression="^USER_BUSY|CALL_REJECTED$" break="on-true">
    <action application="log" data="ERR busy/rejected for ${dialed_extension}"/>
    <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
  </condition>
  <condition field="${originate_disposition}" expression="^NO_ANSWER$" break="on-true">
    <action application="log" data="ERR no answer for ${dialed_extension}"/>
    <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
  </condition>
  <condition>
    <action application="log" data="ERR other error for ${dialed_extension}"/>
    <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
  </condition>
</extension>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100420/f13ce2a5/attachment-0001.html 


More information about the FreeSWITCH-users mailing list