[sr-dev] git:5.0:749dd5c5: rtpengine: get again body pointer only when read_sdp_pv is set

Daniel-Constantin Mierla miconda at gmail.com
Mon Feb 12 09:00:35 CET 2018


Module: kamailio
Branch: 5.0
Commit: 749dd5c55ed100e9a57ece18e82fab2d1eaaab8e
URL: https://github.com/kamailio/kamailio/commit/749dd5c55ed100e9a57ece18e82fab2d1eaaab8e

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-02-12T09:00:07+01:00

rtpengine: get again body pointer only when read_sdp_pv is set

- reported by GH #1434

(cherry picked from commit 75c4ca0bb69bd4f1ba42c6d964697737813fa81e)
(cherry picked from commit 8794d6d60549683120e22b3b150674e686a29ba0)

---

Modified: src/modules/rtpengine/rtpengine.c

---

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

---

diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index ab1c088d5d..95a4ba4bd1 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -2883,12 +2883,17 @@ rtpengine_offer_answer(struct sip_msg *msg, const char *flags, int op, int more)
 			pkg_free(newbody.s);
 
 		} else {
-			/* get the body from the message as body ptr may have changed */
-			cur_body.len = 0;
-			cur_body.s = get_body(msg);
-			cur_body.len = msg->buf + msg->len - cur_body.s;
-
-			anchor = del_lump(msg, cur_body.s - msg->buf, cur_body.len, 0);
+			if (read_sdp_pvar_str.len > 0) {
+				/* get the body from the message as body ptr may have changed
+				 * when using read_sdp_pv */
+				cur_body.len = 0;
+				cur_body.s = get_body(msg);
+				cur_body.len = msg->buf + msg->len - cur_body.s;
+
+				anchor = del_lump(msg, cur_body.s - msg->buf, cur_body.len, 0);
+			} else {
+				anchor = del_lump(msg, body.s - msg->buf, body.len, 0);
+			}
 			if (!anchor) {
 				LM_ERR("del_lump failed\n");
 				goto error_free;




More information about the sr-dev mailing list