Browse code

Revert "b/f:core:dlg: reevaluate nat_handling flag after onSipRequest/onInvite"

This reverts commit 821e63a2e9be5c5e1ae81cd183199291b158bee2.

Raphael Coeffic authored on 09/12/2013 10:06:45 • Stefan Sayer committed on 10/12/2013 14:25:00
Showing 1 changed files
... ...
@@ -313,31 +313,25 @@ void AmBasicSipDialog::onRxRequest(const AmSipRequest& req)
313 313
     return;
314 314
     
315 315
   uas_trans[req.cseq] = req;
316
-
317
-  string nh = req.remote_ip + ":"
318
-    + int2str(req.remote_port)
319
-    + "/" + req.trsp;
320
-
321
-  bool target_refresh_req =
322
-    req.from_uri.length() && 
323
-    (remote_uri.empty() ||
324
-     (req.method == SIP_METH_INVITE || 
325
-      req.method == SIP_METH_UPDATE ||
326
-      req.method == SIP_METH_SUBSCRIBE ||
327
-      req.method == SIP_METH_NOTIFY));
328
-
316
+    
329 317
   // target refresh requests
330
-  if (target_refresh_req) {
318
+  if (req.from_uri.length() && 
319
+      (remote_uri.empty() ||
320
+       (req.method == SIP_METH_INVITE || 
321
+	req.method == SIP_METH_UPDATE ||
322
+	req.method == SIP_METH_SUBSCRIBE ||
323
+	req.method == SIP_METH_NOTIFY))) {
331 324
     
332 325
     // refresh the target
333 326
     if (remote_uri != req.from_uri) {
334 327
       setRemoteUri(req.from_uri);
335
-    }
336
-
337
-    if(nat_handling && req.first_hop) {
338
-      DBG("nat_handling: setting next_hop to received '%s'\n", nh.c_str());
339
-      setNextHop(nh);
340
-      setNextHop1stReq(false);
328
+      if(nat_handling && req.first_hop) {
329
+	string nh = req.remote_ip + ":"
330
+	  + int2str(req.remote_port)
331
+	  + "/" + req.trsp;
332
+	setNextHop(nh);
333
+	setNextHop1stReq(false);
334
+      }
341 335
     }
342 336
 
343 337
     string ua = getHeader(req.hdrs,"User-Agent");
... ...
@@ -362,14 +356,6 @@ void AmBasicSipDialog::onRxRequest(const AmSipRequest& req)
362 356
 
363 357
   if(onRxReqStatus(req) && hdl)
364 358
     hdl->onSipRequest(req);
365
-
366
-  // reevaluate nat_handling next hop - may have changed in onSipRequest
367
-  if(target_refresh_req && nat_handling && req.first_hop) {
368
-    DBG("nat_handling: setting next_hop to received '%s'\n", nh.c_str());
369
-    setNextHop(nh);
370
-    setNextHop1stReq(false);
371
-  }
372
-
373 359
 }
374 360
 
375 361
 bool AmBasicSipDialog::onRxReplyStatus(const AmSipReply& reply,