Re: [Freeswitch-users] how to play a prompt after connection
Set api_on_answer to execute uuid_broadcast< http://wiki.freeswitch.org/wiki/Mod_commands#uuid_broadcast
which will let you pick which legs to play the recording to. You can pass in the UUID with ${uuid}
-Avi
I tried this, and it worked.....sort of. If I play the prompt the A leg it is fine -- caller hears the prompt, then is connected to called party. If I play it to the B leg, however, the prompt does not seem to start playing at all until the B party actually starts talking, and then the prompt is played extremely choppy and slow.....it takes about 10 seconds to play a 4 second prompt. Meanwhile, the caller and called party can't hear each other. Any idea what is going on and how to fix it? I am doing it in lua as follows: session:execute("export","nolocal:jitterbuffer_msec=100") ; session:setVariable("RECORD_STEREO","true") ; session:setVariable("aleg_uuid",uuid) ; session:execute("record_session", outfile) ; session:execute("set","progress_timeout=60") ; session:execute("set","call_timeout=120") ; session:setVariable("hangup_after_bridge","true") ; session:execute("bridge","sofia/normal_customer/${outdial}@${egress_gateway}") ; --session:execute("bridge","{api_on_answer='uuid_broadcast " .. uuid .. " " .. this_call_is_being_recorded .. " " .. "bleg'}sofia/normal_customer/${outdial}@${egress_gateway}") ;
You could try doing a bridge_pre_execute and play the sounds to each leg independently prior to the bridge. Check out these chan vars: http://wiki.freeswitch.org/wiki/Channel_Variables#bridge_pre_execute_aleg_ap... http://wiki.freeswitch.org/wiki/Channel_Variables#bridge_pre_execute_aleg_da... http://wiki.freeswitch.org/wiki/Channel_Variables#bridge_pre_execute_bleg_ap... http://wiki.freeswitch.org/wiki/Channel_Variables#bridge_pre_execute_bleg_da... -MC On Wed, Aug 29, 2012 at 4:24 AM, Dave Horton <daveh@beachdognet.com> wrote:
Set api_on_answer to execute uuid_broadcast< http://wiki.freeswitch.org/wiki/Mod_commands#uuid_broadcast
which will let you pick which legs to play the recording to. You can pass in the UUID with ${uuid}
-Avi
I tried this, and it worked.....sort of. If I play the prompt the A leg it is fine -- caller hears the prompt, then is connected to called party. If I play it to the B leg, however, the prompt does not seem to start playing at all until the B party actually starts talking, and then the prompt is played extremely choppy and slow.....it takes about 10 seconds to play a 4 second prompt. Meanwhile, the caller and called party can't hear each other. Any idea what is going on and how to fix it? I am doing it in lua as follows:
session:execute("export","nolocal:jitterbuffer_msec=100") ; session:setVariable("RECORD_STEREO","true") ; session:setVariable("aleg_uuid",uuid) ; session:execute("record_session", outfile) ; session:execute("set","progress_timeout=60") ; session:execute("set","call_timeout=120") ; session:setVariable("hangup_after_bridge","true") ; session:execute("bridge","sofia/normal_customer/${outdial}@${egress_gateway}") ; --session:execute("bridge","{api_on_answer='uuid_broadcast " .. uuid .. " " .. this_call_is_being_recorded .. " " .. "bleg'}sofia/normal_customer/${outdial}@${egress_gateway}") ;
_________________________________________________________________________ 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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
I did try that suggestion (api_on_answer uuidbroadcast) and it worked fine if I played it to the a leg, but when I tried playing to the b leg the prompt was incredibly choppy and slow, and delayed the cutthru of a and b legs by a long time. Interestingly, the prompt doesn't even start playing to the b party until some RTP is received from b for some reason, and then it sort of slowly chuffs out the prompt in small choppy chunks. I then tried Michael's follow on suggestion of using bridge_pre_execute_bleg_app, but that didn't work at all -- no prompt heard. I then decided to try the outdial as a bridged conference, and then play a prompt to the conference after the b party picks up. This may actually be the best option for me as I need the prompt to be saved in the recording of the call, and I am guessing when I stream it out on a bridged call it may not show up in the recording. However, I had no luck getting a bridged conference outdial to work at all -- the outdial does work successfully, but a and b parties don't hear each other so one must not be in the conference. And then when the b party hangs up the a party is not automatically hung up, which should happen in a bridged conference if I understand things correctly. So, while I am still interested in what is causing the prompt on the bridge call to sound so bad when played to the b leg, perhaps what is more important to me now is getting the bridged conference to work. Here is what I am doing, in case anyone can point out the problem: session:execute("set","progress_timeout=60") ; session:execute("set","call_timeout=120") ; session:setVariable("hangup_after_bridge","true") ; session:execute("conference","bridge:_uuid_@simple:sofia/normal_customer/${outdial}@${egress_gateway}") ; session:setVariable("conference_enter_sound",this_call_is_being_recorded) ; (I created a conference profile called 'simple' that turns off caller controls; interestingly, that doesn't seem to be picked up either as the debug logging shows it attaching the default caller controls) Dave On 2012-08-29 11:24:00 +0000, Dave Horton said:
Set api_on_answer to execute uuid_broadcast< http://wiki.freeswitch.org/wiki/Mod_commands#uuid_broadcast
which will let you pick which legs to play the recording to. You can pass in the UUID with ${uuid}
-Avi
I tried this, and it worked.....sort of. If I play the prompt the A leg it is fine -- caller hears the prompt, then is connected to called party. If I play it to the B leg, however, the prompt does not seem to start playing at all until the B party actually starts talking, and then the prompt is played extremely choppy and slow.....it takes about 10 seconds to play a 4 second prompt. Meanwhile, the caller and called party can't hear each other. Any idea what is going on and how to fix it? I am doing it in lua as follows:
session:execute("export","nolocal:jitterbuffer_msec=100") ; session:setVariable("RECORD_STEREO","true") ; session:setVariable("aleg_uuid",uuid) ; session:execute("record_session", outfile) ; session:execute("set","progress_timeout=60") ; session:execute("set","call_timeout=120") ; session:setVariable("hangup_after_bridge","true") ; session:execute("bridge","sofia/normal_customer/${outdial}@${egress_gateway}") ; --session:execute("bridge","{api_on_answer='uuid_broadcast " .. uuid .. " " .. this_call_is_being_recorded .. " " .. "bleg'}sofia/normal_customer/${outdial}@${egress_gateway}") ;
_________________________________________________________________________ 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
I would try to get this working w/ just raw XML dialplan and take Lua out of the equation. Once you get it working then migrate into a Lua script, assuming you even need to use it. Personally, I try not to overuse Lua (or any other dp scripting language) and keep as much in the XML dialplan as possible. Lab it up just with the dialplan using as simple a config as possible. Capture logs and post to pastebin.freeswitch.org along with your relevant configs (dialplan, conference) and some of the gang here will see if they can help analyze what's going on. -MC On Thu, Aug 30, 2012 at 5:44 AM, Dave Horton <daveh@beachdognet.com> wrote:
I did try that suggestion (api_on_answer uuidbroadcast) and it worked fine if I played it to the a leg, but when I tried playing to the b leg the prompt was incredibly choppy and slow, and delayed the cutthru of a and b legs by a long time. Interestingly, the prompt doesn't even start playing to the b party until some RTP is received from b for some reason, and then it sort of slowly chuffs out the prompt in small choppy chunks.
I then tried Michael's follow on suggestion of using bridge_pre_execute_bleg_app, but that didn't work at all -- no prompt heard.
I then decided to try the outdial as a bridged conference, and then play a prompt to the conference after the b party picks up. This may actually be the best option for me as I need the prompt to be saved in the recording of the call, and I am guessing when I stream it out on a bridged call it may not show up in the recording.
However, I had no luck getting a bridged conference outdial to work at all -- the outdial does work successfully, but a and b parties don't hear each other so one must not be in the conference. And then when the b party hangs up the a party is not automatically hung up, which should happen in a bridged conference if I understand things correctly.
So, while I am still interested in what is causing the prompt on the bridge call to sound so bad when played to the b leg, perhaps what is more important to me now is getting the bridged conference to work. Here is what I am doing, in case anyone can point out the problem:
session:execute("set","progress_timeout=60") ; session:execute("set","call_timeout=120") ; session:setVariable("hangup_after_bridge","true") ; session:execute("conference","bridge:_uuid_@simple :sofia/normal_customer/${outdial}@${egress_gateway}") ; session:setVariable("conference_enter_sound",this_call_is_being_recorded) ;
(I created a conference profile called 'simple' that turns off caller controls; interestingly, that doesn't seem to be picked up either as the debug logging shows it attaching the default caller controls)
Dave
On 2012-08-29 11:24:00 +0000, Dave Horton said:
Set api_on_answer to execute uuid_broadcast< http://wiki.freeswitch.org/wiki/Mod_commands#uuid_broadcast
which will let you pick which legs to play the recording to. You can pass in the UUID with ${uuid}
-Avi
I tried this, and it worked.....sort of. If I play the prompt the A leg it is fine -- caller hears the prompt, then is connected to called party. If I play it to the B leg, however, the prompt does not seem to start playing at all until the B party actually starts talking, and then the prompt is played extremely choppy and slow.....it takes about 10 seconds to play a 4 second prompt. Meanwhile, the caller and called party can't hear each other. Any idea what is going on and how to fix it? I am doing it in lua as follows:
session:execute("export","nolocal:jitterbuffer_msec=100") ; session:setVariable("RECORD_STEREO","true") ; session:setVariable("aleg_uuid",uuid) ; session:execute("record_session", outfile) ; session:execute("set","progress_timeout=60") ; session:execute("set","call_timeout=120") ; session:setVariable("hangup_after_bridge","true") ; session:execute("bridge","sofia/normal_customer/${outdial}@ ${egress_gateway}") ; --session:execute("bridge","{api_on_answer='uuid_broadcast " .. uuid .. " " .. this_call_is_being_recorded .. " " .. "bleg'}sofia/normal_customer/${outdial}@${egress_gateway}") ;
_________________________________________________________________________ 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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
On 2012-08-30 16:24:28 +0000, Michael Collins said:
Lab it up just with the dialplan using as simple a config as possible. Capture logs and post to pastebin.freeswitch.org along with your relevant configs (dialplan, conference) and some of the gang here will see if they can help analyze what's going on.
Ok, I reproduced the scenario where it is a bridged call (not a conference) where I play the prompt after answer and get the extremely choppy audio (10 seconds or more to play a 4 second prompt). The pastebin of the debug logging is at http://pastebin.freeswitch.org/19785, and the configuration I used is below. If anyone can point out what might be causing this it would be appreciated. Next I will try the conferencing version and paste those results <extension name="6174973896" continue="false"> <condition field="source" expression="mod_sofia"/> <condition field="destination_number" expression="6174973896"> <action application="set" data="call_limit=1"/> <action application="set" data="callFactor=1"/> <action application="set" data="customer=cps_play"/> <action application="ring_ready"/> <action application="pre_answer"/> <action application="start_dtmf"/> <action application="set" data="call_id=${strftime(%Y%m%d_%H%M%S)}_${sip_from_tag}"/> <action application="set" data="outfile=$${base_dir}/recordings/${call_id}.wav"/> <action application="export" data="nolocal:jitterbuffer_msec=100"/> <action application="set" data="RECORD_STEREO=true"/> <action application="set" data="aleg_uuid=${uuid}"/> <action application="set" data="call_id=${strftime(%Y%m%d_%H%M%S)}_${sip_from_tag}"/> <action application="set" data="outfile=$${base_dir}/recordings/${call_id}.wav"/> <action application="record_session" data="${outfile}"/> <action application="set" data="progress_timeout=60"/> <action application="set" data="call_timeout=120"/> <action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE"/> <action application="set" data="hangup_after_bridge=true"/> <action application="export" data="nolocal:api_on_answer=uuid_broadcast ${uuid} misc/this-call-is-being-recorded.wav bleg"/> <action application="bridge" data="sofia/normal_customer/15083084809@${egress_gateway}"/> </condition> </extension>
On 2012-08-30 18:59:34 +0000, Dave Horton said:
Next I will try the conferencing version and paste those results
Below is the configuration I used with the bridged conferencing. Something must be wrong because there is no audio path between the a and b legs; also, when b hangs up a stays connected. Pastebin is at http://pastebin.freeswitch.org/19786 and configuration is below. I'd welcome any thoughts on what is wrong... <extension name="6174973896" continue="false"> <condition field="source" expression="mod_sofia"/> <condition field="destination_number" expression="6174973896"> <action application="set" data="call_limit=1"/> <action application="set" data="callFactor=1"/> <action application="set" data="customer=cps_play"/> <action application="ring_ready"/> <action application="pre_answer"/> <action application="start_dtmf"/> <action application="set" data="call_id=${strftime(%Y%m%d_%H%M%S)}_${sip_from_tag}"/> <action application="set" data="outfile=$${base_dir}/recordings/${call_id}.wav"/> <action application="export" data="nolocal:jitterbuffer_msec=100"/> <action application="set" data="RECORD_STEREO=true"/> <action application="set" data="aleg_uuid=${uuid}"/> <action application="set" data="call_id=${strftime(%Y%m%d_%H%M%S)}_${sip_from_tag}"/> <action application="set" data="outfile=$${base_dir}/recordings/${call_id}.wav"/> <action application="record_session" data="${outfile}"/> <action application="set" data="progress_timeout=60"/> <action application="set" data="call_timeout=120"/> <action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE"/> <action application="set" data="hangup_after_bridge=true"/> <action application="conference" data="bridge:_uuid_@simple:sofia/normal_customer/15083084809@${egress_gateway}"/> <action application="set" data="conference_enter_sound=misc/this-call-is-being-recorded"/> </condition> </extension>
Dave, Can you turn off the sofia debugging? It's almost completely useless in these scenarios. (only a few devs really understand it and they'll let you know if you need to turn it on.) Also, please use "FreeSWITCH Log" as syntax highlighting - that makes life much easier for those of us whose eyes have higher mileage... -MC On Thu, Aug 30, 2012 at 12:31 PM, Dave Horton <daveh@beachdognet.com> wrote:
On 2012-08-30 18:59:34 +0000, Dave Horton said:
Next I will try the conferencing version and paste those results
Below is the configuration I used with the bridged conferencing. Something must be wrong because there is no audio path between the a and b legs; also, when b hangs up a stays connected.
Pastebin is at http://pastebin.freeswitch.org/19786 and configuration is below. I'd welcome any thoughts on what is wrong...
<extension name="6174973896" continue="false"> <condition field="source" expression="mod_sofia"/> <condition field="destination_number" expression="6174973896"> <action application="set" data="call_limit=1"/> <action application="set" data="callFactor=1"/> <action application="set" data="customer=cps_play"/> <action application="ring_ready"/> <action application="pre_answer"/> <action application="start_dtmf"/> <action application="set" data="call_id=${strftime(%Y%m%d_%H%M%S)}_${sip_from_tag}"/> <action application="set" data="outfile=$${base_dir}/recordings/${call_id}.wav"/> <action application="export" data="nolocal:jitterbuffer_msec=100"/> <action application="set" data="RECORD_STEREO=true"/> <action application="set" data="aleg_uuid=${uuid}"/> <action application="set" data="call_id=${strftime(%Y%m%d_%H%M%S)}_${sip_from_tag}"/> <action application="set" data="outfile=$${base_dir}/recordings/${call_id}.wav"/> <action application="record_session" data="${outfile}"/> <action application="set" data="progress_timeout=60"/> <action application="set" data="call_timeout=120"/> <action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE"/> <action application="set" data="hangup_after_bridge=true"/> <action application="conference" data="bridge:_uuid_@simple:sofia/normal_customer/15083084809 @${egress_gateway}"/>
<action application="set" data="conference_enter_sound=misc/this-call-is-being-recorded"/>
</condition> </extension>
_________________________________________________________________________ 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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
OK, here is a pastebin minus the sip tracing with the highlighting: http://pastebin.freeswitch.org/19788 On 2012-08-30 19:39:02 +0000, Michael Collins said:
Dave, Can you turn off the sofia debugging? It's almost completely useless in these scenarios. (only a few devs really understand it and they'll let you know if you need to turn it on.) Also, please use "FreeSWITCH Log" as syntax highlighting - that makes life much easier for those of us whose eyes have higher mileage... -MC
On Thu, Aug 30, 2012 at 12:31 PM, Dave Horton <daveh@beachdognet.com> wrote: On 2012-08-30 18:59:34 +0000, Dave Horton said:
Next I will try the conferencing version and paste those results
Below is the configuration I used with the bridged conferencing. Something must be wrong because there is no audio path between the a and b legs; also, when b hangs up a stays connected.
Pastebin is at http://pastebin.freeswitch.org/19786 and configuration is below. I'd welcome any thoughts on what is wrong...
<extension name="6174973896" continue="false"> <condition field="source" expression="mod_sofia"/> <condition field="destination_number" expression="6174973896"> <action application="set" data="call_limit=1"/> <action application="set" data="callFactor=1"/> <action application="set" data="customer=cps_play"/> <action application="ring_ready"/> <action application="pre_answer"/> <action application="start_dtmf"/> <action application="set" data="call_id=${strftime(%Y%m%d_%H%M%S)}_${sip_from_tag}"/> <action application="set" data="outfile=$${base_dir}/recordings/${call_id}.wav"/> <action application="export" data="nolocal:jitterbuffer_msec=100"/> <action application="set" data="RECORD_STEREO=true"/> <action application="set" data="aleg_uuid=${uuid}"/> <action application="set" data="call_id=${strftime(%Y%m%d_%H%M%S)}_${sip_from_tag}"/> <action application="set" data="outfile=$${base_dir}/recordings/${call_id}.wav"/> <action application="record_session" data="${outfile}"/> <action application="set" data="progress_timeout=60"/> <action application="set" data="call_timeout=120"/> <action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE"/> <action application="set" data="hangup_after_bridge=true"/> <action application="conference" data="bridge:_uuid_@simple:sofia/normal_customer/15083084809@${egress_gateway}"/>
<action application="set" data="conference_enter_sound=misc/this-call-is-being-recorded"/>
</condition> </extension>
_________________________________________________________________________ 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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.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
participants (2)
-
Dave Horton
-
Michael Collins