Browse code

sbc: b/f: correct fix for nat_handling flag support

The corresponding code in AmBasicSipDialog::onRxRequest() gets executed before SBCCallLeg::onInvite(), so that we have to fix the next-hop here as well.

Raphael Coeffic authored on 09/12/2013 10:09:21 • Stefan Sayer committed on 04/01/2014 22:51:11
Showing 1 changed files
... ...
@@ -888,9 +888,10 @@ int SBCCallProfile::apply_a_routing(ParamReplacerCtx& ctx,
888 888
   }
889 889
   else {
890 890
     dlg.nat_handling = dlg_nat_handling;
891
-    if(dlg_nat_handling) {
892
-      string nh = req.remote_ip;
893
-      nh += ":" + int2str(req.remote_port);
891
+    if(dlg_nat_handling && req.first_hop) {
892
+      string nh = req.remote_ip + ":"
893
+	+ int2str(req.remote_port)
894
+	+ "/" + req.trsp;
894 895
       dlg.setNextHop(nh);
895 896
       dlg.setNextHop1stReq(false);
896 897
     }