[Freeswitch-users] pass arguments into javascript

Erwin Davis davis.erwin at gmail.com
Thu Oct 29 07:48:32 PDT 2009


yes, I forgot the single quota in javascript statement. Now I saw the
aruments. Thanks,

On 10/28/09, Eliot Gable
<egable+freeswitch at gmail.com<egable%2Bfreeswitch at gmail.com>>
wrote:
>
> Should work fine. I use this:
>
> var calling_num = argv[0];
> var called_num = argv[1];
>
> Are you sure you actually had valid data in $1 and $2? Try to call it
> from the CLI:
>
> jsrun test.js testvar1 testvar2
>
>
>
>
> On Wed, Oct 28, 2009 at 10:22 PM, Erwin Davis <davis.erwin at gmail.com>
> wrote:
> > Hi, new to javascript. I tried to pass two arguments into javascript,
> >
> > <action application="javascript" data="test.js $1 $2"/>
> >
> >
> > In test.js, I tried to use argv[1]  to retrieve $1 and argv[2] to
> retrieve
> > $2, however, the javascript test.js complained about argv[] as undefined
> > variables. How to retrieve the passing arguments in a javascript same as
> the
> > case above. Thanks,
> >
>
> > _______________________________________________
> > FreeSWITCH-users mailing list
> > 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
> >
> >
>
>
>
> --
> Eliot Gable
>
> "We do not inherit the Earth from our ancestors: we borrow it from our
> children." ~David Brower
>
> "I decided the words were too conservative for me. We're not borrowing
> from our children, we're stealing from them--and it's not even
> considered to be a crime." ~David Brower
>
> "Esse oportet ut vivas, non vivere ut edas." (Thou shouldst eat to
> live; not live to eat.) ~Marcus Tullius Cicero
>
> _______________________________________________
> FreeSWITCH-users mailing list
> 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/20091029/359e5a83/attachment-0002.html 


More information about the FreeSWITCH-users mailing list