Skip to content

Commit

Permalink
siptrace: use the method from cseq header for tm replies
Browse files Browse the repository at this point in the history
- the hook in transaction structure is invalid for cancel replies,
  because the transaction structure is built for invite
- reported by Klaus Darilion, FS#489

(cherry picked from commit 88173da)
(cherry picked from commit 0702109)
  • Loading branch information
miconda committed Jan 15, 2015
1 parent f38a1c6 commit 969d3f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modules/siptrace/siptrace.c
Expand Up @@ -528,6 +528,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;
Expand Down Expand Up @@ -1179,7 +1186,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;
Expand Down Expand Up @@ -1279,7 +1286,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;
Expand Down

0 comments on commit 969d3f1

Please sign in to comment.