<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks Chad and Oz.<div class=""><br class=""></div><div class="">I tried two things:</div><div class=""><br class=""></div><div class="">1) Oz suggestion:</div><div class=""><br class=""></div><div class=""><div class="">local new_session = freeswitch.Session("[origination_caller_id_name='7136694967',origination_caller_id_number='7136694967']sofia/gateway/4_NEXTIVA/3157244022", session);</div><div class="">new_session:setVariable(“RECORD_STEREO”,”false”)</div><div class="">new_session:sleep("5000")</div><div class="">new_session:streamFile("voicemail/vm-goodbye.wav")</div><div class="">new_session:sleep("10000")</div><div class="">new_session:hangup()</div></div><div class=""><br class=""></div><div class="">Did not work…</div><div class=""><br class=""></div><div class="">2) Chad suggestion:</div><div class=""><br class=""></div><div class=""><div class="">local new_session = freeswitch.Session("[origination_caller_id_name='7136694967',origination_caller_id_number='7136694967']sofia/gateway/4_NEXTIVA/3157244022", session);</div><div class=""><br class=""></div><div class="">uuid = new_session:get_uuid()</div><div class="">api = freeswitch.API()</div><div class="">reply = api:executeString("uuid_record " .. uuid .. " start /usr/local/freeswitch/recordings/myrecording.wav")</div><div class=""><br class=""></div><div class="">new_session:sleep("5000")</div><div class="">new_session:streamFile("voicemail/vm-goodbye.wav")</div><div class="">new_session:sleep("10000")</div><div class="">new_session:hangup()</div></div><div class=""><br class=""></div><div class="">Did not work too…&nbsp;</div><div class=""><br class=""></div><div class="">Both cases I have 5 seconds of silence (first 5000 pause) and then when I play the Good Bye wav file it starts to record normally. So I have 5 seconds of silence, good bye sound and 10 seconds of recording.</div><div class=""><br class=""></div><div class="">Chad, I can’t use session:recordFile because it’s a synchronous command that blocks my script.. I need to do a lot of actions like pauses, stream files etc., while the call is still going on…</div><div class=""><br class=""></div><div class="">Maybe should I open a ticket for FreeSWITCH support? (I even don’t know if it exists hehe, maybe a github issue?)</div><div class=""><br class=""></div><div class="">Thank you,</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 30, 2016, at 12:36 AM, Chad Phillips &lt;<a href="mailto:chad@apartmentlines.com" class="">chad@apartmentlines.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">have you tried the session method specifically for recording files?</div><div class=""><br class=""></div><div class=""><a href="https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-session:recordFile" class="">https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-session:recordFile</a></div><div class=""><br class=""></div><div class="">or if that doesn't work, maybe this:</div><div class=""><br class=""></div><div class="">local new_session = freeswitch.Session("someoriginatestring", session);</div><div class="">uuid = new_session:get_uuid()</div><div class="">api = freeswitch.API()</div><div class="">reply = api:executeString("uuid_record " .. uuid .. " start " .. filepath)</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Jan 29, 2016 at 1:31 PM, Oz Mortimer <span dir="ltr" class="">&lt;<a href="mailto:omortimer@gmail.com" target="_blank" class="">omortimer@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class=""><span class=""></span></div><div class=""><div class=""></div><div class="">since this is a single left call try setting record_stereo to false -&nbsp;<a href="https://wiki.freeswitch.org/wiki/Variable_RECORD_STEREO" target="_blank" class="">https://wiki.freeswitch.org/wiki/Variable_RECORD_STEREO</a></div><div class="">I'm probably wrong, but worth a shot!</div><div class=""><div class="h5"><div class=""><br class="">On 29 Jan 2016, at 19:53, Leonardo Ribeiro &lt;<a href="mailto:llribeiro90@gmail.com" target="_blank" class="">llribeiro90@gmail.com</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">Hello Guys,<div class=""><br class=""></div><div class="">Any idea?<br class="">I could not evolve this yet...</div><div class=""><br class=""></div><div class="">Thank you,</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2016-01-28 18:52 GMT-02:00 Leonardo Lima Ribeiro <span dir="ltr" class="">&lt;<a href="mailto:llribeiro90@gmail.com" target="_blank" class="">llribeiro90@gmail.com</a>&gt;</span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hello all,<div class=""><br class=""></div><div class="">I’m trying to record an IVR using my gateway to do the outbound call in my luascript:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Courier" class="">local new_session = freeswitch.Session("[origination_caller_id_name=‘987654321',origination_caller_id_number=‘987654321']sofia/gateway/MY_GATEWAY/<a href="tel:3157244022" value="+13157244022" target="_blank" class="">3157244022</a>", session);</font></div><div class=""><font face="Courier" class="">new_session:execute("record_session","/usr/local/freeswitch/recordings/myrecording.wav")</font></div><div class=""><font face="Courier" class="">new_session:sleep("10000")</font></div><div class=""><font face="Courier" class="">new_session:hangup()</font></div><div class=""><br class=""></div><div class="">So in the above script I just call to the Bank Of America as an example and try to record the first 10 seconds of the call in the recordings path.</div><div class=""><br class=""></div><div class="">The problem is that I have an empty recording file.. Why?</div><div class=""><br class=""></div><div class="">The funny thing is: if I add this command after the record_session command:&nbsp;</div><div class=""><font face="Courier" class="">new_session:streamFile("voicemail/vm-goodbye.wav”);</font></div><div class=""><br class=""></div><div class="">And then this is the entire new script:</div><div class=""><div class=""><font face="Courier" class="">local new_session = freeswitch.Session("[origination_caller_id_name=‘987654321',origination_caller_id_number=‘987654321']sofia/gateway/MY_GATEWAY/<a href="tel:3157244022" value="+13157244022" target="_blank" class="">3157244022</a>", session);</font></div><div class=""><font face="Courier" class="">new_session:execute("record_session","/usr/local/freeswitch/recordings/myrecording.wav”)</font></div><div class=""><span style="font-family:Courier" class="">new_session:streamFile("voicemail/vm-goodbye.wav”);</span></div><div class=""><font face="Courier" class="">new_session:sleep("10000")</font></div><div class=""><font face="Courier" class="">new_session:hangup()</font></div></div><div class=""><br class=""></div><div class="">I can hear the Good Bye sound from my script and then hear the Bank of America IVR.</div><div class=""><br class=""></div><div class="">I just don’t understand why the record works if I play a sound in our side and the record does not work if I don’t play any sound.</div><div class=""><br class=""></div><div class="">Do you know what’s happening? How can I solve this?</div><div class=""><br class=""></div><div class="">Thank you!</div>
<br class=""></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="">Leonardo Lima Ribeiro</div>
</div>
</div></blockquote></div></div><blockquote type="cite" class=""><div class=""><span class="">_________________________________________________________________________</span><br class=""><span class="">Professional FreeSWITCH Consulting Services: </span><br class=""><span class=""><a href="mailto:consulting@freeswitch.org" target="_blank" class="">consulting@freeswitch.org</a></span><br class=""><span class=""><a href="http://www.freeswitchsolutions.com/" target="_blank" class="">http://www.freeswitchsolutions.com</a></span><br class=""><span class=""></span><br class=""><span class="">Official FreeSWITCH Sites</span><br class=""><span class=""><a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org</a></span><br class=""><span class=""><a href="http://confluence.freeswitch.org/" target="_blank" class="">http://confluence.freeswitch.org</a></span><br class=""><span class=""><a href="http://www.cluecon.com/" target="_blank" class="">http://www.cluecon.com</a></span><br class=""><span class=""></span><br class=""><span class="">FreeSWITCH-users mailing list</span><br class=""><span class=""><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" class="">FreeSWITCH-users@lists.freeswitch.org</a></span><br class=""><span class=""><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></span><br class=""><span class="">UNSUBSCRIBE:http://<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" class="">lists.freeswitch.org/mailman/options/freeswitch-users</a></span><br class=""><span class=""><a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org</a></span></div></blockquote></div></div><br class="">_________________________________________________________________________<br class="">
Professional FreeSWITCH Consulting Services:<br class="">
<a href="mailto:consulting@freeswitch.org" class="">consulting@freeswitch.org</a><br class="">
<a href="http://www.freeswitchsolutions.com/" rel="noreferrer" target="_blank" class="">http://www.freeswitchsolutions.com</a><br class="">
<br class="">
Official FreeSWITCH Sites<br class="">
<a href="http://www.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://www.freeswitch.org</a><br class="">
<a href="http://confluence.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://confluence.freeswitch.org</a><br class="">
<a href="http://www.cluecon.com/" rel="noreferrer" target="_blank" class="">http://www.cluecon.com</a><br class="">
<br class="">
FreeSWITCH-users mailing list<br class="">
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" class="">FreeSWITCH-users@lists.freeswitch.org</a><br class="">
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank" class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br class="">
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank" class="">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br class="">
<a href="http://www.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://www.freeswitch.org</a><br class=""></blockquote></div><br class=""></div>
_________________________________________________________________________<br class="">Professional FreeSWITCH Consulting Services: <br class=""><a href="mailto:consulting@freeswitch.org" class="">consulting@freeswitch.org</a><br class="">http://www.freeswitchsolutions.com<br class=""><br class="">Official FreeSWITCH Sites<br class="">http://www.freeswitch.org<br class="">http://confluence.freeswitch.org<br class="">http://www.cluecon.com<br class=""><br class="">FreeSWITCH-users mailing list<br class="">FreeSWITCH-users@lists.freeswitch.org<br class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br class="">UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br class="">http://www.freeswitch.org</div></blockquote></div><br class=""></div></body></html>