Hello,
there is a new module named xhttp which provides an embedded http
server inside the SIP server. It reuses the transport layer from the
core, so you can send http requests via TCP and TLS. The port is the
same as for SIP traffic. The documentation of the module is available
at:
http://sip-router.org/docbook/sip-router/branch/master/modules/xhttp/xhttp.html
Since sip and http are very similar, you can use other modules in
handling the http requests. For example, you can do www-authentication:
event_route[xhttp:request] {
if (!www_authorize("xcap", "subscriber"))
{
www_challenge("sip-router.org", "0");
exit;
}
xhttp_reply("200", "OK", "text/html",
"<html><body>Welcome $au, you are connected from
$si:$sp</body></html>");
}
allowing in this way only local SIP users to do http requests.
For now supports only http 1.0, meaning it cannot take chunked requests
(usually happening in PUT requests with large body). Hope it is useful
for some of you. Its main goal right now is to offer the transport
layer for embedded xcap server (the new xcap_server module), but it can
be used for service monitoring, server control, etc.
Cheers,
Daniel
--
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Miami, Fl, USA - June 21-23, 2010
http://www.asipto.com/index.php/kamailio-advanced-training/