Module: sip-router
Branch: master
Commit: ae232eca582e48f93b5a7145b52b12ce484b47ad
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ae232ec…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Sun Mar 15 21:17:30 2009 +0100
Kamailio compatibility: Parse and store integer message id in cseq.
This patch modifies the CSeq header field parser. The new version of
the parser will also parse the method string and store an integer id
of the method string in the data structure representing cseq header
fields.
---
parser/parse_cseq.c | 7 +++++++
parser/parse_cseq.h | 1 +
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/parser/parse_cseq.c b/parser/parse_cseq.c
index e3c1656..23dbf42 100644
--- a/parser/parse_cseq.c
+++ b/parser/parse_cseq.c
@@ -36,6 +36,7 @@
#include "parser_f.h" /* eat_space_end and so on */
#include "../dprint.h"
#include "parse_def.h"
+#include "parse_methods.h"
#include "../mem/mem.h"
/*
@@ -72,6 +73,12 @@ char* parse_cseq(char *buf, char* end, struct cseq_body* cb)
t=m_end;
cb->method.len=t-cb->method.s;
+ /* Cache method id */
+ if (parse_method(&cb->method, &cb->method_id) == 0) {
+ LOG(L_ERR, "ERROR: parse_cseq: Cannot parse method string\n");
+ goto error;
+ }
+
/* there may be trailing LWS
* (it was not my idea to put it in SIP; -jiri )
*/
diff --git a/parser/parse_cseq.h b/parser/parse_cseq.h
index 2b1794e..4779e11 100644
--- a/parser/parse_cseq.h
+++ b/parser/parse_cseq.h
@@ -36,6 +36,7 @@ struct cseq_body{
int error; /* Error code */
str number; /* CSeq number */
str method; /* Associated method */
+ unsigned int method_id; /* Associated method ID */
};