[sr-dev] git:5.3:855acfc6: rtpproxy: do nothing in rtpproxy_manage() when used in event_route[tm:branch-failure:...]

Daniel-Constantin Mierla miconda at gmail.com
Tue Feb 25 08:42:22 CET 2020


Module: kamailio
Branch: 5.3
Commit: 855acfc670bc814a9d42c5c2a6fdfc19bb93e99a
URL: https://github.com/kamailio/kamailio/commit/855acfc670bc814a9d42c5c2a6fdfc19bb93e99a

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-02-25T08:39:35+01:00

rtpproxy: do nothing in rtpproxy_manage() when used in event_route[tm:branch-failure:...]

- avoid duplicating sdp operations

(cherry picked from commit 4305c501128a0d37453a39795bd00314d7f60e4f)

---

Modified: src/modules/rtpproxy/rtpproxy.c

---

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

---

diff --git a/src/modules/rtpproxy/rtpproxy.c b/src/modules/rtpproxy/rtpproxy.c
index 972c6b1148..8aef20019f 100644
--- a/src/modules/rtpproxy/rtpproxy.c
+++ b/src/modules/rtpproxy/rtpproxy.c
@@ -1814,9 +1814,14 @@ rtpproxy_manage(struct sip_msg *msg, char *flags, char *ip)
 	int method;
 	int nosdp;
 
+	if(route_type==BRANCH_FAILURE_ROUTE) {
+		/* do nothing in branch failure event route
+		 * - delete done on transaction failure route */
+		return 1;
+	}
+
 	if(msg->cseq==NULL && ((parse_headers(msg, HDR_CSEQ_F, 0)==-1)
-				|| (msg->cseq==NULL)))
-	{
+				|| (msg->cseq==NULL))) {
 		LM_ERR("no CSEQ header\n");
 		return -1;
 	}
@@ -1831,8 +1836,7 @@ rtpproxy_manage(struct sip_msg *msg, char *flags, char *ip)
 	if(method==METHOD_CANCEL || method==METHOD_BYE)
 		return unforce_rtp_proxy(msg, flags);
 
-	if(ip==NULL)
-	{
+	if(ip==NULL) {
 		cp = ip_addr2a(&msg->rcv.dst_ip);
 		strcpy(newip, cp);
 	}




More information about the sr-dev mailing list