Просмотр исходного кода

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.
Jan Janak 16 лет назад
Родитель
Сommit
ae232eca58
2 измененных файлов с 8 добавлено и 0 удалено
  1. 7 0
      parser/parse_cseq.c
  2. 1 0
      parser/parse_cseq.h

+ 7 - 0
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 )
 	 */

+ 1 - 0
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 */
 };