[sr-dev] git:master:e35f0fe5: lrkproxy:fix flags condition in change_media_sdp function

mojtaba mespio at gmail.com
Wed Mar 10 13:01:21 CET 2021


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

Author: mojtaba <mespio at gmail.com>
Committer: mojtaba <mespio at gmail.com>
Date: 2021-03-10T15:30:30+03:30

lrkproxy:fix flags condition in change_media_sdp function

---

Modified: src/modules/lrkproxy/lrkproxy.c

---

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

---

diff --git a/src/modules/lrkproxy/lrkproxy.c b/src/modules/lrkproxy/lrkproxy.c
index 2c0405c8a5..1ef69bb9ac 100644
--- a/src/modules/lrkproxy/lrkproxy.c
+++ b/src/modules/lrkproxy/lrkproxy.c
@@ -1224,18 +1224,21 @@ static int change_media_sdp(sip_msg_t *msg, struct lrkproxy_hash_entry *e, const
     start_sdp_c = strstr(off, "c=IN IP4");
     start_sdp_m = strstr(off, "m=audio");
 
-    //if enabled then set direction,
-    if (e->node->lrkp_n_c->internal_ip && flags) {
+    //The external_ip should be set in config file for relaying RTP media between NIC.
+//    if (e->node->lrkp_n_c->external_ip && flags) {
+    if(flags) {
         if (strstr(flags, "ei")) {
             ip_selected = e->node->lrkp_n_c->internal_ip;// lrk_node->internal_ip;
         } else if (strstr(flags, "ie")) {
             ip_selected = e->node->lrkp_n_c->external_ip; //lrk_node->external_ip;
         } else {
-                    LM_INFO("no flags found\n");
-            return 0;
+            LM_INFO("unknown flags, use internal_ip\n");
+            ip_selected = e->node->lrkp_n_c->internal_ip;
         }
-    } else {
-        ip_selected = e->node->lrkp_n_c->external_ip; //lrk_node->external_ip;
+    }
+    else {
+        LM_INFO("no flags set, use internal_ip\n");
+        ip_selected = e->node->lrkp_n_c->internal_ip;
     }
 
     if (op == OP_OFFER) {




More information about the sr-dev mailing list