if you want displace session to mux you have to supply the m flag <div><br></div><div>&lt;action application=&quot;displace_session&quot; data=&quot;file.wav m&quot;/&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&#39;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=&quot;bridge&quot; data=&quot;{api_on_answer=&#39;luarun beep.lua ${uuid} 15&#39;}sofia/gateway/my_gw/<a href="tel:18005551212" value="+18005551212" target="_blank">18005551212</a>&quot;/&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>  freeswitch.consoleLog(&quot;WARNING&quot;,&quot;No uuid specified, exiting...\n&quot;)<br>

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

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

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

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

  api:execute(&#39;sched_api&#39;,&#39; +&#39; .. interval .. &#39; none luarun beep.lua &#39; .. uuid .. &#39; &#39; .. interval)<br>end<br></span></font><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  bridged,  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).  This is my dialplan:<br>

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

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

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

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

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

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

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

<br>  &lt;/condition&gt;<br>&lt;/extension&gt;<br><br>I would also like to playback a tone so they know I&#39;m recording them (for legal reasons).  Per the wiki, the displace_session does indeed play back a tone every 15 seconds.  But I&#39;m afraid it never bridges the call..  It&#39;s probably something stupid, but what am I doing wrong here?  I hear the intial beep after dialing the number but no early media with dead air on the line.  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.  I am still working on that one, its probably in the wiki, i&#39;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></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>