<div dir="ltr">see scripts/lua/callback.lua<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 17, 2014 at 5:19 PM, Robert Boardman <span dir="ltr">&lt;<a href="mailto:robb@boardman.me.uk" target="_blank">robb@boardman.me.uk</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"><br><div class="gmail_extra"><br><div class="gmail_quote">Thanks for your replies, yes I need to run on win32 because someone bought the wrong windows version, how easy is it to convert the javascript to lua? shown below</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">var exit = false;</div><div class="gmail_quote"><br></div><div class="gmail_quote">function onInput( session, type, data, arg ) {</div><div class="gmail_quote">if ( type == &quot;dtmf&quot; ) {</div><div class="gmail_quote">    console_log( &quot;info&quot;, &quot;Got digit &quot; + data.digit + &quot;\n&quot;);</div><div class="gmail_quote">    if ( data.digit == &quot;5&quot; ) {</div><div class="gmail_quote">      exit = true;</div><div class="gmail_quote">return( false );</div><div class="gmail_quote"><br></div><div class="gmail_quote">    }</div><div class="gmail_quote">    else if ( data.digit == &quot;#&quot; ) {</div><div class="gmail_quote">      return( &quot;seek:0&quot; );</div><div class="gmail_quote"><br></div><div class="gmail_quote">    }</div><div class="gmail_quote">    else if ( data.digit == &quot;1&quot; ) {</div><div class="gmail_quote">      return( &quot;seek:-500&quot; );</div><div class="gmail_quote"><br></div><div class="gmail_quote">    }</div><div class="gmail_quote">    else if ( data.digit == &quot;*&quot; ) {</div><div class="gmail_quote">      return( &quot;pause&quot; );</div><div class="gmail_quote"><br></div><div class="gmail_quote">    }</div><div class="gmail_quote">    else if ( data.digit == &quot;3&quot; ) {</div><div class="gmail_quote">      return( &quot;seek:+500&quot; );</div><div class="gmail_quote"><br></div><div class="gmail_quote">    }</div><div class="gmail_quote">    return( true );</div><div class="gmail_quote"><br></div><div class="gmail_quote">  }</div><div class="gmail_quote"><br></div><div class="gmail_quote">}</div><div class="gmail_quote">session = new Session(&#39;sofia/gateway/sipuser/789&#39;);</div><div class="gmail_quote">session.waitForAnswer(10000);</div><div class="gmail_quote"><br></div><div class="gmail_quote">if ( session.ready( ) ) {</div><div class="gmail_quote">  session.answer( );</div><div class="gmail_quote">  while ( session.ready( ) &amp;&amp; ! exit ) {</div><div class="gmail_quote">    session.streamFile( &quot;c:/wamp/www/tmp/robb193497-tmp.wav&quot;, onInput );</div><div class="gmail_quote">    session.hangup( );</div><div class="gmail_quote">  }</div><div class="gmail_quote">  if ( session.ready( ) ) {</div><div class="gmail_quote">    session.hangup( );</div><div class="gmail_quote"><br></div><div class="gmail_quote">  }</div><div class="gmail_quote"><br></div><div class="gmail_quote">}</div></div><div class="gmail_quote"><br></div><div class="gmail_quote">Thanks </div><div class="gmail_quote">Robb</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">







<p><font face="courier new, monospace"><b><i><font size="4">Brian West</font></i></b><br><span style="font-size:x-small"><a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a></span></font></p>
<p><font size="1" face="courier new, monospace"><img src="http://billing.freeswitch.org/templates/default/img/whmcslogo.png"><br></font></p><p><font face="courier new, monospace"><b><i>Twitter: @FreeSWITCH , @briankwest</i></b><br><a href="http://www.freeswitchbook.com" target="_blank">http://www.freeswitchbook.com</a><br><a href="http://www.freeswitchcookbook.com" target="_blank">http://www.freeswitchcookbook.com</a></font></p>
<p><font face="courier new, monospace"><b>T:</b>+19184209001 | <b>F:</b>+19184209002 | <b>M:</b>+1918424WEST (9378)<br><b>iNUM:</b>+883 5100 1420 9001 | <b>ISN:</b>410*543 | <b>Skype:</b>briankwest</font></p></div></div>
</div>