浏览代码

Changed the trace function so that it uses the method in cseq on SIP replies instead of using an empty string.

Marius Bucur 13 年之前
父节点
当前提交
9fedb8564e
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      modules_k/siptrace/siptrace.c

+ 7 - 2
modules_k/siptrace/siptrace.c

@@ -44,6 +44,7 @@
 #include "../../lib/srdb1/db.h"
 #include "../../parser/parse_content.h"
 #include "../../parser/parse_from.h"
+#include "../../parser/parse_cseq.h"
 #include "../../pvar.h"
 #include "../../modules/tm/tm_load.h"
 #include "../../modules/sl/sl.h"
@@ -854,8 +855,12 @@ static int sip_trace(struct sip_msg *msg, char *dir, char *s2)
 	if(msg->first_line.type==SIP_REQUEST) {
 		sto.method = msg->first_line.u.request.method;
 	} else {
-		sto.method.s = "";
-		sto.method.len = 0;
+		if(parse_headers(msg, HDR_CSEQ_F, 0) != 0 || msg->cseq==NULL
+				|| msg->cseq->parsed==NULL) {
+			LM_ERR("cannot parse cseq header\n");
+			return -1;
+		}
+		sto.method = get_cseq(msg)->method;
 	}
 
 	if(msg->first_line.type==SIP_REPLY) {