<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Ok. I will try this.&nbsp;<br><br>Best regards,<div><br></div><div>Robert Stevens</div></div><div><br>On Oct 29, 2012, at 9:01 PM, Anthony Minessale &lt;<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div>if you want displace session to mux you have to supply the m flag&nbsp;<div><br></div><div>&lt;action application="displace_session" data="file.wav m"/&gt;<br><br><div class="gmail_quote">On Mon, Oct 29, 2012 at 7:09 PM, Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sounds like this is something that's more ad-hoc, so you might want to do a quick and dirty combo of Lua and sched_api. Roughly it would look something like this:<br>
<br><font size="1"><span style="font-family:courier new,monospace">&lt;action application="bridge" data="{api_on_answer='luarun beep.lua ${uuid} 15'}sofia/gateway/my_gw/<a href="tel:18005551212" value="+18005551212" target="_blank">18005551212</a>"/&gt;<br>

</span></font><br>Then have beep.lua be something like this:<br><font size="1"><span style="font-family:courier new,monospace">-- beep.lua<br>uuid = argv[1]<br>if ( uuid == nil ) then<br>&nbsp; freeswitch.consoleLog("WARNING","No uuid specified, exiting...\n")<br>

&nbsp; return "exit"<br>end<br><br>interval = argv[2]<br>if ( interval == nil ) then<br>&nbsp;&nbsp; interval = 15<br>end<br><br>api = freeswitch.API()<br>dump = api:execute('uuid_dump',uuid);<br>test = string.sub(dump,1,4)<br>

if ( test == '-ERR' ) then<br>&nbsp; freeswitch.consoleLog("INFO","UUID " .. uuid .. " not present, ending the beeps\n")<br>else<br>&nbsp; -- grab the other leg's uuid<br>&nbsp; other_leg = api:execute('uuid_getvar',uuid .. ' bridge_to')<br>

<br>&nbsp; -- uuid_displace to both legs with muxing on so that parties can still hear each other<br>&nbsp; -- set the v=-xx to an appropriate dB value for the volume you want<br><font size="1">&nbsp; -- change t<font size="1">he '4<font size="1">0' to a higher number to make the beep duration longer</font></font></font><br>

&nbsp; command = ' start tone_stream://v=-18;%(40,0,1000) mux'<br>&nbsp; api:execute('uuid_displace',uuid .. command)<br>&nbsp; api:execute('uuid_displace',other_leg .. command)<br><br>&nbsp; -- queue it up to run again in &lt;interval&gt; seconds<br>

&nbsp; api:execute('sched_api',' +' .. interval .. ' none luarun beep.lua ' .. uuid .. ' ' .. interval)<br>end<br></span><br>Remember, <a href="http://wiki.freeswitch.org/wiki/Reporting_Bugs#Standard_Disclaimer" target="_blank">standard disclaimer</a> applies, so tinker with it before you report back that it does not work. If you get it working then it would be great if you could pay the wiki tax and put it up there as an example of what can be done w/ sched_api and Lua.<br>

<br>-MC<div class="HOEnZb"><div class="h5"><br><br><br><br><div class="gmail_quote">On Mon, Oct 29, 2012 at 5:12 AM, Yuriy Nasida <span dir="ltr">&lt;<a href="mailto:nasida@live.ru" target="_blank">nasida@live.ru</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div><div dir="ltr">
I can be wrong but most likely it is possible via event_socket only. So you have to listen events on FS from some script and when the call is &nbsp;bridged, &nbsp;the script must playback the beep to both legs.<br><br><div><div></div>

<hr>From: <a href="mailto:rstevens@robcoit.com" target="_blank">rstevens@robcoit.com</a><br>Date: Mon, 29 Oct 2012 00:03:51 -0400<br>To: <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>

Subject: [Freeswitch-users] Recording calls with a beep<div><div><br><br><div><span>Hi All,<br><br><br><br>I have been searching the wiki for a good way to insert a beep every 10 seconds into a call that is being recorded (I plan on recording all calls to Comcast from here on out). &nbsp;This is my dialplan:<br>

<br>&lt;extension name="CallCentric.<a href="tel:18002662278" value="+18002662278" target="_blank">18002662278</a>" &gt;<br>&nbsp;&nbsp;&lt;condition field="destination_number" expression="<a>18002662278</a>" &gt;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="sip_h_X-accountcode=${accountcode}" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="sip_h_X-Tag=" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="call_direction=outbound" /&gt;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="hangup_after_bridge=true" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="effective_caller_id_name=${outbound_caller_id_name}" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="effective_caller_id_number=${outbound_caller_id_number}" /&gt;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="inherit_codec=true" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="RECORD_TITLE=Recording ${destination_number} ${caller_id_number} ${strftime(%Y-%m-%d %H:%M)}" /&gt;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="RECORD_COPYRIGHT=(c) 2012" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="RECORD_ARTIST=FreeSwitch" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="RECORD_COMMENT=FreeSwitch" /&gt;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="RECORD_DATE=${strftime(%Y-%m-%d %H:%M)}" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="set" data="RECORD_STEREO=true" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="displace_session" data="tone_stream://%(100,15000,800);loops=-1" /&gt;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="record_session" data="$${base_dir}/recordings/archive/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application="bridge" data="sofia/gateway/CallCentric/<a href="tel:18002662278" value="+18002662278" target="_blank">18002662278</a>" /&gt;<br>

<br>&nbsp;&nbsp;&lt;/condition&gt;<br>&lt;/extension&gt;<br><br>I would also like to playback a tone so they know I'm recording them (for legal reasons). &nbsp;Per the wiki, the displace_session does indeed play back a tone every 15 seconds. &nbsp;But I'm afraid it never bridges the call.. &nbsp;It's probably something stupid, but what am I doing wrong here? &nbsp;I hear the intial beep after dialing the number but no early media with dead air on the line. &nbsp;What is the best way to insert a tone every x seconds while both legs of the call are in progress and so that each party hears the tone?<br>

<br><br>Also, when testing this without tone_stream, the recording works (horaah) but the recording itself is really ssssssssllllooowwwwww. &nbsp;I am still working on that one, its probably in the wiki, i'm looking now, but if anyone has a suggestion let me know.<br>

<br><br></span><br><span>Best regards,</span><div><br></div><div>Robert Stevens</div></div><br></div></div>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></div>                                               </div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br>
<a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br><br>
</font></span><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></font></blockquote></div><br><br clear="all"><div><br></div>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900<br>
</div>
</div></blockquote><blockquote type="cite"><div><span>_________________________________________________________________________</span><br><span>Professional FreeSWITCH Consulting Services:</span><br><span><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a></span><br><span><a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a></span><br><span></span><br><span>FreeSWITCH-powered IP PBX: The CudaTel Communication Server</span><br><span><a href="http://www.cudatel.com">http://www.cudatel.com</a></span><br><span></span><br><span>Official FreeSWITCH Sites</span><br><span><a href="http://www.freeswitch.org">http://www.freeswitch.org</a></span><br><span><a href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a></span><br><span><a href="http://www.cluecon.com">http://www.cluecon.com</a></span><br><span></span><br><span>FreeSWITCH-users mailing list</span><br><span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a></span><br><span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></span><br><span>UNSUBSCRIBE:http://<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">lists.freeswitch.org/mailman/options/freeswitch-users</a></span><br><span><a href="http://www.freeswitch.org">http://www.freeswitch.org</a></span><br></div></blockquote></body></html>