Tony mentioned something that might be an issue for you. Try setting this on the channel:<div><a href="http://wiki.freeswitch.org/wiki/Channel_Variables#record_waste_resources">http://wiki.freeswitch.org/wiki/Channel_Variables#record_waste_resources</a></div>
<div><br></div><div>Let us know if that makes a difference.</div><div><br></div><div>-MC<br><br><div class="gmail_quote">On Thu, Sep 1, 2011 at 2:48 AM, king2kin <span dir="ltr"><<a href="mailto:xing2kin@yahoo.com">xing2kin@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Anthony,<br>
<br>
Actually FreeSwitch application "record" doesn't work either for outbound IVR call (see below), created an empty wav file with its size 68 bytes, the wav file doesn't contain any samples of audio data;<br>
<br>
<action application="record" data="C:/c4dev/freeswitch/Debug/sounds/test.wav 20 200"/><br>
<br>
earlier I reported that "session:recordFile(-)" doesn't work inside Lua Script for any outbound IVR call.<br>
<br>
- My CLI commands to make an outbound IVR call:<br>
<br>
originate {ignore_early_media=true}sofia/gateway/mygateway/1726011 8884<br>
or<br>
originate user/1005 8884<br>
<br>
- xml diaplan for extension 8884:<br>
{<br>
<extension name="Play and Record Sound File"><br>
<condition field="destination_number" expression="^(8884)$"><br>
<action application="answer"/><br>
<action application="sleep" data="1000"/><br>
<action application="playback" data="ivr/ivr-thank_you.wav"/><br>
<br>
<action application="record" data="C:/c4dev/freeswitch/Debug/sounds/test.wav 20 200"/><br>
<br>
<action application="sleep" data="1000"/><br>
<action application="playback" data="voicemail/vm-goodbye.wav"/><br>
<br>
<action application="sleep" data="1000"/><br>
<action application="hangup"/><br>
</condition><br>
</extension><br>
<div class="im">}<br>
<br>
--- On Wed, 8/31/11, Anthony Minessale <<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>> wrote:<br>
<br>
> From: Anthony Minessale <<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>><br>
> Subject: Re: [Freeswitch-users] session:recordFile(-) always creates empty wav file during outbound IVR call<br>
> To: "FreeSWITCH Users Help" <<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>><br>
</div>> Date: Wednesday, August 31, 2011, 7:46 PM<br>
<div><div></div><div class="h5">> Does the empty file contain silence<br>
> that corresponds to the duration<br>
> of the time it's recording?<br>
> Are you producing the audio yourself into the recording and<br>
> can you<br>
> verify with a pcap that there is actually any audio to<br>
> record?<br>
><br>
><br>
> On Wed, Aug 31, 2011 at 9:21 PM, king2kin <<a href="mailto:xing2kin@yahoo.com">xing2kin@yahoo.com</a>><br>
> wrote:<br>
> > Anthony,<br>
> ><br>
> > Thank you for help. I tried outbound IVR call in<br>
> multiple ways again based on your advice,<br>
> session:recordFile(-) still doesn't work normally, still<br>
> created empty wav file .<br>
> ><br>
> > Could anyone please give me a hand on FreeSwitch<br>
> Record? It always fails to record audio file during any<br>
> outbound IVR call (auto dialer) although it works well<br>
> during any inbound ivr call.<br>
> ><br>
> > Session:streamFile(-) works well to play back prompt<br>
> files, dtmf keypress also works, ... during outbound ivr<br>
> call.<br>
> ><br>
> > x.k.<br>
> ><br>
> > --- On Wed, 8/31/11, Anthony Minessale <<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>><br>
> wrote:<br>
> ><br>
> >> From: Anthony Minessale <<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>><br>
> >> Subject: Re: [Freeswitch-users]<br>
> session:recordFile(-) always creates empty wav file during<br>
> outbound IVR call<br>
> >> To: "FreeSWITCH Users Help" <<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>><br>
> >> Date: Wednesday, August 31, 2011, 12:17 PM<br>
> >> try this dial string instead<br>
> >><br>
> >><br>
> {ignore_early_media=true}sofia/gateway/<a href="http://sip.tpad.com/1726011" target="_blank">sip.tpad.com/1726011</a><br>
> >><br>
> >> On Wed, Aug 31, 2011 at 12:52 PM, king2kin <<a href="mailto:xing2kin@yahoo.com">xing2kin@yahoo.com</a>><br>
> >> wrote:<br>
> >> > Hi folks,<br>
> >> ><br>
> >> > With Lua script and/or originate command, I<br>
> have tried<br>
> >> recording a message file during outbound IVR call<br>
> over and<br>
> >> over, session:recordFile(-) inside Lua script does<br>
> create a<br>
> >> wav file during each of my testings but the<br>
> recorded audio<br>
> >> file is always empty.<br>
> >> ><br>
> >> > However, session:recordFile(-) works well for<br>
> inbound<br>
> >> IVR call.<br>
> >> ><br>
> >> > I tried the session:recordFile(-) via Lua<br>
> script in<br>
> >> three ways:<br>
> >> ><br>
> >> > 1. run lua script "test_outcall_ivr.lua" at<br>
> freeswitch<br>
> >> command-line:<br>
> >> ><br>
> >> > luarun test_outcall_ivr.lua<br>
> >> ><br>
> >> ><br>
> >> > -- [test_outcall_ivr.lua]<br>
> >> > {<br>
> >> > local sessionx =<br>
> >><br>
> freeswitch.Session("sofia/gateway/<a href="http://sip.tpad.com/1726011" target="_blank">sip.tpad.com/1726011</a>",<br>
> >> session)<br>
> >> ><br>
> >> > -- Set the path separator<br>
> >> > pathsep = '/'<br>
> >> ><br>
> >> > -- Windows users do this instead:<br>
> >> > -- pathsep = '\'<br>
> >> ><br>
> >> > -- Answer the call<br>
> >> > -- sessionx:answer()<br>
> >> ><br>
> >> > --Create a string with path and filename of a<br>
> sound<br>
> >> file<br>
> >> > prompt = "ivr" .. pathsep ..<br>
> >> "ivr-welcome_to_freeswitch.wav"<br>
> >> ><br>
> >> > -- Print a log message<br>
> >> > freeswitch.consoleLog("INFO","Prompt file is<br>
> '" ..<br>
> >> prompt .. "'\n")<br>
> >> ><br>
> >> > --Play the prompt<br>
> >> > sessionx:streamFile(prompt)<br>
> >> ><br>
> >> > -- Record record file<br>
> >> ><br>
> >><br>
> sessionx:streamFile("phrase:voicemail_record_message")<br>
> >> ><br>
> >> > -- Play a ""bong"" tone prior to recording<br>
> >> ><br>
> >><br>
> sessionx:streamFile("tone_stream://v=-7;%(100,0,941.0,1477.0);v=-7;>=2;+=.1;%(1000,<br>
> >> 0, 640)")<br>
> >> ><br>
> >> > -- record a message<br>
> >> > filename = sessionx:getVariable('sounds_dir')<br>
> ..<br>
> >> pathsep .. "123.wav"<br>
> >> > sessionx:recordFile(filename,300,100,10)<br>
> >> ><br>
> >> > -- play back the recorded msg<br>
> >> > sessionx:streamFile(filename)<br>
> >> ><br>
> >> > -- Hangup<br>
> >> > sessionx:hangup()<br>
> >> ><br>
> >> > }<br>
> >> ><br>
> >> > 2. I also tried it differently by submitting<br>
> the<br>
> >> following commands at the FreeSwitch command-line<br>
> >> interface:<br>
> >> ><br>
> >> > originate user/1005 &transfer(8887 xml<br>
> default)<br>
> >> ><br>
> >> > originate user/1005 &lua('test1.lua')<br>
> >> ><br>
> >> > originate sofia/gateway/<a href="http://sip.tpad.com/1726011" target="_blank">sip.tpad.com/1726011</a><br>
> >> &lua('test1.lua')<br>
> >> ><br>
> >> ><br>
> >> > -- [test1.lua]<br>
> >> > {<br>
> >> > -- Set the path separator<br>
> >> > pathsep = '/'<br>
> >> ><br>
> >> > -- Windows users do this instead:<br>
> >> > -- pathsep = '\'<br>
> >> ><br>
> >> > --Answer the call<br>
> >> > session:answer()<br>
> >> ><br>
> >> > --Create a string with path and filename of a<br>
> sound<br>
> >> file<br>
> >> > prompt = "ivr" .. pathsep ..<br>
> >> "ivr-welcome_to_freeswitch.wav"<br>
> >> ><br>
> >> > -- Print a log message<br>
> >> > freeswitch.consoleLog("INFO","Prompt file is<br>
> '" ..<br>
> >> prompt .. "'\n")<br>
> >> ><br>
> >> > --Play the prompt<br>
> >> > session:streamFile(prompt)<br>
> >> ><br>
> >> > -- Record record file<br>
> >> ><br>
> session:streamFile("phrase:voicemail_record_message")<br>
> >> ><br>
> >> > -- Play a ""bong"" tone prior to recording<br>
> >> ><br>
> >><br>
> session:streamFile("tone_stream://v=-7;%(100,0,941.0,1477.0);v=-7;>=2;+=.1;%(1000,<br>
> >> 0, 640)")<br>
> >> ><br>
> >> > -- record a message<br>
> >> > filename = session:getVariable('sounds_dir')<br>
> ..<br>
> >> pathsep .. "123.wav"<br>
> >> > session:recordFile(filename,300,100,10)<br>
> >> ><br>
> >> > -- play back the recorded msg<br>
> >> > session:streamFile(filename)<br>
> >> ><br>
> >> > -- Hangup<br>
> >> > session:hangup()<br>
> >> > }<br>
> >> ><br>
> >> > -- [xml dialplan for extension 8887]:<br>
> >> > {<br>
> >> > <extension name="Simple Lua<br>
> Test"><br>
> >> > <condition<br>
> >> field="destination_number"<br>
> expression="^(8887)$"><br>
> >> > <br>
> <action<br>
> >> application="set"<br>
> data="record_waste_resources=true"/><br>
> >> > <br>
> <action<br>
> >> application="lua" data="test1.lua"/><br>
> >> > </condition><br>
> >> > </extension><br>
> >> > }<br>
> >> ><br>
> >> ><br>
> >><br>
> ======================================================<br>
> >> ><br>
> >> > For all the above testing cases,<br>
> session:recordFile(-)<br>
> >> always creates an empty wav file for each of<br>
> outbound IVR<br>
> >> calls, however, if I make an inbound IVR call to<br>
> run Lua<br>
> >> script "test1.lua", session:recordFile(-) always<br>
> works<br>
> >> perfect to generate a normal wav file.<br>
> >> ><br>
> >> > So, what's wrong with [session:recordFile(-)]<br>
> during<br>
> >> an outbound IVR call?<br>
> >> ><br>
> >> > x.k.<br>
> >> ><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>
> >><br>
> >><br>
> >><br>
> >> --<br>
> >> Anthony Minessale II<br>
> >><br>
> >> FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
> >> ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
> >> Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">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" target="_blank">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>
> >><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>
> ><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>
><br>
><br>
><br>
> --<br>
> Anthony Minessale II<br>
><br>
> FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
> ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
> Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">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" target="_blank">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>
><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>
<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>
</div></div></blockquote></div><br></div>