Bug?: recordFile with input callback always ends recording
Hi All, I am using the following peace of code, It should be able to set a termination key with the cStopRecording variable, and inside the input callback it should terminate if the dtmf key entered is valid and should return "break". However as soon as it gets inside the input callback function it always terminates the recording? Based on the wiki example this should work. By debugging I can see it never gets to the"return "break"". So the evaluation is correct. Can someone please tell me what I am doing wrong or is it a bug? Regards, Mike. ---------------------------------------------------- cStopRecordingKey = "#" cFile = "blah.wav" session:setInputCallback("Record_onInput", ""); session:recordFile(cFile, 120, 10, 10); session:streamFile(cFile); function Record_onInput(s, type, obj) if cRecordingStopkey == "-" then cRecordingStopkey = "" end -- None if cRecordingStopkey == "+" then cRecordingStopkey = "0123456789*#" end -- Any if type == "dtmf" then freeswitch.consoleLog("NOTICE", "Got recording input: ".. obj['digit']); freeswitch.consoleLog("NOTICE", "Stopkey : ".. cRecordingStopkey); if (string.find(cRecordingStopkey, obj['digit'])~=nil) then -- It should only terminate when the key is in the list! return "break"; end end end ----------------------------------------------------
Have you tried setting the variable playback_terminators to "none"? I believe this variable has effect on recordings as well. /Peter -----Ursprungligt meddelande----- Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Michael Lutz Skickat: den 17 februari 2012 15:12 Till: FreeSWITCH Users Help Ämne: [Freeswitch-users] Bug?: recordFile with input callback always ends recording Hi All, I am using the following peace of code, It should be able to set a termination key with the cStopRecording variable, and inside the input callback it should terminate if the dtmf key entered is valid and should return "break". However as soon as it gets inside the input callback function it always terminates the recording? Based on the wiki example this should work. By debugging I can see it never gets to the"return "break"". So the evaluation is correct. Can someone please tell me what I am doing wrong or is it a bug? Regards, Mike. ---------------------------------------------------- cStopRecordingKey = "#" cFile = "blah.wav" session:setInputCallback("Record_onInput", ""); session:recordFile(cFile, 120, 10, 10); session:streamFile(cFile); function Record_onInput(s, type, obj) if cRecordingStopkey == "-" then cRecordingStopkey = "" end -- None if cRecordingStopkey == "+" then cRecordingStopkey = "0123456789*#" end -- Any if type == "dtmf" then freeswitch.consoleLog("NOTICE", "Got recording input: ".. obj['digit']); freeswitch.consoleLog("NOTICE", "Stopkey : ".. cRecordingStopkey); if (string.find(cRecordingStopkey, obj['digit'])~=nil) then -- It should only terminate when the key is in the list! return "break"; end end end ---------------------------------------------------- _________________________________________________________________________ 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 !DSPAM:4f3e5ee832763625519449!
You can do session:setVariable('playback_terminators','#'); before the record and remove the input_callback or you could use session_record and in your callback use stop_record_session - i'd go the latter. -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Peter Olsson Sent: 17 February 2012 14:22 To: 'FreeSWITCH Users Help' Subject: Re: [Freeswitch-users] Bug?: recordFile with input callback always ends recording Have you tried setting the variable playback_terminators to "none"? I believe this variable has effect on recordings as well. /Peter -----Ursprungligt meddelande----- Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Michael Lutz Skickat: den 17 februari 2012 15:12 Till: FreeSWITCH Users Help Ämne: [Freeswitch-users] Bug?: recordFile with input callback always ends recording Hi All, I am using the following peace of code, It should be able to set a termination key with the cStopRecording variable, and inside the input callback it should terminate if the dtmf key entered is valid and should return "break". However as soon as it gets inside the input callback function it always terminates the recording? Based on the wiki example this should work. By debugging I can see it never gets to the"return "break"". So the evaluation is correct. Can someone please tell me what I am doing wrong or is it a bug? Regards, Mike. ---------------------------------------------------- cStopRecordingKey = "#" cFile = "blah.wav" session:setInputCallback("Record_onInput", ""); session:recordFile(cFile, 120, 10, 10); session:streamFile(cFile); function Record_onInput(s, type, obj) if cRecordingStopkey == "-" then cRecordingStopkey = "" end -- None if cRecordingStopkey == "+" then cRecordingStopkey = "0123456789*#" end -- Any if type == "dtmf" then freeswitch.consoleLog("NOTICE", "Got recording input: ".. obj['digit']); freeswitch.consoleLog("NOTICE", "Stopkey : ".. cRecordingStopkey); if (string.find(cRecordingStopkey, obj['digit'])~=nil) then -- It should only terminate when the key is in the list! return "break"; end end end ---------------------------------------------------- _________________________________________________________________________ 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 !DSPAM:4f3e5ee832763625519449! _________________________________________________________________________ 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
Hi Oz, I tried: session:setVariable('playback_terminators', cRecordingStopkey); session:recordFile(cFile, nMaxduration, 10, nSilenceDelay); session:setVariable('playback_terminators', 'none'); But now when I press a key freeswitch just totaly stops, (crash), without anything valuable in the logs... 2012-02-17 16:05:11.063289 [ERR] switch_cpp.cpp:1227 ========> Starting the recording: SPEAK! 2012-02-17 16:05:11.063289 [DEBUG] switch_ivr_play_say.c:585 Raw Codec Activated 2012-02-17 16:05:11.063289 [DEBUG] switch_core_codec.c:216 sofia/internal/31205222332@172.16.5.12 Push codec L16:70 2012-02-17 16:05:15.064689 [DEBUG] switch_rtp.c:3405 RTP RECV DTMF #:2080 2012-02-17 16:05:15.064689 [DEBUG] switch_core_codec.c:241 sofia/internal/31205222332@172.16.5.12 Restore previous codec PCMU:0. <eof> Does not seem to be working either... I could try using the api session_record function, but what about silence detection? /Mike. 2012/2/17 Oz Mortimer <oz@o-tec.tv>:
You can do session:setVariable('playback_terminators','#'); before the record and remove the input_callback or you could use session_record and in your callback use stop_record_session - i'd go the latter.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Peter Olsson Sent: 17 February 2012 14:22 To: 'FreeSWITCH Users Help' Subject: Re: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Have you tried setting the variable playback_terminators to "none"?
I believe this variable has effect on recordings as well.
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Michael Lutz Skickat: den 17 februari 2012 15:12 Till: FreeSWITCH Users Help Ämne: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Hi All,
I am using the following peace of code, It should be able to set a termination key with the cStopRecording variable, and inside the input callback it should terminate if the dtmf key entered is valid and should return "break". However as soon as it gets inside the input callback function it always terminates the recording? Based on the wiki example this should work. By debugging I can see it never gets to the"return "break"". So the evaluation is correct.
Can someone please tell me what I am doing wrong or is it a bug?
Regards, Mike.
---------------------------------------------------- cStopRecordingKey = "#" cFile = "blah.wav"
session:setInputCallback("Record_onInput", ""); session:recordFile(cFile, 120, 10, 10); session:streamFile(cFile);
function Record_onInput(s, type, obj) if cRecordingStopkey == "-" then cRecordingStopkey = "" end -- None if cRecordingStopkey == "+" then cRecordingStopkey = "0123456789*#" end -- Any
if type == "dtmf" then freeswitch.consoleLog("NOTICE", "Got recording input: ".. obj['digit']); freeswitch.consoleLog("NOTICE", "Stopkey : ".. cRecordingStopkey); if (string.find(cRecordingStopkey, obj['digit'])~=nil) then -- It should only terminate when the key is in the list! return "break"; end end
end ----------------------------------------------------
_________________________________________________________________________ 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
!DSPAM:4f3e5ee832763625519449!
_________________________________________________________________________ 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
Tried replacing if (string.find(cRecordingStopkey, obj['digit'])~=nil) then with If obj['digit'] == cStopRecordingKey then Or If obj['digit'] == '#' then ? Looking at you code, I can't see where cRecordingStopkey is defined? -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Lutz Sent: 17 February 2012 15:09 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Bug?: recordFile with input callback always ends recording Hi Oz, I tried: session:setVariable('playback_terminators', cRecordingStopkey); session:recordFile(cFile, nMaxduration, 10, nSilenceDelay); session:setVariable('playback_terminators', 'none'); But now when I press a key freeswitch just totaly stops, (crash), without anything valuable in the logs... 2012-02-17 16:05:11.063289 [ERR] switch_cpp.cpp:1227 ========> Starting the recording: SPEAK! 2012-02-17 16:05:11.063289 [DEBUG] switch_ivr_play_say.c:585 Raw Codec Activated 2012-02-17 16:05:11.063289 [DEBUG] switch_core_codec.c:216 sofia/internal/31205222332@172.16.5.12 Push codec L16:70 2012-02-17 16:05:15.064689 [DEBUG] switch_rtp.c:3405 RTP RECV DTMF #:2080 2012-02-17 16:05:15.064689 [DEBUG] switch_core_codec.c:241 sofia/internal/31205222332@172.16.5.12 Restore previous codec PCMU:0. <eof> Does not seem to be working either... I could try using the api session_record function, but what about silence detection? /Mike. 2012/2/17 Oz Mortimer <oz@o-tec.tv>:
You can do session:setVariable('playback_terminators','#'); before the record and remove the input_callback or you could use session_record and in your callback use stop_record_session - i'd go the latter.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Peter Olsson Sent: 17 February 2012 14:22 To: 'FreeSWITCH Users Help' Subject: Re: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Have you tried setting the variable playback_terminators to "none"?
I believe this variable has effect on recordings as well.
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Michael Lutz Skickat: den 17 februari 2012 15:12 Till: FreeSWITCH Users Help Ämne: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Hi All,
I am using the following peace of code, It should be able to set a termination key with the cStopRecording variable, and inside the input callback it should terminate if the dtmf key entered is valid and should return "break". However as soon as it gets inside the input callback function it always terminates the recording? Based on the wiki example this should work. By debugging I can see it never gets to the"return "break"". So the evaluation is correct.
Can someone please tell me what I am doing wrong or is it a bug?
Regards, Mike.
---------------------------------------------------- cStopRecordingKey = "#" cFile = "blah.wav"
session:setInputCallback("Record_onInput", ""); session:recordFile(cFile, 120, 10, 10); session:streamFile(cFile);
function Record_onInput(s, type, obj) if cRecordingStopkey == "-" then cRecordingStopkey = "" end -- None if cRecordingStopkey == "+" then cRecordingStopkey = "0123456789*#" end -- Any
if type == "dtmf" then freeswitch.consoleLog("NOTICE", "Got recording input: ".. obj['digit']); freeswitch.consoleLog("NOTICE", "Stopkey : ".. cRecordingStopkey); if (string.find(cRecordingStopkey, obj['digit'])~=nil) then -- It should only terminate when the key is in the list! return "break"; end end
end ----------------------------------------------------
_________________________________________________________________________ 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
!DSPAM:4f3e5ee832763625519449!
_________________________________________________________________________ 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
_________________________________________________________________________ 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
If FreeSWITCH crashes you really should raise a ticket on JIRA, and include a backtrace if you can. On 17/02/12 15:08, Michael Lutz wrote:
Hi Oz,
I tried:
session:setVariable('playback_terminators', cRecordingStopkey); session:recordFile(cFile, nMaxduration, 10, nSilenceDelay); session:setVariable('playback_terminators', 'none');
But now when I press a key freeswitch just totaly stops, (crash), without anything valuable in the logs...
2012-02-17 16:05:11.063289 [ERR] switch_cpp.cpp:1227 ========> Starting the recording: SPEAK! 2012-02-17 16:05:11.063289 [DEBUG] switch_ivr_play_say.c:585 Raw Codec Activated 2012-02-17 16:05:11.063289 [DEBUG] switch_core_codec.c:216 sofia/internal/31205222332@172.16.5.12 Push codec L16:70 2012-02-17 16:05:15.064689 [DEBUG] switch_rtp.c:3405 RTP RECV DTMF #:2080 2012-02-17 16:05:15.064689 [DEBUG] switch_core_codec.c:241 sofia/internal/31205222332@172.16.5.12 Restore previous codec PCMU:0. <eof>
Does not seem to be working either... I could try using the api session_record function, but what about silence detection?
/Mike.
2012/2/17 Oz Mortimer<oz@o-tec.tv>:
You can do session:setVariable('playback_terminators','#'); before the record and remove the input_callback or you could use session_record and in your callback use stop_record_session - i'd go the latter.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Peter Olsson Sent: 17 February 2012 14:22 To: 'FreeSWITCH Users Help' Subject: Re: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Have you tried setting the variable playback_terminators to "none"?
I believe this variable has effect on recordings as well.
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Michael Lutz Skickat: den 17 februari 2012 15:12 Till: FreeSWITCH Users Help Ämne: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Hi All,
I am using the following peace of code, It should be able to set a termination key with the cStopRecording variable, and inside the input callback it should terminate if the dtmf key entered is valid and should return "break". However as soon as it gets inside the input callback function it always terminates the recording? Based on the wiki example this should work. By debugging I can see it never gets to the"return "break"". So the evaluation is correct.
Can someone please tell me what I am doing wrong or is it a bug?
Regards, Mike.
---------------------------------------------------- cStopRecordingKey = "#" cFile = "blah.wav"
session:setInputCallback("Record_onInput", ""); session:recordFile(cFile, 120, 10, 10); session:streamFile(cFile);
function Record_onInput(s, type, obj) if cRecordingStopkey == "-" then cRecordingStopkey = "" end -- None if cRecordingStopkey == "+" then cRecordingStopkey = "0123456789*#" end -- Any
if type == "dtmf" then freeswitch.consoleLog("NOTICE", "Got recording input: ".. obj['digit']); freeswitch.consoleLog("NOTICE", "Stopkey : ".. cRecordingStopkey); if (string.find(cRecordingStopkey, obj['digit'])~=nil) then -- It should only terminate when the key is in the list! return "break"; end end
end ----------------------------------------------------
I have no problems doing that, but need help how to do the backtrace (I am in Win x64). If someone tells me what to do, I can do that, easy to reproduce. Regards, Mike Op 17 feb. 2012 om 16:44 heeft John <freeswitch@earthspike.net> het volgende geschreven:
If FreeSWITCH crashes you really should raise a ticket on JIRA, and include a backtrace if you can.
On 17/02/12 15:08, Michael Lutz wrote:
Hi Oz,
I tried:
session:setVariable('playback_terminators', cRecordingStopkey); session:recordFile(cFile, nMaxduration, 10, nSilenceDelay); session:setVariable('playback_terminators', 'none');
But now when I press a key freeswitch just totaly stops, (crash), without anything valuable in the logs...
2012-02-17 16:05:11.063289 [ERR] switch_cpp.cpp:1227 ========> Starting the recording: SPEAK! 2012-02-17 16:05:11.063289 [DEBUG] switch_ivr_play_say.c:585 Raw Codec Activated 2012-02-17 16:05:11.063289 [DEBUG] switch_core_codec.c:216 sofia/internal/31205222332@172.16.5.12 Push codec L16:70 2012-02-17 16:05:15.064689 [DEBUG] switch_rtp.c:3405 RTP RECV DTMF # 2012-02-17 16:05:15.064689 [DEBUG] switch_core_codec.c:241 sofia/internal/31205222332@172.16.5.12 Restore previous codec PCMU:0. <eof>
Does not seem to be working either... I could try using the api session_record function, but what about silence detection?
/Mike.
2012/2/17 Oz Mortimer<oz@o-tec.tv>:
You can do session:setVariable('playback_terminators','#'); before the record and remove the input_callback or you could use session_record and in your callback use stop_record_session - i'd go the latter.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Peter Olsson Sent: 17 February 2012 14:22 To: 'FreeSWITCH Users Help' Subject: Re: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Have you tried setting the variable playback_terminators to "none"?
I believe this variable has effect on recordings as well.
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Michael Lutz Skickat: den 17 februari 2012 15:12 Till: FreeSWITCH Users Help Ämne: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Hi All,
I am using the following peace of code, It should be able to set a termination key with the cStopRecording variable, and inside the input callback it should terminate if the dtmf key entered is valid and should return "break". However as soon as it gets inside the input callback function it always terminates the recording? Based on the wiki example this should work. By debugging I can see it never gets to the"return "break"". So the evaluation is correct.
Can someone please tell me what I am doing wrong or is it a bug?
Regards, Mike.
---------------------------------------------------- cStopRecordingKey = "#" cFile = "blah.wav"
session:setInputCallback("Record_onInput", ""); session:recordFile(cFile, 120, 10, 10); session:streamFile(cFile);
function Record_onInput(s, type, obj) if cRecordingStopkey == "-" then cRecordingStopkey = "" end -- None if cRecordingStopkey == "+" then cRecordingStopkey = "0123456789*#" end -- Any
if type == "dtmf" then freeswitch.consoleLog("NOTICE", "Got recording input: ".. obj['digit']); freeswitch.consoleLog("NOTICE", "Stopkey : ".. cRecordingStopkey); if (string.find(cRecordingStopkey, obj['digit'])~=nil) then -- It should only terminate when the key is in the list! return "break"; end end
end ----------------------------------------------------
_________________________________________________________________________ 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
A crash is never good. Please try to collect a backtrace and file a Jira for this - it should never happen... ________________________________________ Från: freeswitch-users-bounces@lists.freeswitch.org [freeswitch-users-bounces@lists.freeswitch.org] för Michael Lutz [mytemike72@gmail.com] Skickat: den 17 februari 2012 16:08 Till: FreeSWITCH Users Help Ämne: Re: [Freeswitch-users] Bug?: recordFile with input callback always ends recording Hi Oz, I tried: session:setVariable('playback_terminators', cRecordingStopkey); session:recordFile(cFile, nMaxduration, 10, nSilenceDelay); session:setVariable('playback_terminators', 'none'); But now when I press a key freeswitch just totaly stops, (crash), without anything valuable in the logs... 2012-02-17 16:05:11.063289 [ERR] switch_cpp.cpp:1227 ========> Starting the recording: SPEAK! 2012-02-17 16:05:11.063289 [DEBUG] switch_ivr_play_say.c:585 Raw Codec Activated 2012-02-17 16:05:11.063289 [DEBUG] switch_core_codec.c:216 sofia/internal/31205222332@172.16.5.12 Push codec L16:70 2012-02-17 16:05:15.064689 [DEBUG] switch_rtp.c:3405 RTP RECV DTMF #:2080 2012-02-17 16:05:15.064689 [DEBUG] switch_core_codec.c:241 sofia/internal/31205222332@172.16.5.12 Restore previous codec PCMU:0. <eof> Does not seem to be working either... I could try using the api session_record function, but what about silence detection? /Mike. 2012/2/17 Oz Mortimer <oz@o-tec.tv>:
You can do session:setVariable('playback_terminators','#'); before the record and remove the input_callback or you could use session_record and in your callback use stop_record_session - i'd go the latter.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Peter Olsson Sent: 17 February 2012 14:22 To: 'FreeSWITCH Users Help' Subject: Re: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Have you tried setting the variable playback_terminators to "none"?
I believe this variable has effect on recordings as well.
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Michael Lutz Skickat: den 17 februari 2012 15:12 Till: FreeSWITCH Users Help Ämne: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Hi All,
I am using the following peace of code, It should be able to set a termination key with the cStopRecording variable, and inside the input callback it should terminate if the dtmf key entered is valid and should return "break". However as soon as it gets inside the input callback function it always terminates the recording? Based on the wiki example this should work. By debugging I can see it never gets to the"return "break"". So the evaluation is correct.
Can someone please tell me what I am doing wrong or is it a bug?
Regards, Mike.
---------------------------------------------------- cStopRecordingKey = "#" cFile = "blah.wav"
session:setInputCallback("Record_onInput", ""); session:recordFile(cFile, 120, 10, 10); session:streamFile(cFile);
function Record_onInput(s, type, obj) if cRecordingStopkey == "-" then cRecordingStopkey = "" end -- None if cRecordingStopkey == "+" then cRecordingStopkey = "0123456789*#" end -- Any
if type == "dtmf" then freeswitch.consoleLog("NOTICE", "Got recording input: ".. obj['digit']); freeswitch.consoleLog("NOTICE", "Stopkey : ".. cRecordingStopkey); if (string.find(cRecordingStopkey, obj['digit'])~=nil) then -- It should only terminate when the key is in the list! return "break"; end end
end ----------------------------------------------------
_________________________________________________________________________ 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
_________________________________________________________________________ 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 !DSPAM:4f3e6c6c32762300215586!
Hi Peter, Nope, adding: session:setVariable("playback_terminators", "none"); just before the session:recordFile does not help either.. or is this something which cannot be set inside the lua script? Regards, Mike. 2012/2/17 Peter Olsson <peter.olsson@visionutveckling.se>:
Have you tried setting the variable playback_terminators to "none"?
I believe this variable has effect on recordings as well.
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Michael Lutz Skickat: den 17 februari 2012 15:12 Till: FreeSWITCH Users Help Ämne: [Freeswitch-users] Bug?: recordFile with input callback always ends recording
Hi All,
I am using the following peace of code, It should be able to set a termination key with the cStopRecording variable, and inside the input callback it should terminate if the dtmf key entered is valid and should return "break". However as soon as it gets inside the input callback function it always terminates the recording? Based on the wiki example this should work. By debugging I can see it never gets to the"return "break"". So the evaluation is correct.
Can someone please tell me what I am doing wrong or is it a bug?
Regards, Mike.
---------------------------------------------------- cStopRecordingKey = "#" cFile = "blah.wav"
session:setInputCallback("Record_onInput", ""); session:recordFile(cFile, 120, 10, 10); session:streamFile(cFile);
function Record_onInput(s, type, obj) if cRecordingStopkey == "-" then cRecordingStopkey = "" end -- None if cRecordingStopkey == "+" then cRecordingStopkey = "0123456789*#" end -- Any
if type == "dtmf" then freeswitch.consoleLog("NOTICE", "Got recording input: ".. obj['digit']); freeswitch.consoleLog("NOTICE", "Stopkey : ".. cRecordingStopkey); if (string.find(cRecordingStopkey, obj['digit'])~=nil) then -- It should only terminate when the key is in the list! return "break"; end end
end ----------------------------------------------------
_________________________________________________________________________ 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
!DSPAM:4f3e5ee832763625519449!
_________________________________________________________________________ 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 (5)
-
John
-
Michael lutz
-
Michael Lutz
-
Oz Mortimer
-
Peter Olsson