<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div>Thanks for your reply. <br><br></div>I think i didn't explain my question well. I don't want to execute a separate lua script upon each regex match. <br></div>I want a single script with different functions for corresponding inputs. <br><br><include><br> <context name="default"><br> <extension name="radio"><br> <condition><br> <action application="answer"/><br> <action application="lua" data="main.lua"/> <br> </condition><br> </extension><br></context><br><br><br></div>--main.lua <br></div>function next()<br></div> logic<br></div>end<br></div>function previous()<br></div> logic<br></div>end<br><br></div><b>logic for calling above functions goes here. <br> </b><br></div>Is it possible to right above dialplan in a single script with different fucntions? <br><div><div><br></div><div>Thanks. <br></div><div><div><div><div><div><div><div><div><div> <br></div></div></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 8 May 2015 at 13:11, Oleg Stolyar <span dir="ltr"><<a href="mailto:olegstolyar@gmail.com" target="_blank">olegstolyar@gmail.com</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">I just finished playing with it. You can just do this:<div><br></div><div><action application="bind_digit_action" data="my_digits,0,exec:lua,your_script.lua,param1 param2 param3"/><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, May 8, 2015 at 1:05 PM, Aqs Younas <span dir="ltr"><<a href="mailto:aqsyounas@gmail.com" target="_blank">aqsyounas@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hi, users. <br><br>Below is my default.xml snippet. I am using bind_digit_action for different inputs bindings and moves the call to that context upon regex match. <br><br></div><div><condition><br><action application="bind_digit_action" data="moderator,~\*,exec:execute_extension,previous XML Previous"/><br> <action application="bind_digit_action" data="moderator,~\#,exec:execute_extension,next XML Next"/><br> <action application="bind_digit_action" data="moderator,~^\d$,exec:execute_extension,exten XML Exten"/><br> <action application="digit_action_set_realm" data="moderator"/><br> <action application="answer"/><br> <action application="playback" data="shout://<a href="http://127.0.0.1/radio" target="_blank">127.0.0.1/radio</a>"/> </condition><br> <br></div><div>Now I want to write my dialplan in lua which I think is more handy than xml.<br></div><div>Upon regex match call to be executed in corresponding functions.<br><br></div><div>Like, for *<br></div><div><b>function next()</b><br></div><div>for #,<br></div><div><b>function previous()</b><br><br><br></div><div><br></div><div>I know there is a application <b>session.setHangupHook(hangup_function_name)</b>;<br></div><div>Which executes the function(hangup_function_name) upon call hangup.<br><br></div><div>Is there anything available in lua witch executes functions upon regex match.<br></div><div>Or any other way for doing this.<br><br></div><div>Any pointer would be much appreciated. <br><br></div><div>Thanks. <br></div><div><br></div><div><br></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><br></blockquote></div><br></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></div>