1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
|
xHTTP_RPC Module
Ovidiu Sas
<osas@voipembedded.com>
Edited by
Ovidiu Sas
<osas@voipembedded.com>
Edited by
Alex Balashov
<abalashov@evaristesys.com>
Copyright © 2011 VoIPEmbedded Inc.
__________________________________________________________________
Table of Contents
1. Admin Guide
1. Overview
1.1. Limitations
2. Dependencies
2.1. Kamailio Modules
2.2. External Libraries or Applications
3. Parameters
3.1. xhttp_rpc_root (str)
3.2. xhttp_rpc_buf_size (str)
4. Functions
4.1. dispatch_xhttp_rpc()
List of Examples
1.1. Set xhttp_rpc_root parameter
1.2. Set xhttp_rpc_buf_size parameter
1.3. dispatch_xhttp_rpc usage
Chapter 1. Admin Guide
Table of Contents
1. Overview
1.1. Limitations
2. Dependencies
2.1. Kamailio Modules
2.2. External Libraries or Applications
3. Parameters
3.1. xhttp_rpc_root (str)
3.2. xhttp_rpc_buf_size (str)
4. Functions
4.1. dispatch_xhttp_rpc()
1. Overview
1.1. Limitations
This module provides an HTTP transport layer implementation for the RPC
management interface in a human-readable format.
The xHTTP_RPC module uses the xHTTP module to handle HTTP requests.
Read the documentation of the xHTTP module for more details.
1.1. Limitations
* This module does not implement asynchronous RPC commands. It is
unlikely that asynchronous RPC commands will be executed from an
RPC web interface.
* This module does not accept parameters embedded in a structure (see
RPC documentation for more info about how parameters can be passed
to RPC).
* At startup, all RPC commands are sorted and grouped based on their
format. The expected format is [group].[subcommand]. The initial
xhttp_rpc webpage displays all the retrieved groups. All RPC
commands are available as sub-menus of each [group]. If an RPC
command is not in the expected format, it will be dropped from the
initial xhttp_rpc home page menu.
2. Dependencies
2.1. Kamailio Modules
2.2. External Libraries or Applications
2.1. Kamailio Modules
The following modules must be loaded before this module:
* xhttp - xHTTP.
2.2. External Libraries or Applications
The following libraries or applications must be installed before
running Kamailio with this module loaded:
* None
3. Parameters
3.1. xhttp_rpc_root (str)
3.2. xhttp_rpc_buf_size (str)
3.1. xhttp_rpc_root (str)
Specifies the root path for RPC http requests. The link to the RPC web
interface must be constructed using the following pattern:
http://[server_IP]:[tcp_port]/[xhttp_rpc_root]
Default value is "rpc".
Example 1.1. Set xhttp_rpc_root parameter
...
modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
...
3.2. xhttp_rpc_buf_size (str)
Specifies the maximum length of the buffer (in bytes) used to write the
RPC reply information in order to build the HTML response.
Default value is 0 (auto set to 1/3 of the size of the configured pkg
mem).
Example 1.2. Set xhttp_rpc_buf_size parameter
...
modparam("xhttp", "xhttp_rpc_buf_size", 1024)
...
4. Functions
4.1. dispatch_xhttp_rpc()
4.1. dispatch_xhttp_rpc()
Handle the HTTP request and generate a response.
Example 1.3. dispatch_xhttp_rpc usage
...
tcp_accept_no_cl=yes
...
loadmodule "sl.so"
loadmodule "xhttp.so"
loadmodule "xhttp_rpc.so"
...
modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
...
event_route[xhttp:request] {
$var(xhttp_rpc_root) = $(hu{s.substr,0,9});
if ($var(xhttp_rpc_root) == "/http_rpc")
dispatch_xhttp_rpc();
else
xhttp_reply("200", "OK", "text/html",
"<html><body>Wrong URL $hu</body></html>");
}
...
|