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.…
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/
Module: sip-router
Branch: master
Commit: 4cca625ce8229c5513451d135c09d9701c80dcd7
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4cca625…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Wed May 26 11:31:51 2010 +0200
tm: support for changing the reply status in the script
The reply status code is re-read after the onreply_route block
is executed which makes possile to change the status code from the script.
The status code shall be rewritten directly in the message buffer
and in the parsed structure, and the class of provisional and
positive final replies cannot be changed.
---
modules/tm/t_reply.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 9ad1d0e..2e6fd55 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -2129,6 +2129,17 @@ int reply_received( struct sip_msg *p_msg )
stop_rb_timers(&uac->request);
}
#endif /* TM_ONREPLY_FINAL_DROP_OK */
+ /* Re-read the status code, it can be changed in the route block. */
+#ifdef EXTRA_DEBUG
+ /* The class of provisional and positive final replies cannot be changed. */
+ if (((msg_status < 300) || (p_msg->REPLY_STATUS < 300))
+ && (msg_status/100 != p_msg->REPLY_STATUS/100)
+ ) {
+ LOG(L_ERR, "ERROR: The class of provisional and "
+ "positive final replies should not be changed!\n");
+ }
+#endif /* EXTRA_DEBUG */
+ msg_status=p_msg->REPLY_STATUS;
}
#ifdef USE_DST_BLACKLIST
/* add temporary to the blacklist the source of a 503 reply */
Revision: 6006
http://openser.svn.sourceforge.net/openser/?rev=6006&view=rev
Author: henningw
Date: 2010-05-27 15:14:44 +0000 (Thu, 27 May 2010)
Log Message:
-----------
* fix error in documentation related to failure_routing
Modified Paths:
--------------
branches/1.5/modules/carrierroute/README
branches/1.5/modules/carrierroute/doc/carrierroute_admin.xml
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.