[Freeswitch-users] Recording calls with a beep

Robert Stevens rstevens at robcoit.com
Tue Oct 30 04:52:40 MSK 2012


Ok. I will try this. 

Best regards,

Robert Stevens

On Oct 29, 2012, at 9:01 PM, Anthony Minessale <anthony.minessale at gmail.com> wrote:

> if you want displace session to mux you have to supply the m flag 
> 
> <action application="displace_session" data="file.wav m"/>
> 
> On Mon, Oct 29, 2012 at 7:09 PM, Michael Collins <msc at freeswitch.org> wrote:
>> 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:
>> 
>> <action application="bridge" data="{api_on_answer='luarun beep.lua ${uuid} 15'}sofia/gateway/my_gw/18005551212"/>
>> 
>> Then have beep.lua be something like this:
>> -- beep.lua
>> uuid = argv[1]
>> if ( uuid == nil ) then
>>   freeswitch.consoleLog("WARNING","No uuid specified, exiting...\n")
>>   return "exit"
>> end
>> 
>> interval = argv[2]
>> if ( interval == nil ) then
>>    interval = 15
>> end
>> 
>> api = freeswitch.API()
>> dump = api:execute('uuid_dump',uuid);
>> test = string.sub(dump,1,4)
>> if ( test == '-ERR' ) then
>>   freeswitch.consoleLog("INFO","UUID " .. uuid .. " not present, ending the beeps\n")
>> else
>>   -- grab the other leg's uuid
>>   other_leg = api:execute('uuid_getvar',uuid .. ' bridge_to')
>> 
>>   -- uuid_displace to both legs with muxing on so that parties can still hear each other
>>   -- set the v=-xx to an appropriate dB value for the volume you want
>>   -- change the '40' to a higher number to make the beep duration longer
>>   command = ' start tone_stream://v=-18;%(40,0,1000) mux'
>>   api:execute('uuid_displace',uuid .. command)
>>   api:execute('uuid_displace',other_leg .. command)
>> 
>>   -- queue it up to run again in <interval> seconds
>>   api:execute('sched_api',' +' .. interval .. ' none luarun beep.lua ' .. uuid .. ' ' .. interval)
>> end
>> 
>> Remember, standard disclaimer 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.
>> 
>> -MC
>> 
>> 
>> 
>> 
>> On Mon, Oct 29, 2012 at 5:12 AM, Yuriy Nasida <nasida at live.ru> wrote:
>>> 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.
>>> 
>>> From: rstevens at robcoit.com
>>> Date: Mon, 29 Oct 2012 00:03:51 -0400
>>> To: freeswitch-users at lists.freeswitch.org
>>> Subject: [Freeswitch-users] Recording calls with a beep
>>> 
>>> 
>>> Hi All,
>>> 
>>> 
>>> 
>>> 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:
>>> 
>>> <extension name="CallCentric.18002662278" >
>>>   <condition field="destination_number" expression="18002662278" >
>>>       <action application="set" data="sip_h_X-accountcode=${accountcode}" />
>>>       <action application="set" data="sip_h_X-Tag=" />
>>>       <action application="set" data="call_direction=outbound" />
>>>       <action application="set" data="hangup_after_bridge=true" />
>>>       <action application="set" data="effective_caller_id_name=${outbound_caller_id_name}" />
>>>       <action application="set" data="effective_caller_id_number=${outbound_caller_id_number}" />
>>>       <action application="set" data="inherit_codec=true" />
>>>       <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) 2012" />
>>>       <action application="set" data="RECORD_ARTIST=FreeSwitch" />
>>>       <action application="set" data="RECORD_COMMENT=FreeSwitch" />
>>>       <action application="set" data="RECORD_DATE=${strftime(%Y-%m-%d %H:%M)}" />
>>>       <action application="set" data="RECORD_STEREO=true" />
>>>       <action application="displace_session" data="tone_stream://%(100,15000,800);loops=-1" />
>>>       <action application="record_session" data="$${base_dir}/recordings/archive/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav" />
>>>       <action application="bridge" data="sofia/gateway/CallCentric/18002662278" />
>>> 
>>>   </condition>
>>> </extension>
>>> 
>>> I would also like to playback a tone so they know I'm recording them (for legal reasons).  Per the wiki, the displace_session does indeed play back a tone every 15 seconds.  But I'm afraid it never bridges the call..  It'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?
>>> 
>>> 
>>> 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'm looking now, but if anyone has a suggestion let me know.
>>> 
>>> 
>>> 
>>> Best regards,
>>> 
>>> Robert Stevens
>>> 
>>> _________________________________________________________________________ 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
>>> 
>>> _________________________________________________________________________
>>> 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
>> 
>> 
>> 
>> -- 
>> Michael S Collins
>> Twitter: @mercutioviz
>> http://www.FreeSWITCH.org
>> http://www.ClueCon.com
>> http://www.OSTAG.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
> 
> 
> 
> -- 
> Anthony Minessale II
> 
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
> Twitter: http://twitter.com/FreeSWITCH_wire
> 
> AIM: anthm
> MSN:anthony_minessale at hotmail.com
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
> IRC: irc.freenode.net #freeswitch
> 
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org
> googletalk:conf+888 at conference.freeswitch.org
> pstn:+19193869900
> _________________________________________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20121029/9fc2ab49/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list