[sr-dev] git:master:c4a57e29: dialog: parse all headers to check if cseq increment is needed

Daniel-Constantin Mierla miconda at gmail.com
Tue Jul 12 17:45:36 CEST 2016


Module: kamailio
Branch: master
Commit: c4a57e29883597869838f48d6a9f3a8a76a94240
URL: https://github.com/kamailio/kamailio/commit/c4a57e29883597869838f48d6a9f3a8a76a94240

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-07-12T17:44:39+02:00

dialog: parse all headers to check if cseq increment is needed

- jump over the full custom header when sending out

---

Modified: modules/dialog/dlg_cseq.c

---

Diff:  https://github.com/kamailio/kamailio/commit/c4a57e29883597869838f48d6a9f3a8a76a94240.diff
Patch: https://github.com/kamailio/kamailio/commit/c4a57e29883597869838f48d6a9f3a8a76a94240.patch

---

diff --git a/modules/dialog/dlg_cseq.c b/modules/dialog/dlg_cseq.c
index 72595a8..b14f67d 100644
--- a/modules/dialog/dlg_cseq.c
+++ b/modules/dialog/dlg_cseq.c
@@ -237,6 +237,7 @@ int dlg_cseq_msg_sent(void *data)
 
 	/* check if transaction is marked for a new increment */
 	if(get_cseq(&msg)->method_id!=METHOD_ACK) {
+		parse_headers(&msg, HDR_EOH_F, 0);
 		hfk = sr_hdr_get_z(&msg, "P-K-Auth-CSeq");
 		if(hfk!=NULL) {
 			LM_DBG("uac auth request - cseq inc needed\n");
@@ -311,9 +312,9 @@ int dlg_cseq_msg_sent(void *data)
 			tbuf_len += hfk->name.s - get_cseq(&msg)->number.s
 					- get_cseq(&msg)->number.len;
 			/* copy from after hfk to the end of sip message */
-			memcpy(tbuf+tbuf_len,  hfk->name.s + hfk->name.len,
-					msg.buf + msg.len - hfk->name.s - hfk->name.len);
-			tbuf_len += msg.buf + msg.len - hfk->name.s - hfk->name.len;
+			memcpy(tbuf+tbuf_len,  hfk->name.s + hfk->len,
+					msg.buf + msg.len - hfk->name.s - hfk->len);
+			tbuf_len += msg.buf + msg.len - hfk->name.s - hfk->len;
 		} else {
 			/* copy from after cseq number to the end of sip message */
 			memcpy(tbuf+tbuf_len, get_cseq(&msg)->number.s+get_cseq(&msg)->number.len,
@@ -350,9 +351,9 @@ int dlg_cseq_msg_sent(void *data)
 			tbuf_len += hfk->name.s - via->branch->value.s
 					- via->branch->value.len;
 			/* copy from after hfk to the end of sip message */
-			memcpy(tbuf+tbuf_len,  hfk->name.s + hfk->name.len,
-					msg.buf + msg.len - hfk->name.s - hfk->name.len);
-			tbuf_len += msg.buf + msg.len - hfk->name.s - hfk->name.len;
+			memcpy(tbuf+tbuf_len,  hfk->name.s + hfk->len,
+					msg.buf + msg.len - hfk->name.s - hfk->len);
+			tbuf_len += msg.buf + msg.len - hfk->name.s - hfk->len;
 		} else {
 			/* copy from after via to the end of sip message */
 			memcpy(tbuf+tbuf_len, via->branch->value.s + via->branch->value.len,




More information about the sr-dev mailing list