JavaScript ApiExecute return values
One of the problems that I have with the Wiki is that some of the APIs return a value. In fact, it is possible that many return a Success/Failure if nothing else. However, the Wiki does not specify if any data is returned. The problem sometimes is not with the specified API as listed in the JavaScript Wiki page itself but the APIs that can be invoked from ApiExecute() or with session.execute(). For example, currently I need to use the url_encode() capability. I can find it in mod_commands: <quote> url_encode Url encode a string. Usage: url_encode <string> </quote> Normally I would expect that the code would return the encoded string as a return parameter but this is not stated in the description. I.E., the Wiki entry should be: <quote> url_encode Url encode a string. Usage: encoded_string = url_encode <string> </quote> It is possible that the implementation encodes the string and returns it in the same parameter (i.e., in place). I tried looking at the code, but still am too new at looking at the FreeSwitch code. Of course, I would try it/test it and will do this. But it would be useful if the Wiki was clearer. Regards, David Swardstrom (profile)http://wiki.freeswitch.org/wiki/User:Dswardstrom
all FSAPI interface calls are prototyped the same string in string out an easy way to try them is to type it at the cli url_encode 'this is a test' On Fri, Jun 11, 2010 at 3:57 PM, David Swardstrom < dswardstrom@remotelink.com> wrote:
One of the problems that I have with the Wiki is that some of the APIs return a value. In fact, it is possible that many return a Success/Failure if nothing else. However, the Wiki does not specify if any data is returned.
The problem sometimes is not with the specified API as listed in the JavaScript Wiki page itself but the APIs that can be invoked from ApiExecute() or with session.execute().
For example, currently I need to use the url_encode() capability. I can find it in mod_commands: <quote> url_encode Url encode a string. Usage: url_encode <string> </quote>
Normally I would expect that the code would return the encoded string as a return parameter but this is not stated in the description. I.E., the Wiki entry should be: <quote> url_encode Url encode a string. Usage: encoded_string = url_encode <string> </quote> It is possible that the implementation encodes the string and returns it in the same parameter (i.e., in place).
I tried looking at the code, but still am too new at looking at the FreeSwitch code. Of course, I would try it/test it and will do this. But it would be useful if the Wiki was clearer.
Regards, David Swardstrom (profile)http://wiki.freeswitch.org/wiki/User:Dswardstrom
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
participants (2)
-
Anthony Minessale
-
David Swardstrom