<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&#39;t explain my question well. I don&#39;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>&lt;include&gt;<br>  &lt;context name=&quot;default&quot;&gt;<br>   &lt;extension name=&quot;radio&quot;&gt;<br>        &lt;condition&gt;<br>                &lt;action application=&quot;answer&quot;/&gt;<br>                &lt;action application=&quot;lua&quot; data=&quot;main.lua&quot;/&gt; <br>  &lt;/condition&gt;<br>  &lt;/extension&gt;<br>&lt;/context&gt;<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">&lt;<a href="mailto:olegstolyar@gmail.com" target="_blank">olegstolyar@gmail.com</a>&gt;</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>&lt;action application=&quot;bind_digit_action&quot; data=&quot;my_digits,0,exec:lua,your_script.lua,param1 param2 param3&quot;/&gt;<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">&lt;<a href="mailto:aqsyounas@gmail.com" target="_blank">aqsyounas@gmail.com</a>&gt;</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>&lt;condition&gt;<br>&lt;action application=&quot;bind_digit_action&quot; data=&quot;moderator,~\*,exec:execute_extension,previous XML Previous&quot;/&gt;<br>        &lt;action application=&quot;bind_digit_action&quot; data=&quot;moderator,~\#,exec:execute_extension,next XML Next&quot;/&gt;<br>        &lt;action application=&quot;bind_digit_action&quot; data=&quot;moderator,~^\d$,exec:execute_extension,exten XML Exten&quot;/&gt;<br>                &lt;action application=&quot;digit_action_set_realm&quot; data=&quot;moderator&quot;/&gt;<br>        &lt;action application=&quot;answer&quot;/&gt;<br>        &lt;action application=&quot;playback&quot; data=&quot;shout://<a href="http://127.0.0.1/radio" target="_blank">127.0.0.1/radio</a>&quot;/&gt; &lt;/condition&gt;<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>