Mod xml rpc

From FreeSWITCH Wiki
Jump to: navigation, search

API command documentation can be found in the mod_commands section.

To use, you must enable this module within the conf/autoload_configs/modules.conf.xml file and restart the switch. You can configure the module (HTTP port, domain, login/password) within the conf/autoload_configs/xml_rpc.conf.xml file.

Contents

webapi

mod_xml_rpc allows you to use the webapi - firing any API from the web browser just as you would from the FS console!

The basic syntax would be:

http://<freeswitch-hostname-or-IP>:8080/webapi/<api command>

For example:

http://192.168.1.1:8080/webapi/help

Requires:

  • HTTP only, no HTTPS
  • port 8080
  • Typical HTTP authentication - username, password (default is freeswitch/works)

Generally, the web root is {prefix}/freeswitch/htdocs.

Other HTML/JavaScript/etc. files in htdocs will get served up as requested.

When using an API command that has more than one word, use a question mark to separate the first and second words, then a space for the rest.

Example:

http://192.168.1.1:8080/webapi/sofia?status%20profile%20internal

Returning data to the webpage using Lua and stream:write

To execute a FS command from a web page and display the result in the webpage use:

http://127.0.0.1:8080/api/lua?lua/api.lua

See also

Search Keywords

xmlrpc modxmlrpc