[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sr-dev
Subject:    [sr-dev] git:master:73dbed5c: dialog: proper refresh of cseq for requests withing dialog after an in
From:       Daniel-Constantin Mierla <miconda () gmail ! com>
Date:       2016-08-30 15:32:21
Message-ID: E1bel1R-0000YQ-AH () www ! kamailio ! org
[Download RAW message or body]

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

Author: Daniel-Constantin Mierla <miconda@gmail.com>
Committer: Daniel-Constantin Mierla <miconda@gmail.com>
Date: 2016-08-30T17:31:17+02:00

dialog: proper refresh of cseq for requests withing dialog after an increment

- reported by GH #752

---

Modified: modules/dialog/dlg_cseq.c

---

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

---

diff --git a/modules/dialog/dlg_cseq.c b/modules/dialog/dlg_cseq.c
index b74cb4e..7c95ce0 100644
--- a/modules/dialog/dlg_cseq.c
+++ b/modules/dialog/dlg_cseq.c
@@ -193,6 +193,8 @@ int dlg_cseq_update(sip_msg_t *msg)
 int dlg_cseq_refresh(sip_msg_t *msg, dlg_cell_t *dlg,
 		unsigned int direction)
 {
+	unsigned int ninc = 0;
+	unsigned int vinc = 0;
 	str nval;
 	str *pval;
 
@@ -225,7 +227,19 @@ int dlg_cseq_refresh(sip_msg_t *msg, dlg_cell_t *dlg,
 		goto done;
 	}
 
-	nval = *pval;
+	if(str2int(pval, &vinc)<0) {
+		LM_ERR("invalid dlg cseq diff var value: %.*s\n",
+					pval->len, pval->s);
+		goto done;
+	}
+	if(vinc==0) {
+		LM_DBG("nothing to increment\n");
+		goto done;
+	}
+
+	str2int(&get_cseq(msg)->number, &ninc);
+	vinc += ninc;
+	nval.s = int2str(vinc, &nval.len);
 	trim(&nval);
 
 	LM_DBG("adding cseq refresh header value: %.*s\n", nval.len, nval.s);


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic