Thanks again! Yes, I used dvarne's Java ESL library for a while. It works fine for the recording the a-leg, but the b-leg which is originated with eavesdrop to a Softphone does not work as expected. There was an error in my originate usage: originate sofia/internal/1003%x.x.x.x 5801&eavesdrop " + this.channelUniqueID); I changed the extension 5801 to &socket(127.0.0.1:9981 async full) which is the action inside the extension 5801 then my softphone does not hang up any more, but I still can not hear the conversation of a-leg on the softphone. There may be something wrong with my use of the combination of originate and eavesdrop. I will look into it again. Best, Xing On 02/28/2012 06:21 PM, Hector Geraldino wrote:
Ok, I can see you're using dvarne's java ESL library. Please download the source code from GIT and try to run the outbound client demo (located in src/test/java/SocketClientTest.java)
Assuming you're already familiar with the netty programming model, here's what I did: I changed the implementation of the SimpleHangupOutboundHandler class in the demo to do what you're asking: it will first answer the call, bridge it to an extension, record the call and make a 2nd call to another extension using the combination of originate + eavesdrop. Backup the original file and replace it with this new implementation. Also adjust the port number on the SocketClientTest class to match the one configured in your dialplan.
Hope this serve as an starting point...
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of x.liu Sent: Tuesday, February 28, 2012 12:40 PM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] How to bridge a call to an extension defined in dialplan
Thanks for the detailed explanations, Hector!
First, sorry for my further questions here: In 2. you originate a 2nd call to an internal extension, what is this internal extension doing? In 5. from where you originate the 3rd call, your java app or dialplan, or does it matter? and to which extension?
I am asking those questions because I haven't got mine work and want to fully understand how you did it.
I originate a 2rd call to my softphone from my java app. The softphone was ringing and I clicked Answer button on the GUI then it was immediately terminated.
I got some confusing outputs like Hangup sofia/internal/1003 [CS_ROUTING] [NO_ROUTE_DESTINATION] and Transfer sofia/internal/1003 to &eavesdrop[1003@b38cb4c6-620e-11e1-8992-0b1a37fbec21]
I copy full outputs here:
2012-02-28 13:18:28.056043 [NOTICE] switch_channel.c:920 New Channel sofia/internal/1003 [b3a3b61c-620e-11e1-8995-0b1a37fbec21] 2012-02-28 13:18:28.076030 [NOTICE] mod_dptools.c:1117 Channel [sofia/external/anonymous@sipgate.co.uk] has been answered 2012-02-28 13:18:29.098072 [NOTICE] sofia.c:5460 Ring-Ready sofia/internal/1003! 2012-02-28 13:18:31.839862 [NOTICE] sofia.c:6077 Channel [sofia/internal/1003] has been answered 2012-02-28 13:18:31.839862 [NOTICE] switch_core_state_machine.c:166 Hangup sofia/internal/1003 [CS_ROUTING] [NO_ROUTE_DESTINATION] 2012-02-28 13:18:31.839862 [NOTICE] switch_ivr.c:1711 Transfer sofia/internal/1003 to&eavesdrop[1003@b38cb4c6-620e-11e1-8992-0b1a37fbec21] 2012-02-28 13:18:31.839862 [NOTICE] switch_core_session.c:1395 Session 16 (sofia/internal/1003) Ended 2012-02-28 13:18:31.839862 [NOTICE] switch_core_session.c:1397 Close Channel sofia/internal/1003 [CS_DESTROY] 2012-02-28 13:19:02.756130 [NOTICE] sofia.c:634 Hangup sofia/external/anonymous@sipgate.co.uk [CS_EXECUTE] [NORMAL_CLEARING]
Any more thoughts?
Desperately want to sort this out for tomorrow morning's meeting!
Thanks! Xing
On 02/28/2012 03:24 PM, Hector Geraldino wrote:
You can find the syntax for eavesdrop in the wiki. Here's how I have it working:
api originate sofia/internal/1234@x.x.x.x&eavesdrop(aleg_uuid)
You can try this command in the fs_cli command line (w/o the 'api' prefix). Eavesdrop will allow you to jump into a call and monitor the conversation. If the call has been bridged, you can hear both legs.
You can do the bridge however you want. The bridge operation is not related to the eavesdrop, so the way I have this working is:
1. I answer the call in the dialplan, and transfer the control to my java app (just as you're doing right now) 2. I originate a 2nd call to an internal extension. 3. When the 2nd call is answered, I bridge both calls using uuid_bridge uuid_lega uuid_legb (you can even do the bridge from the dialplan) 4. I start recording the call using 'uuid_record uuid_lega' (again, you can call the record application from the dialplan) 5. I can (if desired) monitor the call by originating a 3rd call to the manager extension + passing the uuid_lega to the eavesdrop app, as discussed before.
Hope this helps
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of x.liu Sent: Tuesday, February 28, 2012 9:08 AM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] How to bridge a call to an extension defined in dialplan
Hi Hector,
Many thanks for your advice!
I had a try but without success yet. What I am doing is
1. call to an extension: 5801, it will execute my ESL Java app. I call it a-leg <extension name="myEslNew5801"> <condition field="destination_number" expression="^5801$"> <action application="limit" data="hash outgoing 5801 4" /> <action application="socket" data="127.0.0.1:9981 async full"/> </condition> </extension>
2. From my ESL Java app, I originate b-leg to my softphoe and eavesdrop on extension 5801 by response = sendSyncSingleLineCommand(ctx.getChannel(), "api originate sofia/internal/1003%x.x.x.x 1003&eavesdrop " + this.channelUniqueID); the channelUniqueID is the UUID of my a-leg session.
So I hope my app do the recording and talking to the user and I listen it from the softphone 1003 via eavesdrop.
At the moment I got message: Hangup on 1003 with [CS-ROUTING] [NO_ROUTE_DESTINATION]
I am not quite sure if I understand correctly how the eavesdrop works:
Which UUID should I use in "&eavesdrop UUID", the existing one of a-leg or I need to create a new one for b-leg? Do I need to do the bridge, in extension 5801 or in my app?
Thanks! Xing
On 02/27/2012 08:59 PM, Hector Geraldino wrote:
You can: bridge two endpoints (A -> B), record the conversation using uuid_record (or the record application), and have a 3rd extension hearing the conversation using the eavesdrop app. Here's how I've done this before:
Incoming call (A-Party) Bridge call to B-Party (bridge 1xxx@example.domain) Record the conversation (uuid_record aleg_uuid /path/to/audio.file) A C-Party listen using eavesdrop (originate 2xxx@example.domain&eavesdrop aleg_uuid)
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of x.liu Sent: Monday, February 27, 2012 2:52 PM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] How to bridge a call to an extension defined in dialplan
Hi Peter,
Thanks for your reply!
You are right, that is what I have been experiencing but not I wanted.
Actually my goal is simply to record the user call by my app (js or java via ESL) and at the same time I want to hear what the user is saying through my computer's speaker.
The recording app seems to be ok ( I tried recording via dialplan commands as well as ESL Java app). What I am doing now is to bridge the call to my app for recording and to a softphone for hearing user's voice.
I thought it would work as the wiki says the bridge can bridge the call to multiple endpoints at the same time, but unfortunately it won't work for me.
Any suggestions to achieve my goal please: recording and hearing user's voice? (Note: my app will do the recording and also allow me send TTS to the user)
Best, Xing
On 02/27/2012 06:33 PM, Peter Olsson wrote:
Can you explain what you're trying to achieve by doing this?
If you bridge to multiple destinations, the first destination that answers will create the actual call - all other legs are terminated.
/Peter
Från: freeswitch-users-bounces@lists.freeswitch.org [freeswitch-users-bounces@lists.freeswitch.org] för x.liu [x.liu@hw.ac.uk] Skickat: den 27 februari 2012 19:11 Till: freeswitch-users@lists.freeswitch.org Ämne: Re: [Freeswitch-users] How to bridge a call to an extension defined in dialplan
Hi again,
It looks like there is something wrong relating to the [CS_CONSUME_MEDIA] [ORIGINATOR_CANCEL], but no idea how this happened.
A bit desperately to solve this problem ASAP as we will have a demo in a few days.
Please could anybody give any clue?
Many thanks!
On 02/27/2012 11:34 AM, x.liu wrote: Now I tried it at a different machine with different version of FS. The behaviour is slightly different. This time the softphone is ringing but the recording extension is not correctly executed. The version for this test is "FreeSWITCH Version 1.0.head (git-e566057 2011-12-14 10-27-31 -0500)" (The FS version for previous tries is "FreeSWITCH Version 1.0.head (git-54ddef0 2011-12-06 21-53-45 -0600)" )
I copy part of terminal message here, hope it is not too much message for the email list.
-------------------------------------------------- 09:04.180223 [NOTICE] switch_channel.c:920 New Channel sofia/external/anonymous@sipgate.co.uk<mailto:sofia/external/anonymous@sipgate.co.uk> [7596ad60-6133-11e1-9141-8b50a5b8b13b] 09:04.180223 [INFO] mod_dialplan_xml.c:481 Processing anonymous<anonymous>->74997 in context public 09:04.180223 [NOTICE] switch_channel.c:920 New Channel sofia/internal/1003@x.x.x.x<mailto:sofia/internal/1003@x.x.x.x> [75976d18-6133-11e1-9145-8b50a5b8b13b] 09:04.180223 [NOTICE] switch_channel.c:920 New Channel sofia/internal/74999@x.x.x.x<mailto:sofia/internal/74999@x.x.x.x> [75977f24-6133-11e1-914a-8b50a5b8b13b] 09:04.180223 [NOTICE] switch_channel.c:920 New Channel sofia/internal/anonymous@x.x.x.x<mailto:sofia/internal/anonymous@x.x.x.x> [7597aab2-6133-11e1-914e-8b50a5b8b13b] 09:04.180223 [INFO] mod_dialplan_xml.c:481 Processing anonymous<anonymous>->1003 in context public 09:04.180223 [NOTICE] switch_channel.c:920 New Channel sofia/internal/anonymous@x.x.x.x<mailto:sofia/internal/anonymous@x.x.x.x> [75980192-6133-11e1-9150-8b50a5b8b13b] 09:04.180223 [NOTICE] switch_ivr.c:1711 Transfer sofia/external/anonymous@sipgate.co.uk<mailto:sofia/external/anonymous@sipgate.co.uk> to XML[1003@public] 09:04.180223 [NOTICE] switch_ivr_originate.c:3182 Hangup sofia/internal/1003@x.x.x.x<mailto:sofia/internal/1003@x.x.x.x> [CS_CONSUME_MEDIA] [ORIGINATOR_CANCEL] 09:04.180223 [NOTICE] switch_ivr_originate.c:3182 Hangup sofia/internal/74999@x.x.x.x<mailto:sofia/internal/74999@x.x.x.x> [CS_CONSUME_MEDIA] [ORIGINATOR_CANCEL] 09:04.180223 [INFO] mod_dptools.c:2897 Originate Failed. Cause: ORIGINATOR_CANCEL 09:04.180223 [INFO] mod_dialplan_xml.c:481 Processing anonymous<anonymous>->1003 in context public 09:04.180223 [NOTICE] switch_core_session.c:1397 Session 2 (sofia/internal/1003@x.x.x.x<mailto:sofia/internal/1003@x.x.x.x>) Ended 09:04.180223 [NOTICE] switch_core_session.c:1399 Close Channel sofia/internal/1003@x.x.x.x<mailto:sofia/internal/1003@x.x.x.x> [CS_DESTROY] 09:04.180223 [NOTICE] switch_ivr.c:1711 Transfer sofia/external/anonymous@sipgate.co.uk<mailto:sofia/external/anonymous@sipgate.co.uk> to XML[1003@default] 09:04.180223 [INFO] mod_dialplan_xml.c:481 Processing anonymous<anonymous>->1003 in context default 09:04.180223 [NOTICE] sofia.c:427 Hangup sofia/internal/anonymous@x.x.x.x<mailto:sofia/internal/anonymous@x.x.x.x> [CS_EXECUTE] [BLIND_TRANSFER] 09:04.201188 [NOTICE] switch_core_session.c:1397 Session 4 (sofia/internal/anonymous@x.x.x.x<mailto:sofia/internal/anonymous@x.x.x.x>) Ended 09:04.201188 [NOTICE] switch_core_session.c:1399 Close Channel sofia/internal/anonymous@x.x.x.x<mailto:sofia/internal/anonymous@x.x.x.x> [CS_DESTROY] 09:04.201188 [INFO] switch_ivr_async.c:3164 Bound B-Leg: *1 execute_extension::dx XML features 09:04.201188 [INFO] mod_dialplan_xml.c:481 Processing anonymous<anonymous>->74999 in context public 09:04.201188 [INFO] switch_ivr_async.c:3164 Bound B-Leg: *2 record_session:: recordings/anonymous.2012-02-27-11-09-04.wav 09:04.201188 [NOTICE] switch_core_session.c:1397 Session 3 (sofia/internal/74999@x.x.x.x<mailto:sofia/internal/74999@x.x.x.x>) Ended 09:04.201188 [NOTICE] switch_core_session.c:1399 Close Channel sofia/internal/74999@x.x.x.x<mailto:sofia/internal/74999@x.x.x.x> [CS_DESTROY] 09:04.201188 [INFO] switch_ivr_async.c:3164 Bound B-Leg: *3 execute_extension::cf XML features 09:04.201188 [NOTICE] sofia.c:6134 Hangup sofia/internal/anonymous@x.x.x.x<mailto:sofia/internal/anonymous@x.x.x.x> [CS_EXECUTE] [ORIGINATOR_CANCEL] 09:04.201188 [INFO] switch_ivr_async.c:3164 Bound B-Leg: *4 execute_extension::att_xfer XML features 09:04.201188 [NOTICE] switch_core_session.c:1397 Session 5 (sofia/internal/anonymous@x.x.x.x<mailto:sofia/internal/anonymous@x.x.x.x>) Ended 09:04.201188 [NOTICE] switch_core_session.c:1399 Close Channel sofia/internal/anonymous@x.x.x.x<mailto:sofia/internal/anonymous@x.x.x.x> [CS_DESTROY] 09:04.201188 [NOTICE] switch_channel.c:920 New Channel sofia/internal/sip:1003@y.y.y.y:5062 [759a6630-6133-11e1-9158-8b50a5b8b13b] 09:04.740223 [NOTICE] sofia.c:5462 Ring-Ready sofia/internal/sip:1003@y.y.y.y:5062! 09:04.740223 [NOTICE] mod_sofia.c:2470 Ring-Ready sofia/external/anonymous@sipgate.co.uk<mailto:sofia/external/anonymous@sipgate.co.uk>! 09:04.740223 [NOTICE] switch_ivr_originate.c:483 Ring Ready sofia/external/anonymous@sipgate.co.uk<mailto:sofia/external/anonymous@sipgate.co.uk>! 09:07.700221 [NOTICE] sofia.c:6040 Channel [sofia/internal/sip:1003@y.y.y.y:5062] has been answered 09:07.700221 [NOTICE] switch_ivr_originate.c:483 Ring Ready sofia/external/anonymous@sipgate.co.uk<mailto:sofia/external/anonymous@sipgate.co.uk>! -------------------------------------------------
Hi,
H tried this way
<action application="bridge" data="sofia/internal/1003%${sip_profile},sofia/internal/74991@${domain}"/>
74991 is reached and I heard the prompt. The 1003 softphone is terminated immediately after it is reached. then extension 74991 hung up itself as well.
I saw the terminal message: mod_dptools.c:2897 Originate Failed. Cause: ORIGINATOR_CANCEL
What would be the reason for that?
Thanks, Xing
On 02/26/2012 10:29 PM, Liu, Xingkun 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@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@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@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@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@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@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. !DSPAM:4f4bc71e32767806511310!
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@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