lua call to stop_record_session - INVALID COMMAND
I was trying to stop a session record from lua but when I try I get a "Result is INVALID COMMAND!" I am calling this lua script with <action application="set" data="api_hangup_hook=lua proc.lua .."/> so by the time the lua is called, someone has hungup one of the legs. In the lua script I am using this to try to end the record session to the wav file so it gets closed and so I can convert it to mp3 right away and a few other things in the lua script... apicmd = "stop_record_session"; apiarg = recordfile; res = api:execute(apicmd,apiarg); but that is when I get the INVALID COMMAND on the freeswitch console. Is there a proper way to do this from lua?
On Dec 27, 2008, at 5:21 PM, Frank @ Impact wrote:
I was trying to stop a session record from lua but when I try I get a "Result is INVALID COMMAND!"
I am calling this lua script with <action application="set" data="api_hangup_hook=lua proc.lua .."/>
so by the time the lua is called, someone has hungup one of the legs.
In the lua script I am using this to try to end the record session to the wav file so it gets closed and so I can convert it to mp3 right away and a few other things in the lua script...
apicmd = "stop_record_session"; apiarg = recordfile; res = api:execute(apicmd,apiarg);
but that is when I get the INVALID COMMAND on the freeswitch console.
Is there a proper way to do this from lua?
When the call hangs up the record session should stop by itself anyways so this should not be necessary. Mike
Mike, I did some testing and this file is not getting closed. I called the script on hangup. Made sure both legs hungup and then even did a sleep for 5 secs to make sure FS could close any files is needed to. Then I made a copy of the wav file to a tmp file. Then ended the script to return back to the dialplan and made another copy of the wav file to a second tmp file. The first copy I made could not be opened by the media player. Said it was corrupt. The second copy of the file could be opened just fine by the media player. So FS is doing something to the recording file after the lua script returns. This is why I was trying to stop the recording session. Any ideas? -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris Sent: Saturday, December 27, 2008 8:53 PM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] lua call to stop_record_session - INVALIDCOMMAND
apicmd = "stop_record_session"; apiarg = recordfile; res = api:execute(apicmd,apiarg);
but that is when I get the INVALID COMMAND on the freeswitch console.
Is there a proper way to do this from lua?
When the call hangs up the record session should stop by itself anyways so this should not be necessary. Mike
Another way I thought about doing this was to try to do a api_hangup_hook=transfer stop_rec_exten. Then in that extension, do the stop recording and call my system processing script from there. But I could not get the api hook to transfer to the designated extension on hangup. Is transfer not a valid call from api_hangup_hook? -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris On Dec 27, 2008, at 5:21 PM, Frank @ Impact wrote:
I was trying to stop a session record from lua but when I try I get a "Result is INVALID COMMAND!"
When the call hangs up the record session should stop by itself anyways so this should not be necessary. Mike
participants (2)
-
Frank @ Impact
-
Michael Jerris