<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [Freeswitch-users] How to bridge a call to an extension defined in dialplan</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Now I also tried: bypass_media_after_bridge=true<BR>
<BR>
I got:<BR>
<BR>
&nbsp;switch_ivr_bridge.c:246 Cannot bypass media while bridged to a loopback address.<BR>
<BR>
then I changed loopback/74991 to sofia/internal/74991@${domain} and tried again<BR>
<BR>
I got the same results as I tested in the very beginning:<BR>
<BR>
Hangup sofia/internal/1003 [CS_CONSUME_MEDIA] [ORIGINATOR_CANCEL]<BR>
<BR>
Regards,<BR>
Xing<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: freeswitch-users-bounces@lists.freeswitch.org on behalf of Michael Collins<BR>
Sent: Mon 2/27/2012 22:27<BR>
To: FreeSWITCH Users Help<BR>
Subject: Re: [Freeswitch-users] How to bridge a call to an extension defined in dialplan<BR>
<BR>
I saw one other issue with your dialplan: replace all those &quot;set&quot; apps that<BR>
occur before the &quot;bridge&quot; with &quot;export&quot; or use the {} notation to specify<BR>
them in the dialstring:<BR>
<BR>
&nbsp;&nbsp;&nbsp; &lt;action application=&quot;export&quot; data=&quot;call_timeout=30&quot;/&gt;<BR>
&nbsp;&nbsp;&nbsp; &lt;action application=&quot;export&quot; data=&quot;hangup_after_bridge=false&quot;/&gt;<BR>
&nbsp;&nbsp;&nbsp; &lt;action application=&quot;export&quot; data=&quot;bypass_media=true&quot;/&gt;<BR>
&nbsp;&nbsp;&nbsp; &lt;action application=&quot;export&quot; data=&quot;ignore_early_media=true&quot;/&gt;<BR>
<BR>
or remove all the above lines and just do this for your bridge line:<BR>
<BR>
&nbsp;&nbsp;&nbsp; &lt;action application=&quot;bridge&quot;<BR>
data=&quot;{call_timeout=30,hangup_after_bridge=false,bypass_media=true,ignore_early_media=true}sofia/internal/1003%${sip_profile},loopback/74991&quot;/&gt;<BR>
<BR>
Also, you may want to use this instead of bypass_media:<BR>
<BR>
<A HREF="http://wiki.freeswitch.org/wiki/Channel_Variables#bypass_media_after_bridge">http://wiki.freeswitch.org/wiki/Channel_Variables#bypass_media_after_bridge</A><BR>
<BR>
Give that a try and let us know how it goes.<BR>
-MC<BR>
<BR>
On Mon, Feb 27, 2012 at 1:51 PM, Liu, Xingkun &lt;X.Liu@hw.ac.uk&gt; wrote:<BR>
<BR>
&gt; **<BR>
&gt;<BR>
&gt; Hi Michael,<BR>
&gt;<BR>
&gt; Thanks for your suggestion!<BR>
&gt;<BR>
&gt; I tried your suggestion. I saw the softphone(extension 1003) immediately<BR>
&gt; hung up after it was reached,<BR>
&gt; the I heard &quot;bye&quot; and the extension 74991 hung up.<BR>
&gt;<BR>
&gt; I copied the terminal and my dialplan for extension 74991 below:<BR>
&gt;<BR>
&gt; &lt;extension name=&quot;testRecordingOnly2_bridge&quot;&gt;<BR>
&gt;&nbsp;&nbsp; &lt;condition field=&quot;destination_number&quot; expression=&quot;^(74995)$&quot;&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;call_timeout=30&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=false&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;bypass_media=true&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;ignore_early_media=true&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;bridge&quot;<BR>
&gt; data=&quot;sofia/internal/1003%${sip_profile},loopback/74991&quot;/&gt;<BR>
&gt;&nbsp;&nbsp; &lt;/condition&gt;<BR>
&gt; &lt;/extension&gt;<BR>
&gt; &lt;extension name=&quot;testRecordingOnly2&quot;&gt;<BR>
&gt;&nbsp;&nbsp; &lt;condition field=&quot;destination_number&quot; expression=&quot;^(74991)$&quot;&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;answer&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;RECORD_TITLE=Recording<BR>
&gt; ${destination_number} ${caller_id_number} ${strftime(%Y-%m-%d %H:%M)}&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;RECORD_COPYRIGHT=(c) 1980 Factory<BR>
&gt; Records, Inc.&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;RECORD_SOFTWARE=FreeSWITCH&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;RECORD_ARTIST=Ian Curtis&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;RECORD_COMMENT=Love will tear us<BR>
&gt; apart&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;RECORD_DATE=${strftime(%Y-%m-%d<BR>
&gt; %H:%M)}&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;RECORD_STEREO=true&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;record_waste_resources=true&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;tts_engine=flite&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;tts_voice=rms&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;speak&quot; data=&quot;please say something to start<BR>
&gt; recording.&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;ignore_early_media=true&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;log&quot; data=&quot;XX-BaseDir $${base_dir}&quot;/&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;record&quot;<BR>
&gt; data=&quot;$${base_dir}/testRecording/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav<BR>
&gt; 120 200&quot;/&gt;<BR>
&gt;&nbsp;&nbsp; &lt;/condition&gt;<BR>
&gt; &lt;/extension&gt;<BR>
&gt;<BR>
&gt;&nbsp; -----------------------------------------------<BR>
&gt; 2012-02-27 21:41:29.004622 [INFO] switch_time.c:423 Clock synchronized to<BR>
&gt; system time.<BR>
&gt; 2012-02-27 21:41:50.788883 [NOTICE] switch_channel.c:920 New Channel<BR>
&gt; sofia/external/07875086426@sipgate.co.uk[db748000-618b-11e1-9bae-07e90bb2f0c8]<BR>
&gt; 2012-02-27 21:41:50.788883 [INFO] mod_dialplan_xml.c:481 Processing<BR>
&gt; 07875086426 &lt;07875086426&gt;-&gt;74995 in context public<BR>
&gt; 2012-02-27 21:41:50.809112 [NOTICE] switch_channel.c:920 New Channel<BR>
&gt; sofia/internal/1003 [db7641f6-618b-11e1-9bb2-07e90bb2f0c8]<BR>
&gt; 2012-02-27 21:41:50.809112 [INFO] mod_loopback.c:885 Sending early media<BR>
&gt; 2012-02-27 21:41:50.809112 [NOTICE] mod_sofia.c:2521 Pre-Answer<BR>
&gt; sofia/external/07875086426@sipgate.co.uk!<BR>
&gt; 2012-02-27 21:41:50.809112 [NOTICE] switch_channel.c:920 New Channel<BR>
&gt; loopback/7499611-a [db777864-618b-11e1-9bb7-07e90bb2f0c8]<BR>
&gt; 2012-02-27 21:41:50.809112 [NOTICE] switch_channel.c:918 Rename Channel<BR>
&gt; loopback/7499611-a-&gt;loopback/7499611-a<BR>
&gt; [db777864-618b-11e1-9bb7-07e90bb2f0c8]<BR>
&gt; 2012-02-27 21:41:50.809112 [NOTICE] switch_channel.c:920 New Channel<BR>
&gt; loopback/7499611-b [db778ffc-618b-11e1-9bbb-07e90bb2f0c8]<BR>
&gt; 2012-02-27 21:41:50.809112 [INFO] mod_dialplan_xml.c:481 Processing<BR>
&gt; 07875086426 &lt;07875086426&gt;-&gt;7499611 in context public<BR>
&gt; 2012-02-27 21:41:50.809112 [NOTICE] mod_loopback.c:755 Channel<BR>
&gt; [loopback/7499611-a] has been answered<BR>
&gt; 2012-02-27 21:41:50.809112 [NOTICE] mod_dptools.c:1117 Channel<BR>
&gt; [loopback/7499611-b] has been answered<BR>
&gt; 2012-02-27 21:41:50.833830 [NOTICE] switch_ivr_originate.c:3182 Hangup<BR>
&gt; sofia/internal/1003 [CS_CONSUME_MEDIA] [LOSE_RACE]<BR>
&gt; 2012-02-27 21:41:50.833830 [NOTICE] switch_ivr_originate.c:3209 Channel<BR>
&gt; [sofia/external/07875086426@sipgate.co.uk] has been answered<BR>
&gt; 2012-02-27 21:41:50.833830 [NOTICE] switch_core_session.c:1395 Session 2<BR>
&gt; (sofia/internal/1003) Ended<BR>
&gt; 2012-02-27 21:41:50.833830 [NOTICE] switch_core_session.c:1397 Close<BR>
&gt; Channel sofia/internal/1003 [CS_DESTROY]<BR>
&gt; 2012-02-27 21:42:08.288866 [NOTICE] switch_core_state_machine.c:226<BR>
&gt; loopback/7499611-b has executed the last dialplan instruction, hanging up.<BR>
&gt; 2012-02-27 21:42:08.288866 [NOTICE] switch_core_state_machine.c:228 Hangup<BR>
&gt; loopback/7499611-b [CS_EXECUTE] [NORMAL_CLEARING]<BR>
&gt; 2012-02-27 21:42:08.288866 [NOTICE] mod_loopback.c:438 Hangup<BR>
&gt; loopback/7499611-a [CS_EXCHANGE_MEDIA] [NORMAL_CLEARING]<BR>
&gt; 2012-02-27 21:42:08.308864 [NOTICE] switch_core_state_machine.c:226<BR>
&gt; sofia/external/07875086426@sipgate.co.uk has executed the last dialplan<BR>
&gt; instruction, hanging up.<BR>
&gt; 2012-02-27 21:42:08.308864 [NOTICE] switch_core_state_machine.c:228 Hangup<BR>
&gt; sofia/external/07875086426@sipgate.co.uk [CS_EXECUTE] [NORMAL_CLEARING]<BR>
&gt; 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1395 Session 4<BR>
&gt; (loopback/7499611-b) Ended<BR>
&gt; 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1397 Close<BR>
&gt; Channel loopback/7499611-b [CS_DESTROY]<BR>
&gt; 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1395 Session 3<BR>
&gt; (loopback/7499611-a) Ended<BR>
&gt; 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1397 Close<BR>
&gt; Channel loopback/7499611-a [CS_DESTROY]<BR>
&gt; 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1395 Session 1<BR>
&gt; (sofia/external/07875086426@sipgate.co.uk) Ended<BR>
&gt; 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1397 Close<BR>
&gt; Channel sofia/external/07875086426@sipgate.co.uk [CS_DESTROY]<BR>
&gt;<BR>
&gt;&nbsp; --------------------------------------------------<BR>
&gt;<BR>
&gt; -----Original Message-----<BR>
&gt; From: freeswitch-users-bounces@lists.freeswitch.org on behalf of Michael<BR>
&gt; Collins<BR>
&gt; Sent: Mon 2/27/2012 19:59<BR>
&gt; To: FreeSWITCH Users Help<BR>
&gt; Subject: Re: [Freeswitch-users] How to bridge a call to an extension<BR>
&gt; defined in dialplan<BR>
&gt;<BR>
&gt; How about this for your bridge line:<BR>
&gt;<BR>
&gt; &lt;action application=&quot;bridge&quot;<BR>
&gt; data=&quot;sofia/internal/1003%${sip_profile},loopback/74991&quot;/&gt;<BR>
&gt;<BR>
&gt; -MC<BR>
&gt;<BR>
&gt; On Sun, Feb 26, 2012 at 2:29 PM, Liu, Xingkun &lt;X.Liu@hw.ac.uk&gt; wrote:<BR>
&gt;<BR>
&gt; &gt; **<BR>
&gt; &gt;<BR>
&gt; &gt; Hello,<BR>
&gt; &gt;<BR>
&gt; &gt; I'd like to bridge an incoming to two endpoints simultaneuously:<BR>
&gt; &gt; one is a softphone which is registered to FS (to user 1003),<BR>
&gt; &gt; another is just an extension which is defined in conf/dialplan/public.xml<BR>
&gt; &gt;<BR>
&gt; &gt; It looks like:<BR>
&gt; &gt;<BR>
&gt; &gt; &lt;extension name=&quot;testRecording_bridge&quot;&gt;<BR>
&gt; &gt;&nbsp;&nbsp; &lt;condition field=&quot;destination_number&quot; expression=&quot;^(74990)$&quot;&gt;<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;bridge&quot;<BR>
&gt; &gt;<BR>
&gt; data=&quot;sofia/internal/1003%${sip_profile},sofia/internal/74991%${sip_profile}&quot;/&gt;<BR>
&gt; &gt;&nbsp;&nbsp; &lt;/condition&gt;<BR>
&gt; &gt; &lt;/extension&gt;<BR>
&gt; &gt;<BR>
&gt; &gt; &lt;extension name=&quot;testRecordingOnly&quot;&gt;<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field=&quot;destination_number&quot; expression=&quot;^74991$&quot;&gt;<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;record_waste_resources=true&quot;/&gt;<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;javascript&quot; data=&quot;testRecordFile.js&quot;/&gt;<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<BR>
&gt; &gt;&nbsp;&nbsp; &lt;/extension&gt;<BR>
&gt; &gt;<BR>
&gt; &gt; The incoming call dial to extension 74990, from there I want to bridge<BR>
&gt; the<BR>
&gt; &gt; call to the sofphone at 1003 and<BR>
&gt; &gt; to the extension 74991.<BR>
&gt; &gt;<BR>
&gt; &gt; The problem is that FS can not locate user 74991. So my question is what<BR>
&gt; &gt; else I need to modify in order<BR>
&gt; &gt; to bridge the call also to extension 74991 at the same time?<BR>
&gt; &gt;<BR>
&gt; &gt; I did lots of Googling, checked the wiki and tried various ways but still<BR>
&gt; &gt; without success.<BR>
&gt; &gt;<BR>
&gt; &gt; Any advices please?<BR>
&gt; &gt;<BR>
&gt; &gt; Many Thanks!<BR>
&gt; &gt; Xing<BR>
&gt; &gt;<BR>
&gt; &gt; ------------------------------<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; *Heriot-Watt University is the Sunday Times Scottish University of the<BR>
&gt; &gt; Year 2011-2012.*<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp; Heriot-Watt University is a Scottish charity registered under charity<BR>
&gt; &gt; number SC000278.<BR>
&gt; &gt;<BR>
&gt; &gt; _________________________________________________________________________<BR>
&gt; &gt; Professional FreeSWITCH Consulting Services:<BR>
&gt; &gt; consulting@freeswitch.org<BR>
&gt; &gt; <A HREF="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</A><BR>
&gt; &gt;<BR>
&gt; &gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>
&gt; &gt; <A HREF="http://www.cudatel.com">http://www.cudatel.com</A><BR>
&gt; &gt;<BR>
&gt; &gt; Official FreeSWITCH Sites<BR>
&gt; &gt; <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
&gt; &gt; <A HREF="http://wiki.freeswitch.org">http://wiki.freeswitch.org</A><BR>
&gt; &gt; <A HREF="http://www.cluecon.com">http://www.cluecon.com</A><BR>
&gt; &gt;<BR>
&gt; &gt; FreeSWITCH-users mailing list<BR>
&gt; &gt; FreeSWITCH-users@lists.freeswitch.org<BR>
&gt; &gt; <A HREF="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>
&gt; &gt; UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR>
&gt; &gt; <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt;<BR>
&gt;<BR>
&gt; ------------------------------<BR>
&gt;<BR>
&gt;&nbsp; *Heriot-Watt University is the Sunday Times Scottish University of the<BR>
&gt; Year 2011-2012.*<BR>
&gt;<BR>
&gt;&nbsp; Heriot-Watt University is a Scottish charity registered under charity<BR>
&gt; number SC000278.<BR>
&gt;<BR>
&gt; _________________________________________________________________________<BR>
&gt; Professional FreeSWITCH Consulting Services:<BR>
&gt; consulting@freeswitch.org<BR>
&gt; <A HREF="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</A><BR>
&gt;<BR>
&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>
&gt; <A HREF="http://www.cudatel.com">http://www.cudatel.com</A><BR>
&gt;<BR>
&gt; Official FreeSWITCH Sites<BR>
&gt; <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
&gt; <A HREF="http://wiki.freeswitch.org">http://wiki.freeswitch.org</A><BR>
&gt; <A HREF="http://www.cluecon.com">http://www.cluecon.com</A><BR>
&gt;<BR>
&gt; FreeSWITCH-users mailing list<BR>
&gt; FreeSWITCH-users@lists.freeswitch.org<BR>
&gt; <A HREF="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>
&gt; UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR>
&gt; <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
&gt;<BR>
&gt;<BR>
<BR>
</FONT>
</P>

<br>
<hr>
<br>
<font face="arial, helvetica">
<b>Heriot-Watt University is the Sunday Times Scottish University of the Year 2011-2012.</b>
</font>
<br><br>
<font face="arial,helvetica" size="-1">
Heriot-Watt University is a Scottish charity registered under charity number SC000278.
<br>
</font>

</BODY>
</HTML>