[Freeswitch-users] How to bridge a call to an extension defined in dialplan
x.liu
x.liu at hw.ac.uk
Tue Feb 28 12:44:59 MSK 2012
Hi Michael,
First apologies if I didn't make myself clear.:-)
In the beginning I didn't figure out the syntax for using "bridge" to
bridge a call to an extension defined in the dialplan
though I found a lot of examples in which bridging a call to registered
users are shown.
so my first post was just to find its syntax, then the question was
developed while I was trying
different things. Sorry again.
I described my goal when I replied Peter's question, and I copy and
rephrase it here for your info:
My goal is simply to record the user's call by my app (java app using ESL)
and at the same time I want to listen what the user is saying through my computer's speaker.
What I am trying to do is to bridge the call to my app for recording and to
a softphone for listening user's voice.
My java app will do the recording and also allow me to send TTS to the user via a GUI.
Regarding to "bypass media", I tried to set bypass media=false but
without any help to my problem,
then I tried to set it true and wanted to see if there was any help.
Hector's suggestion sounds quite promising, but at the moment I am not
quite sure how to do it.
I am going to look into it.
Cheers,
Xing
On 02/27/2012 11:21 PM, Michael Collins wrote:
> Oh yeah, hehe, now I get it. You can't bypass media in a loopback.
>
> I probably should have asked these questions before:
>
> Why are you trying to bypass media at all?
> Also, why are you trying to bypass media and yet at the same time
> trying to record (x74991)?
>
> I think the best question to ask is this: using plain language, could
> you please describe what you are trying to accomplish? I have a
> feeling that we are doing a classic XY
> <http://mywiki.wooledge.org/XyProblem> dance.
>
> Thanks,
> MC
>
> On Mon, Feb 27, 2012 at 3:09 PM, Liu, Xingkun <X.Liu at hw.ac.uk
> <mailto:X.Liu at hw.ac.uk>> wrote:
>
> Now I also tried: bypass_media_after_bridge=true
>
> I got:
>
> switch_ivr_bridge.c:246 Cannot bypass media while bridged to a
> loopback address.
>
> then I changed loopback/74991 to sofia/internal/74991@${domain}
> and tried again
>
> I got the same results as I tested in the very beginning:
>
> Hangup sofia/internal/1003 [CS_CONSUME_MEDIA] [ORIGINATOR_CANCEL]
>
> Regards,
> Xing
>
>
> -----Original Message-----
> From: freeswitch-users-bounces at lists.freeswitch.org
> <mailto:freeswitch-users-bounces at lists.freeswitch.org> on behalf
> of Michael Collins
> Sent: Mon 2/27/2012 22:27
> To: FreeSWITCH Users Help
> Subject: Re: [Freeswitch-users] How to bridge a call to an
> extension defined in dialplan
>
> I saw one other issue with your dialplan: replace all those "set"
> apps that
> occur before the "bridge" with "export" or use the {} notation to
> specify
> them in the dialstring:
>
> <action application="export" data="call_timeout=30"/>
> <action application="export" data="hangup_after_bridge=false"/>
> <action application="export" data="bypass_media=true"/>
> <action application="export" data="ignore_early_media=true"/>
>
> or remove all the above lines and just do this for your bridge line:
>
> <action application="bridge"
> data="{call_timeout=30,hangup_after_bridge=false,bypass_media=true,ignore_early_media=true}sofia/internal/1003%${sip_profile},loopback/74991"/>
>
> Also, you may want to use this instead of bypass_media:
>
> http://wiki.freeswitch.org/wiki/Channel_Variables#bypass_media_after_bridge
>
> Give that a try and let us know how it goes.
> -MC
>
> On Mon, Feb 27, 2012 at 1:51 PM, Liu, Xingkun <X.Liu at hw.ac.uk
> <mailto:X.Liu at hw.ac.uk>> wrote:
>
> > **
> >
> > Hi Michael,
> >
> > Thanks for your suggestion!
> >
> > I tried your suggestion. I saw the softphone(extension 1003)
> immediately
> > hung up after it was reached,
> > the I heard "bye" and the extension 74991 hung up.
> >
> > I copied the terminal and my dialplan for extension 74991 below:
> >
> > <extension name="testRecordingOnly2_bridge">
> > <condition field="destination_number" expression="^(74995)$">
> > <action application="set" data="call_timeout=30"/>
> > <action application="set" data="hangup_after_bridge=false"/>
> > <action application="set" data="bypass_media=true"/>
> > <action application="set" data="ignore_early_media=true"/>
> > <action application="bridge"
> > data="sofia/internal/1003%${sip_profile},loopback/74991"/>
> > </condition>
> > </extension>
> > <extension name="testRecordingOnly2">
> > <condition field="destination_number" expression="^(74991)$">
> > <action application="answer"/>
> > <action application="set" data="RECORD_TITLE=Recording
> > ${destination_number} ${caller_id_number} ${strftime(%Y-%m-%d
> %H:%M)}"/>
> > <action application="set" data="RECORD_COPYRIGHT=(c) 1980 Factory
> > Records, Inc."/>
> > <action application="set" data="RECORD_SOFTWARE=FreeSWITCH"/>
> > <action application="set" data="RECORD_ARTIST=Ian Curtis"/>
> > <action application="set" data="RECORD_COMMENT=Love will tear us
> > apart"/>
> > <action application="set" data="RECORD_DATE=${strftime(%Y-%m-%d
> > %H:%M)}"/>
> > <action application="set" data="RECORD_STEREO=true"/>
> > <action application="set" data="record_waste_resources=true"/>
> > <action application="set" data="tts_engine=flite"/>
> > <action application="set" data="tts_voice=rms"/>
> > <action application="speak" data="please say something to start
> > recording."/>
> > <action application="set" data="ignore_early_media=true"/>
> > <action application="log" data="XX-BaseDir $${base_dir}"/>
> > <action application="record"
> >
> data="$${base_dir}/testRecording/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav
> > 120 200"/>
> > </condition>
> > </extension>
> >
> > -----------------------------------------------
> > 2012-02-27 21:41:29.004622 [INFO] switch_time.c:423 Clock
> synchronized to
> > system time.
> > 2012-02-27 21:41:50.788883 [NOTICE] switch_channel.c:920 New Channel
> > sofia/external/07875086426 at sipgate.co.uk
> <mailto:07875086426 at sipgate.co.uk>[db748000-618b-11e1-9bae-07e90bb2f0c8]
> > 2012-02-27 21:41:50.788883 [INFO] mod_dialplan_xml.c:481 Processing
> > 07875086426 <07875086426>->74995 in context public
> > 2012-02-27 21:41:50.809112 [NOTICE] switch_channel.c:920 New Channel
> > sofia/internal/1003 [db7641f6-618b-11e1-9bb2-07e90bb2f0c8]
> > 2012-02-27 21:41:50.809112 [INFO] mod_loopback.c:885 Sending
> early media
> > 2012-02-27 21:41:50.809112 [NOTICE] mod_sofia.c:2521 Pre-Answer
> > sofia/external/07875086426 at sipgate.co.uk
> <mailto:07875086426 at sipgate.co.uk>!
> > 2012-02-27 21:41:50.809112 [NOTICE] switch_channel.c:920 New Channel
> > loopback/7499611-a [db777864-618b-11e1-9bb7-07e90bb2f0c8]
> > 2012-02-27 21:41:50.809112 [NOTICE] switch_channel.c:918 Rename
> Channel
> > loopback/7499611-a->loopback/7499611-a
> > [db777864-618b-11e1-9bb7-07e90bb2f0c8]
> > 2012-02-27 21:41:50.809112 [NOTICE] switch_channel.c:920 New Channel
> > loopback/7499611-b [db778ffc-618b-11e1-9bbb-07e90bb2f0c8]
> > 2012-02-27 21:41:50.809112 [INFO] mod_dialplan_xml.c:481 Processing
> > 07875086426 <07875086426>->7499611 in context public
> > 2012-02-27 21:41:50.809112 [NOTICE] mod_loopback.c:755 Channel
> > [loopback/7499611-a] has been answered
> > 2012-02-27 21:41:50.809112 [NOTICE] mod_dptools.c:1117 Channel
> > [loopback/7499611-b] has been answered
> > 2012-02-27 21:41:50.833830 [NOTICE] switch_ivr_originate.c:3182
> Hangup
> > sofia/internal/1003 [CS_CONSUME_MEDIA] [LOSE_RACE]
> > 2012-02-27 21:41:50.833830 [NOTICE] switch_ivr_originate.c:3209
> Channel
> > [sofia/external/07875086426 at sipgate.co.uk
> <mailto:07875086426 at sipgate.co.uk>] has been answered
> > 2012-02-27 21:41:50.833830 [NOTICE] switch_core_session.c:1395
> Session 2
> > (sofia/internal/1003) Ended
> > 2012-02-27 21:41:50.833830 [NOTICE] switch_core_session.c:1397 Close
> > Channel sofia/internal/1003 [CS_DESTROY]
> > 2012-02-27 21:42:08.288866 [NOTICE] switch_core_state_machine.c:226
> > loopback/7499611-b has executed the last dialplan instruction,
> hanging up.
> > 2012-02-27 21:42:08.288866 [NOTICE]
> switch_core_state_machine.c:228 Hangup
> > loopback/7499611-b [CS_EXECUTE] [NORMAL_CLEARING]
> > 2012-02-27 21:42:08.288866 [NOTICE] mod_loopback.c:438 Hangup
> > loopback/7499611-a [CS_EXCHANGE_MEDIA] [NORMAL_CLEARING]
> > 2012-02-27 21:42:08.308864 [NOTICE] switch_core_state_machine.c:226
> > sofia/external/07875086426 at sipgate.co.uk
> <mailto:07875086426 at sipgate.co.uk> has executed the last dialplan
> > instruction, hanging up.
> > 2012-02-27 21:42:08.308864 [NOTICE]
> switch_core_state_machine.c:228 Hangup
> > sofia/external/07875086426 at sipgate.co.uk
> <mailto:07875086426 at sipgate.co.uk> [CS_EXECUTE] [NORMAL_CLEARING]
> > 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1395
> Session 4
> > (loopback/7499611-b) Ended
> > 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1397 Close
> > Channel loopback/7499611-b [CS_DESTROY]
> > 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1395
> Session 3
> > (loopback/7499611-a) Ended
> > 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1397 Close
> > Channel loopback/7499611-a [CS_DESTROY]
> > 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1395
> Session 1
> > (sofia/external/07875086426 at sipgate.co.uk
> <mailto:07875086426 at sipgate.co.uk>) Ended
> > 2012-02-27 21:42:08.308864 [NOTICE] switch_core_session.c:1397 Close
> > Channel sofia/external/07875086426 at sipgate.co.uk
> <mailto:07875086426 at sipgate.co.uk> [CS_DESTROY]
> >
> > --------------------------------------------------
> >
> > -----Original Message-----
> > From: freeswitch-users-bounces at lists.freeswitch.org
> <mailto:freeswitch-users-bounces at lists.freeswitch.org> on behalf
> of Michael
> > Collins
> > Sent: Mon 2/27/2012 19:59
> > To: FreeSWITCH Users Help
> > Subject: Re: [Freeswitch-users] How to bridge a call to an extension
> > defined in dialplan
> >
> > How about this for your bridge line:
> >
> > <action application="bridge"
> > data="sofia/internal/1003%${sip_profile},loopback/74991"/>
> >
> > -MC
> >
> > On Sun, Feb 26, 2012 at 2:29 PM, Liu, Xingkun <X.Liu at hw.ac.uk
> <mailto:X.Liu at hw.ac.uk>> wrote:
> >
> > > **
> > >
> > > Hello,
> > >
> > > I'd like to bridge an incoming to two endpoints simultaneuously:
> > > one is a softphone which is registered to FS (to user 1003),
> > > another is just an extension which is defined in
> conf/dialplan/public.xml
> > >
> > > It looks like:
> > >
> > > <extension name="testRecording_bridge">
> > > <condition field="destination_number" expression="^(74990)$">
> > > <action application="bridge"
> > >
> >
> data="sofia/internal/1003%${sip_profile},sofia/internal/74991%${sip_profile}"/>
> > > </condition>
> > > </extension>
> > >
> > > <extension name="testRecordingOnly">
> > > <condition field="destination_number" expression="^74991$">
> > > <action application="set" data="record_waste_resources=true"/>
> > > <action application="javascript" data="testRecordFile.js"/>
> > > </condition>
> > > </extension>
> > >
> > > The incoming call dial to extension 74990, from there I want
> to bridge
> > the
> > > call to the sofphone at 1003 and
> > > to the extension 74991.
> > >
> > > The problem is that FS can not locate user 74991. So my
> question is what
> > > else I need to modify in order
> > > to bridge the call also to extension 74991 at the same time?
> > >
> > > I did lots of Googling, checked the wiki and tried various
> ways but still
> > > without success.
> > >
> > > Any advices please?
> > >
> > > Many Thanks!
> > > Xing
> > >
> > > ------------------------------
> > >
> > > *Heriot-Watt University is the Sunday Times Scottish
> University of the
> > > Year 2011-2012.*
> > >
> > > Heriot-Watt University is a Scottish charity registered under
> charity
> > > number SC000278.
> > >
> > >
> _________________________________________________________________________
> > > Professional FreeSWITCH Consulting Services:
> > > consulting at freeswitch.org <mailto:consulting at freeswitch.org>
> > > http://www.freeswitchsolutions.com
> > >
> > >
> > >
> > >
> > > Official FreeSWITCH Sites
> > > http://www.freeswitch.org
> > > http://wiki.freeswitch.org
> > > http://www.cluecon.com
> > >
> > > FreeSWITCH-users mailing list
> > > FreeSWITCH-users at lists.freeswitch.org
> <mailto: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
> > >
> > >
> >
> >
> > ------------------------------
> >
> > *Heriot-Watt University is the Sunday Times Scottish University
> of the
> > Year 2011-2012.*
> >
> > Heriot-Watt University is a Scottish charity registered under
> charity
> > number SC000278.
> >
> >
> _________________________________________________________________________
> > Professional FreeSWITCH Consulting Services:
> > consulting at freeswitch.org <mailto:consulting at freeswitch.org>
> > http://www.freeswitchsolutions.com
> >
> >
> >
> >
> > Official FreeSWITCH Sites
> > http://www.freeswitch.org
> > http://wiki.freeswitch.org
> > http://www.cluecon.com
> >
> > FreeSWITCH-users mailing list
> > FreeSWITCH-users at lists.freeswitch.org
> <mailto: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
> >
> >
>
>
> ------------------------------------------------------------------------
>
> *Heriot-Watt University is the Sunday Times Scottish University of
> the Year 2011-2012.*
>
> Heriot-Watt University is a Scottish charity registered under
> charity number SC000278.
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org <mailto:consulting at freeswitch.org>
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> <mailto: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
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> 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
--
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.
Heriot-Watt University is the Sunday Times
Scottish University of the Year 2011-2012
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120228/235e0195/attachment-0001.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list