Răsfoiți Sursa

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
Daniel-Constantin Mierla 10 ani în urmă
părinte
comite
88173da2b6
1 a modificat fișierele cu 9 adăugiri și 2 ștergeri
  1. 9 2
      modules/siptrace/siptrace.c

+ 9 - 2
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;