<div dir="ltr">From lua, you better do (eg: no need for "session"):<br><br>api = freeswitch.API();<br>uuid = argv[1]<br><br><br>uuid_break_cmd = "uuid_break ".. uuid .. " all";<br>uuid_hold_cmd = "uuid_hold off" .. uuid;<br><br>freeswitch.consoleLog("notice","uuid break cmd: ".. uuid_break_cmd .. "\n");<br><div><br>api:execute("break","all");<br>api:execute(uuid_break_cmd);<br> <br>reply = api:execute(uuid_break_cmd);<br><br>freeswitch.consoleLog("notice", "After uuid_break.\n");<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 13, 2015 at 10:05 AM, Борисов, Дмитрий / Dmitriy Borisov <span dir="ltr"><<a href="mailto:bordmi@rarus.ru" target="_blank">bordmi@rarus.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><a href="https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-freeswitch.Session" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-freeswitch.Session</a>:<div><h2 style="margin:30px 0px 0px;padding:0px;font-size:20px;font-weight:normal;line-height:1.5;color:rgb(51,51,51);border-bottom-color:rgb(0,0,0);font-family:Arial,sans-serif">freeswitch.Session</h2><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px">Create a new session.</p><div style="margin:10px 0px;padding:0px;color:rgb(51,51,51);border:1px solid rgb(204,204,204);overflow:auto;border-radius:3px;font-family:Arial,sans-serif;font-size:14px;line-height:20px"><div style="margin:0px;padding:0px;overflow:hidden;border-bottom-left-radius:3px;border-bottom-right-radius:3px;background-image:initial;background-repeat:initial"><div style="margin:0px;padding:0px"><div style="padding:0px;width:1340px;margin:0px!important;overflow:auto!important;font-size:1em!important;background-color:black!important"><table style="width:1340px;border-radius:0px!important;border:0px!important;float:none!important;height:auto!important;margin:0px!important;outline:0px!important;overflow:visible!important;padding:0px!important;vertical-align:baseline!important;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important;min-height:inherit!important;background:none!important" border="0" cellpadding="0" cellspacing="0"><tbody style="border-radius:0px!important;border:0px!important;float:none!important;height:auto!important;margin:0px!important;outline:0px!important;overflow:visible!important;padding:0px!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important;background:none!important"><tr style="border-radius:0px!important;border:0px!important;float:none!important;height:auto!important;margin:0px!important;outline:0px!important;overflow:visible!important;padding:0px!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important;background:none!important"><td style="width:1325px;border:0px!important;overflow:visible!important;border-radius:0px!important;float:none!important;height:auto!important;outline:0px!important;padding:0px 0px 0px 15px!important;vertical-align:baseline!important;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important;min-height:inherit!important;background:none!important"><div title="Hint: double-click to select code" style="margin:15px 0px 0px!important;padding:0px 0px 15px!important;border-radius:0px!important;border:0px!important;float:none!important;min-height:auto!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important;white-space:pre-wrap!important;background:none!important"><div style="margin:0px!important;padding:0px 1em 0px 0px!important;border-radius:0px!important;border:0px!important;float:none!important;min-height:auto!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important;white-space:nowrap!important;background-image:none!important;background-repeat:initial!important"><code style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important;border-radius:0px!important;border:0px!important;float:none!important;min-height:auto!important;margin:0px!important;outline:0px!important;overflow:visible!important;padding:0px!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important;color:rgb(211,211,211)!important;background:none!important">local session = freeswitch.Session("sofia/<a href="http://10.0.1.100/1001" target="_blank">10.0.1.100/1001</a>");</code></div><div style="margin:0px!important;padding:0px 1em 0px 0px!important;border-radius:0px!important;border:0px!important;float:none!important;min-height:auto!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important;white-space:nowrap!important;background-image:none!important;background-repeat:initial!important"><code style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important;border-radius:0px!important;border:0px!important;float:none!important;min-height:auto!important;margin:0px!important;outline:0px!important;overflow:visible!important;padding:0px!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important;color:rgb(211,211,211)!important;background:none!important">session:transfer("3000", "XML", "default");</code></div></div></td></tr></tbody></table></div></div></div></div></div><div class="gmail_extra"><div style="font-size:12.8000001907349px">What you want to do with lua script?</div></div><div class="gmail_extra"><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><div><div class="h5">2015-02-13 10:54 GMT+03:00 CT Radu <span dir="ltr"><<a href="mailto:ct.radu.001@gmail.com" target="_blank">ct.radu.001@gmail.com</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Anyone with mod_lua knowledge around here ?<br><br></div>Thanks,<br>Costin<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-11 11:57 GMT+02:00 CT Radu <span dir="ltr"><<a href="mailto:ct.radu.001@gmail.com" target="_blank">ct.radu.001@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>Hi all,<br><br></div>I have the following problem:<br></div><div>I have an dialplan rule in freeswitch that delegates the control for the incoming call on a specific number to an erlang application.<br></div><div>This erlang application, at one point executes a lua script using the call:<br></div><div>{api, luarun, "luascript.lua uuid"}<br><br></div><div>In lua I do the following:<br></div><div>api = freeswitch.API();<br></div><div>session = freeswitch.session(argv[1]);<br><br></div><div>uuid = session:get_uuid();<br><br>if session:ready() then<br> uuid_break_cmd = "uuid_break ".. uuid .. " all";<br> uuid_hold_cmd = "uuid_hold off" .. uuid;<br> freeswitch.consoleLog("notice","uuid break cmd: ".. uuid_break_cmd .. "\n");<br> session:execute("break","all");<br> api:executeString(uuid_break_cmd);<br> reply = api:executeString(uuid_break_cmd);<br><br> freeswitch.consoleLog("notice", "After uuid_break.\n");<br>end<br><br></div><div>The thing is that freeswitch ignores completly uuid_break and uuid_hold off<br></div><div>The same command issued via fs_cli has effect.<br><br></div><div>In fs_cli on debug I can see this:<br>2015-02-10 20:23:51.405153 [NOTICE] switch_cpp.cpp:1328 uuid break cmd: uuid_break f36d5e5c-b151-11e4-9674-8f19f7458942 all<br>EXECUTE sofia/<a href="http://ctradu-dev.ezuce.ro/1002@ctradu-dev.ezuce.ro" target="_blank">ctradu-dev.ezuce.ro/1002@ctradu-dev.ezuce.ro</a> break(all)<br>2015-02-10 20:23:51.405153 [DEBUG] mod_erlang_event.c:169 Ignoring event CHANNEL_EXECUTE for attached session f36d5e5c-b151-11e4-9674-8f19f7458942<br>2015-02-10 20:23:51.405153 [DEBUG] mod_erlang_event.c:169 Ignoring event CHANNEL_EXECUTE_COMPLETE for attached session f36d5e5c-b151-11e4-9674-8f19f7458942<br>2015-02-10 20:23:51.405153 [NOTICE] switch_cpp.cpp:1328 After uuid_break.<br><br></div><div>Does anyone know why uuid_break has no effect executed from a script launched via api luarun ?<br></div><div>(And the same command when issued via fs_cli has effect)<br><br></div><div>The freeswitch version is 1.4.15~64bit<br><br></div><div>Thank you,<br>Costin<br></div><div><br></div><div><br><br></div></div>
</blockquote></div><br></div>
</div></div><br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>with best regards,</div><div>Dmitriy Borisov</div><div><br></div></div></div></div></div></div></div></div></div></div></div>
</font></span></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Sincerely,<br><br>Giovanni Maruzzelli<br>Cell : +39-347-2665618<br></div>
</div>