[Freeswitch-users] Questions about att_xfer
Anatoliy Kounitskiy
anatoliy at kounitskiy.com
Thu Aug 27 06:19:27 PDT 2009
Just for information - the idea :
A---calls---> B ---att_xfer---> C , B hangs C up and goes back to A
( I`m sorry C is not answering :) )
dialplan:
-----------
<extension name="local_number">
<condition field="${toll_allow}" expression="local"/>
<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::dx XML features"/>
<action application="bind_meta_app" data="2 b s
record_session::$${base_dir}/recordings/${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="bind_meta_app" data="4 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="set"
data="continue_on_fail=USER_NOT_REGISTERED,SUBSCRIBER_ABSENT"/>
<action application="info"/>
<action application="set"
data="bringback=${user_data(${dialed_extension}@${domain_name} var
cringback )}"/>
<action application="set" data="ringback=${${bringback}}"/>
<action application="bridge"
data="user/${dialed_extension}@${domain_name}"/>
<action application="info"/>
...
</condition>
</extension>
features.xml
---------------------
<extension name="attented_xfer">
<condition field="${toll_allow}" expression="local"/>
<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="bringback=${user_data(${attxfer_callthis}@${domain_name} var
cringback )}"/>
<action application="set" data="ringback=${${bringback}}"/>
<action application="info"/>
<action application="set" data="origination_cancel_key=#"/>
<action application="att_xfer"
data="user/${attxfer_callthis}@${domain_name}"/>
</condition>
</extension>
After testing the patch the results are:
1) B answers the call from A and executes the feature code *4
(attented_xfer), sends the desired number ( in this case the number of
C). A goes to MusicOnHold, B is waiting for C to pick up - B sends # -
sends SIP CANCEL to C and SIP BUY to A - so all calls are dropped.
2) B answers the call from A and executes the feature code *4
(attented_xfer), but without entering the number of C - so the read
aplication timeouts after 30 sec - after that att_xfer is executed
with empty string (nothing is entered) - B and A are bridged together.
On the console without entering the extension of C:
2009-08-27 16:00:58.929756 [NOTICE] switch_core_session.c:1576 Execute
set(origination_cancel_key=#)
EXECUTE sofia/internal/sip:102 at 10.17.4.107:5060 set(origination_cancel_key=#)
2009-08-27 16:00:58.929756 [DEBUG] mod_dptools.c:748
sofia/internal/sip:userB at 10.17.4.107:5060 SET
[origination_cancel_key]=[#]
2009-08-27 16:00:58.929756 [NOTICE] switch_core_session.c:1576 Execute
att_xfer(user/${attxfer_callthis}@${domain_name})
EXECUTE sofia/internal/sip:102 at 10.17.4.107:5060 att_xfer(user/@1.1.1.1)
2009-08-27 16:00:58.929756 [WARNING] mod_dptools.c:2373 Can't find
user [@1.1.1.1]
2009-08-27 16:00:58.929756 [ERR] switch_ivr_originate.c:1527 Cannot
create outgoing channel of type [user] cause: [SUBSCRIBER_ABSENT]
2009-08-27 16:00:58.929756 [DEBUG] switch_ivr_originate.c:2167
Originate Resulted in Error Cause: 20 [SUBSCRIBER_ABSENT]
2009-08-27 16:00:58.949842 [DEBUG] switch_ivr_play_say.c:1402 done playing file
2009-08-27 16:00:58.949842 [DEBUG] switch_ivr_bridge.c:231
sofia/internal/userA at 1.1.1.1 receive message [BRIDGE]
2009-08-27 16:00:58.949842 [DEBUG] switch_core_session.c:630 Send
signal sofia/internal/userA at 1.1.1.1 [BREAK]
2009-08-27 16:00:58.949842 [DEBUG] switch_ivr_bridge.c:233 Send signal
sofia/internal/sip:userB at 10.17.4.107:5060 [BREAK]
2009-08-27 16:00:58.949842 [DEBUG] switch_ivr_bridge.c:231
sofia/internal/sip:userB at 10.17.4.107:5060 receive message [BRIDGE]
2009-08-27 16:00:58.949842 [DEBUG] switch_core_session.c:630 Send
signal sofia/internal/sip:userB at 10.17.4.107:5060 [BREAK]
2009-08-27 16:00:58.954052 [DEBUG] switch_ivr_bridge.c:233 Send signal
sofia/internal/userA at 1.1.1.1 [BREAK]
2009-08-27 16:01:22.881501 [DEBUG] sofia.c:3302 Channel
sofia/internal/userA at 1.1.1.1 entering state [calling][0]
2009-08-27 16:01:22.886122 [DEBUG] sofia.c:3302 Channel
sofia/internal/userA at 1.1.1.1 entering state [ready][200]
I'll try to summarize my idea - could it be possible when the # (in
the att_xfer) is executed to behave as if you're trying to make
attended transfer to non existing subscriber( SUBSCRIBER_ABSENT ), so
B can be bridged back with A.
Thank you in advance,
Anatoliy Kounitskiy
On Wed, Aug 26, 2009 at 11:11 PM, Michael Collins<msc at freeswitch.org> wrote:
>
>
> On Wed, Aug 26, 2009 at 12:59 PM, Anthony Minessale
> <anthony.minessale at gmail.com> wrote:
>>
>> i added a patch to attempt to do this so try adding
>
> Nice work!
>>
>> {origination_cancel_key=#} before the dial string
>> or
>> <action application="set" data="origination_cancel_key=#"/>
>> before you bridge.
>
> Anatoliy,
>
> Please try this and let us know if it works for you as expected. If so,
> please write up the exact procedure that you used and include dialplan
> examples. I'd like to get this on the wiki while it's fresh in my mind. If
> you feel comfortable editing the wiki on your own then just let me know so
> that we can coordinate efforts.
>
> Thanks,
> MC
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
More information about the FreeSWITCH-users
mailing list