Module: kamailio Branch: master Commit: 88173da2b684a3a3f86ee01ac5de401f492ff240 URL: https://github.com/kamailio/kamailio/commit/88173da2b684a3a3f86ee01ac5de401f...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2014-12-23T00:51:45+01:00
siptrace: use the method from cseq header for tm replies
- the hook in transaction structure is invalid for cancel replies, because the transaction structure is built for invite - reported by Klaus Darilion, FS#489
---
Modified: modules/siptrace/siptrace.c
---
Diff: https://github.com/kamailio/kamailio/commit/88173da2b684a3a3f86ee01ac5de401f... Patch: https://github.com/kamailio/kamailio/commit/88173da2b684a3a3f86ee01ac5de401f...
---
diff --git a/modules/siptrace/siptrace.c b/modules/siptrace/siptrace.c index aad69a0..0ccef7d 100644 --- a/modules/siptrace/siptrace.c +++ b/modules/siptrace/siptrace.c @@ -533,6 +533,13 @@ static int sip_trace_prepare(sip_msg_t *msg) goto error; }
+ if(msg->cseq==NULL && ((parse_headers(msg, HDR_CSEQ_F, 0)==-1) + || (msg->cseq==NULL))) + { + LM_ERR("cannot parse cseq\n"); + goto error; + } + return 0; error: return -1; @@ -1249,7 +1256,7 @@ static void trace_onreply_in(struct cell* t, int type, struct tmcb_params *ps)
sto.callid = msg->callid->body;
- sto.method = t->method; + sto.method = get_cseq(msg)->method;
strcpy(statusbuf, int2str(ps->code, &sto.status.len)); sto.status.s = statusbuf; @@ -1349,7 +1356,7 @@ static void trace_onreply_out(struct cell* t, int type, struct tmcb_params *ps) }
sto.callid = msg->callid->body; - sto.method = t->method; + sto.method = get_cseq(msg)->method;
if(trace_local_ip.s && trace_local_ip.len > 0) { sto.fromip = trace_local_ip;