[sr-dev] git:master: modules/outbound: for non-reg requests, check if outbound is supported

Juha Heinanen jh at tutpro.com
Fri Apr 19 16:37:55 CEST 2013


Module: sip-router
Branch: master
Commit: 7a96d912032939b8eb108e0e84b70bbf0642e2ab
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7a96d912032939b8eb108e0e84b70bbf0642e2ab

Author: Juha Heinanen <jh at tutpro.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date:   Fri Apr 19 17:36:27 2013 +0300

modules/outbound: for non-reg requests, check if outbound is supported

   4.3.  Sending Non-REGISTER Requests
   ...
   UAs that support this specification SHOULD include the outbound
   option tag in a Supported header field in a request that is not a
   REGISTER request.

---

 modules/outbound/ob_mod.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
index 25edf15..5f2a708 100644
--- a/modules/outbound/ob_mod.c
+++ b/modules/outbound/ob_mod.c
@@ -35,6 +35,7 @@
 #include "../../parser/contact/parse_contact.h"
 #include "../../parser/parse_rr.h"
 #include "../../parser/parse_uri.h"
+#include "../../parser/parse_supported.h"
 
 #include "api.h"
 #include "config.h"
@@ -323,6 +324,14 @@ static int use_outbound_non_reg(struct sip_msg *msg)
 	int ret;
 	struct receive_info *rcv = NULL;
 
+	/* Check if Supported: outbound is included */
+	if (parse_supported(msg) == 0) {
+                if (!(get_supported(msg) & F_OPTION_TAG_OUTBOUND)) {
+		        LM_INFO("outbound is not supported and thus not used\n");
+		        return 0;
+		}
+	}
+
 	/* Check to see if the top Route-URI is me and has a ;ob parameter */
 	if (msg->route
 		|| (parse_headers(msg, HDR_ROUTE_F, 0) != -1 && msg->route))




More information about the sr-dev mailing list