Browse code

Merge pull request #2666 from mojtabaesfandiari/master

lrkproxy-fixed issue#2663

mojtabaesfandiari authored on 10/03/2021 10:58:02 • GitHub committed on 10/03/2021 10:58:02
Showing 1 changed files
... ...
@@ -1224,18 +1224,21 @@ static int change_media_sdp(sip_msg_t *msg, struct lrkproxy_hash_entry *e, const
1224 1224
     start_sdp_c = strstr(off, "c=IN IP4");
1225 1225
     start_sdp_m = strstr(off, "m=audio");
1226 1226
 
1227
-    //if enabled then set direction,
1228
-    if (e->node->lrkp_n_c->internal_ip && flags) {
1227
+    //The external_ip should be set in config file for relaying RTP media between NIC.
1228
+//    if (e->node->lrkp_n_c->external_ip && flags) {
1229
+    if(flags) {
1229 1230
         if (strstr(flags, "ei")) {
1230 1231
             ip_selected = e->node->lrkp_n_c->internal_ip;// lrk_node->internal_ip;
1231 1232
         } else if (strstr(flags, "ie")) {
1232 1233
             ip_selected = e->node->lrkp_n_c->external_ip; //lrk_node->external_ip;
1233 1234
         } else {
1234
-                    LM_INFO("no flags found\n");
1235
-            return 0;
1235
+            LM_INFO("unknown flags, use internal_ip\n");
1236
+            ip_selected = e->node->lrkp_n_c->internal_ip;
1236 1237
         }
1237
-    } else {
1238
-        ip_selected = e->node->lrkp_n_c->external_ip; //lrk_node->external_ip;
1238
+    }
1239
+    else {
1240
+        LM_INFO("no flags set, use internal_ip\n");
1241
+        ip_selected = e->node->lrkp_n_c->internal_ip;
1239 1242
     }
1240 1243
 
1241 1244
     if (op == OP_OFFER) {