[Freeswitch-users] Bug?: recordFile with input callback always ends recording

Peter Olsson peter.olsson at visionutveckling.se
Fri Feb 17 17:22:02 MSK 2012


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 at lists.freeswitch.org [mailto:freeswitch-users-bounces at 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 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

!DSPAM:4f3e5ee832763625519449!




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