kamailio.cfg: set_forward_no_connect() only for initial requests going through nat
authorDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 9 Sep 2019 07:09:49 +0000 (09:09 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 9 Sep 2019 07:09:49 +0000 (09:09 +0200)
etc/kamailio.cfg

index 20871fb..c41b933 100644 (file)
@@ -559,10 +559,6 @@ route[RELAY] {
 route[REQINIT] {
        # no connect for sending replies
        set_reply_no_connect();
-       if(has_totag()) {
-               # no connect for requests within dialog
-               set_forward_no_connect();
-       }
 
 #!ifdef WITH_ANTIFLOOD
        # flood detection from same IP and traffic ban for a while
@@ -834,7 +830,11 @@ route[NATMANAGE] {
 
        if(isbflagset(FLB_NATB)) {
                # no connect message in a dialog involving NAT traversal
-               set_forward_no_connect();
+               if (is_request()) {
+                       if(has_totag()) {
+                               set_forward_no_connect();
+                       }
+               }
        }
 #!endif
        return;