Module: sip-router
Branch: master
Commit: 41e57ff7c446ec60939d6ea25c33e9d80be068c6
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=41e57ff…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Apr 16 23:42:39 2012 +0200
kcore: added outbound tag to Supported hdr parser
---
lib/kcore/parse_supported.c | 7 +++++++
lib/kcore/parse_supported.h | 5 +++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/lib/kcore/parse_supported.c b/lib/kcore/parse_supported.c
index c30225a..eb90290 100644
--- a/lib/kcore/parse_supported.c
+++ b/lib/kcore/parse_supported.c
@@ -108,6 +108,13 @@ static inline int parse_supported_body(str *body, unsigned int *sup)
*sup |= F_SUPPORTED_GRUU;
pos += SUPPORTED_GRUU_LEN + 1;
p += SUPPORTED_GRUU_LEN + 1;
+ } else if(pos+SUPPORTED_OUTBOUND_LEN<=len
+ && strncasecmp(p, SUPPORTED_OUTBOUND_STR,
+ SUPPORTED_OUTBOUND_LEN)==0
+ && IS_DELIM(p+SUPPORTED_OUTBOUND_LEN)) {
+ *sup |= F_SUPPORTED_OUTBOUND;
+ pos += SUPPORTED_OUTBOUND_LEN + 1;
+ p += SUPPORTED_OUTBOUND_LEN + 1;
} else {
/* skip element */
for (; pos < len && !IS_DELIM(p); ++pos, ++p);
diff --git a/lib/kcore/parse_supported.h b/lib/kcore/parse_supported.h
index f479eb5..2a37073 100644
--- a/lib/kcore/parse_supported.h
+++ b/lib/kcore/parse_supported.h
@@ -45,6 +45,7 @@
#define F_SUPPORTED_TIMER (1 << 2)
#define F_SUPPORTED_EVENTLIST (1 << 3)
#define F_SUPPORTED_GRUU (1 << 4)
+#define F_SUPPORTED_OUTBOUND (1 << 5)
#define SUPPORTED_PATH_STR "path"
#define SUPPORTED_PATH_LEN (sizeof(SUPPORTED_PATH_STR)-1)
@@ -65,6 +66,10 @@
#define SUPPORTED_GRUU_STR "gruu"
#define SUPPORTED_GRUU_LEN (sizeof(SUPPORTED_GRUU_STR)-1)
+/* RFC 5626 */
+#define SUPPORTED_OUTBOUND_STR "outbound"
+#define SUPPORTED_OUTBOUND_LEN (sizeof(SUPPORTED_OUTBOUND_STR)-1)
+
#define get_supported(p_msg) \
((p_msg)->supported ? ((struct
supported_body*)(p_msg)->supported->parsed)->supported_all : 0)