<div dir="ltr"><a href="https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-freeswitch.Session">https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-freeswitch.Session</a>:<div><h2 id="LuaAPIReference-freeswitch.Session" 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 class="" 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 class="" 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 id="highlighter_947801" class="" style="padding:0px;width:1340px;margin:0px!important;overflow:auto!important;font-size:1em!important;background-color:black!important"><table border="0" cellpadding="0" cellspacing="0" 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,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,Courier,monospace!important;min-height:inherit!important;background:none!important"><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 class="" 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,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,Courier,monospace!important;min-height:inherit!important;background:none!important"><div class="" 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;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 class="" style="margin:0px!important;padding:0px 1em 0px 0px!important;border-radius:0px!important;border:0px!important;float:none!important;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 class="" style="font-family:Consolas,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,Courier,monospace!important;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;color:rgb(211,211,211)!important;background:none!important">local session = freeswitch.Session(&quot;sofia/<a href="http://10.0.1.100/1001">10.0.1.100/1001</a>&quot;);</code></div><div class="" style="margin:0px!important;padding:0px 1em 0px 0px!important;border-radius:0px!important;border:0px!important;float:none!important;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 class="" style="font-family:Consolas,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,Courier,monospace!important;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;color:rgb(211,211,211)!important;background:none!important">session:transfer(&quot;3000&quot;, &quot;XML&quot;, &quot;default&quot;);</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">2015-02-13 10:54 GMT+03:00 CT Radu <span dir="ltr">&lt;<a href="mailto:ct.radu.001@gmail.com" target="_blank">ct.radu.001@gmail.com</a>&gt;</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>Anyone with mod_lua knowledge around here ?<br><br></div>Thanks,<br>Costin<br></div><div class=""><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-02-11 11:57 GMT+02:00 CT Radu <span dir="ltr">&lt;<a href="mailto:ct.radu.001@gmail.com" target="_blank">ct.radu.001@gmail.com</a>&gt;</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, &quot;luascript.lua uuid&quot;}<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 = &quot;uuid_break &quot;.. uuid .. &quot; all&quot;;<br>   uuid_hold_cmd  = &quot;uuid_hold off&quot; .. uuid;<br>   freeswitch.consoleLog(&quot;notice&quot;,&quot;uuid break cmd: &quot;.. uuid_break_cmd .. &quot;\n&quot;);<br>   session:execute(&quot;break&quot;,&quot;all&quot;);<br>   api:executeString(uuid_break_cmd);<br>   reply = api:executeString(uuid_break_cmd);<br><br>   freeswitch.consoleLog(&quot;notice&quot;, &quot;After uuid_break.\n&quot;);<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>_________________________________________________________________________<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"><div><br></div>-- <br><div class="gmail_signature"><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>
</div></div>