[Freeswitch-users] Javascript scripting
Michael Jerris
mike at jerris.com
Tue Nov 18 16:01:55 MSK 2014
if it builds fine then we should just add it to the packages, please open a
jira
On Tuesday, November 18, 2014, Peter Olsson <peter at olssononline.se> wrote:
> If you build it yourself, it should be included when building for 32-bit.
> I'm not sure it's included in the pre-compiled packages though.
>
> 2014-11-18 0:19 GMT+01:00 Robert Boardman <robb at boardman.me.uk
> <javascript:_e(%7B%7D,'cvml','robb at boardman.me.uk');>>:
>
>>
>>
>> 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
>>
>> var exit = false;
>>
>> function onInput( session, type, data, arg ) {
>> if ( type == "dtmf" ) {
>> console_log( "info", "Got digit " + data.digit + "\n");
>> if ( data.digit == "5" ) {
>> exit = true;
>> return( false );
>>
>> }
>> else if ( data.digit == "#" ) {
>> return( "seek:0" );
>>
>> }
>> else if ( data.digit == "1" ) {
>> return( "seek:-500" );
>>
>> }
>> else if ( data.digit == "*" ) {
>> return( "pause" );
>>
>> }
>> else if ( data.digit == "3" ) {
>> return( "seek:+500" );
>>
>> }
>> return( true );
>>
>> }
>>
>> }
>> session = new Session('sofia/gateway/sipuser/789');
>> session.waitForAnswer(10000);
>>
>> if ( session.ready( ) ) {
>> session.answer( );
>> while ( session.ready( ) && ! exit ) {
>> session.streamFile( "c:/wamp/www/tmp/robb193497-tmp.wav", onInput );
>> session.hangup( );
>> }
>> if ( session.ready( ) ) {
>> session.hangup( );
>>
>> }
>>
>> }
>>
>> Thanks
>> Robb
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> <javascript:_e(%7B%7D,'cvml','consulting at freeswitch.org');>
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> <javascript:_e(%7B%7D,'cvml','FreeSWITCH-users at lists.freeswitch.org');>
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20141118/05a1407e/attachment-0001.html
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list