Module: sip-router
Branch: master
Commit: 9fedb8564e2eb50553a3bcae66976620316698c4
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9fedb85…
Author: Marius Bucur <marius.bucur(a)1and1.ro>
Committer: Marius Bucur <marius.bucur(a)1and1.ro>
Date: Fri Feb 24 17:51:42 2012 +0200
Changed the trace function so that it uses the method in cseq on SIP replies instead of
using an empty string.
---
modules_k/siptrace/siptrace.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/modules_k/siptrace/siptrace.c b/modules_k/siptrace/siptrace.c
index 2c2dc01..b8df1e6 100644
--- a/modules_k/siptrace/siptrace.c
+++ b/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) {