Author: rco
Date: 2010-04-20 12:51:36 +0200 (Tue, 20 Apr 2010)
New Revision: 1811

Modified:
   trunk/apps/conference/Conference.cpp
   trunk/apps/registrar_client/SIPRegistrarClient.cpp
   trunk/core/AmSession.cpp
   trunk/core/AmSipDialog.cpp
   trunk/core/AmSipDialog.h
   trunk/core/AmSipMsg.cpp
   trunk/core/AmSipMsg.h
   trunk/core/AmUAC.cpp
   trunk/core/SipCtrlInterface.cpp
Log:
- removed sticky "next_hop".
- if an outbound proxy is necessary, it should be set in the configuration 
parameters.


Modified: trunk/apps/conference/Conference.cpp
===================================================================
--- trunk/apps/conference/Conference.cpp        2010-04-19 12:11:58 UTC (rev 
1810)
+++ trunk/apps/conference/Conference.cpp        2010-04-20 10:51:36 UTC (rev 
1811)
@@ -840,13 +840,13 @@
   string iptel_app_param = getHeader(req.hdrs, PARAM_HDR);
   if (iptel_app_param.length()) {
     dlg.setRoute(get_header_keyvalue(iptel_app_param,"Transfer-RR"));
-    dlg.next_hop = get_header_keyvalue(iptel_app_param,"Transfer-NH");
+    //dlg.next_hop = get_header_keyvalue(iptel_app_param,"Transfer-NH");
   } else {
     INFO("Use of P-Transfer-RR/P-Transfer-NH is deprecated. "
         "Use '%s: Transfer-RR=<rr>;Transfer-NH=<nh>' instead.\n",PARAM_HDR);
 
     dlg.setRoute(getHeader(req.hdrs,"P-Transfer-RR"));
-    dlg.next_hop = getHeader(req.hdrs,"P-Transfer-NH");
+    //dlg.next_hop = getHeader(req.hdrs,"P-Transfer-NH");
   }
 
   DBG("ConferenceDialog::onSipRequest: local_party = 
%s\n",dlg.local_party.c_str());

Modified: trunk/apps/registrar_client/SIPRegistrarClient.cpp
===================================================================
--- trunk/apps/registrar_client/SIPRegistrarClient.cpp  2010-04-19 12:11:58 UTC 
(rev 1810)
+++ trunk/apps/registrar_client/SIPRegistrarClient.cpp  2010-04-20 10:51:36 UTC 
(rev 1811)
@@ -102,15 +102,16 @@
   dlg.remote_tag = "";
   req.r_uri    = "sip:"+info.domain;
   dlg.remote_uri = req.r_uri;
+
   // set outbound proxy as next hop 
-  DBG("proxy is '%s' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
-      info.proxy.c_str());
-  if (!info.proxy.empty()) {
-    dlg.next_hop = info.proxy;
-  } else if (!AmConfig::OutboundProxy.empty()) 
-    dlg.next_hop = AmConfig::OutboundProxy;
-  else 
-    dlg.next_hop = "";
+//   DBG("proxy is '%s' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
+//       info.proxy.c_str());
+//   if (!info.proxy.empty()) {
+//     dlg.next_hop = info.proxy;
+//   } else if (!AmConfig::OutboundProxy.empty()) 
+//     dlg.next_hop = AmConfig::OutboundProxy;
+//   else 
+//     dlg.next_hop = "";
   
   dlg.sendRequest(req.method, "", "", "Expires: 1000\n");
 
@@ -128,12 +129,12 @@
   dlg.remote_uri = req.r_uri;
 
   // set outbound proxy as next hop 
-  if (!info.proxy.empty()) {
-    dlg.next_hop = info.proxy;
-  } else if (!AmConfig::OutboundProxy.empty()) 
-    dlg.next_hop = AmConfig::OutboundProxy;
-  else 
-    dlg.next_hop = "";
+//   if (!info.proxy.empty()) {
+//     dlg.next_hop = info.proxy;
+//   } else if (!AmConfig::OutboundProxy.empty()) 
+//     dlg.next_hop = AmConfig::OutboundProxy;
+//   else 
+//     dlg.next_hop = "";
 
   dlg.sendRequest(req.method, "", "", "Expires: 0\n");
 

Modified: trunk/core/AmSession.cpp
===================================================================
--- trunk/core/AmSession.cpp    2010-04-19 12:11:58 UTC (rev 1810)
+++ trunk/core/AmSession.cpp    2010-04-20 10:51:36 UTC (rev 1811)
@@ -25,7 +25,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-//#include "AmServer.h"
 #include "AmSession.h"
 #include "AmSdp.h"
 #include "AmConfig.h"
@@ -82,9 +81,11 @@
 AmSession::~AmSession()
 {
   for(vector<AmSessionEventHandler*>::iterator evh = ev_handlers.begin();
-      evh != ev_handlers.end(); evh++)
+      evh != ev_handlers.end(); evh++) {
+    
     if((*evh)->destroy)
       delete *evh;
+  }
 
 #ifdef WITH_ZRTP
   AmZRTP::freeSession(zrtp_session);
@@ -251,18 +252,6 @@
   if (m_payloads.size() == 0)
     throw AmSession::Exception(488,"could not find compatible payload");
     
-/*
-  if(payload.int_pt == -1){
-
-    payload = *tmp_pl;
-    DBG("new payload: %i\n",payload.int_pt);
-  }
-  else if(payload.int_pt != tmp_pl->int_pt){
-    DBG("old payload: %i; new payload: %i\n",payload.int_pt,tmp_pl->int_pt);
-    throw AmSession::Exception(400,"do not accept payload changes");
-  }
-*/
-
   const SdpPayload *telephone_event_payload = sdp.telephoneEventPayload();
   if(telephone_event_payload)
     {

Modified: trunk/core/AmSipDialog.cpp
===================================================================
--- trunk/core/AmSipDialog.cpp  2010-04-19 12:11:58 UTC (rev 1810)
+++ trunk/core/AmSipDialog.cpp  2010-04-20 10:51:36 UTC (rev 1811)
@@ -104,7 +104,7 @@
     local_party  = req.to;
 
     setRoute(req.route);
-    next_hop   = req.next_hop;
+    //next_hop   = req.next_hop;
   }
 }
 
@@ -128,11 +128,7 @@
     remote_party = req.to;
     local_party  = req.from;
 
-    //         sip_ip       = AmConfig::req.dstip;
-    //         sip_port     = req.port;
-
-    //         setRoute(req.route);
-    next_hop   = req.next_hop;
+    //next_hop   = req.next_hop;
   }
 }
 
@@ -223,7 +219,7 @@
     if(!reply.route.empty())
       setRoute(reply.route);
 
-    next_hop = reply.next_hop;
+    //next_hop = reply.next_hop;
   }
 
   if (reply.next_request_uri.length())
@@ -510,16 +506,9 @@
        r_set += "," + *it;
                        
       r_set += "\"";
+      hdrs = PARAM_HDR ": " + r_set;
     }
                                
-    if (!(next_hop.empty() && route.empty())) {
-      hdrs = PARAM_HDR ": ";
-      if (!next_hop.empty()) 
-       hdrs+="Transfer-NH=\"" + next_hop +"\";";
-                 
-      if (!r_set.empty()) 
-       hdrs+=r_set;
-    }
     int ret = tmp_d.sendRequest("REFER","","",hdrs);
     if(!ret){
       uac_trans.insert(tmp_d.uac_trans.begin(),
@@ -577,7 +566,7 @@
 
   req.method = method;
   req.r_uri = remote_uri;
-  req.next_hop = next_hop;
+  //req.next_hop = next_hop;
 
   req.from = SIP_HDR_COLSP(SIP_HDR_FROM) + local_party;
   if(!local_tag.empty())
@@ -706,7 +695,7 @@
 
   req.method = "ACK";
   req.r_uri = remote_uri;
-  req.next_hop = next_hop;
+  //req.next_hop = next_hop;
 
   req.from = SIP_HDR_COLSP(SIP_HDR_FROM) + local_party;
   if(!local_tag.empty())

Modified: trunk/core/AmSipDialog.h
===================================================================
--- trunk/core/AmSipDialog.h    2010-04-19 12:11:58 UTC (rev 1810)
+++ trunk/core/AmSipDialog.h    2010-04-20 10:51:36 UTC (rev 1811)
@@ -136,7 +136,7 @@
   string getRoute(); // record routing
   void   setRoute(const string& n_route);
 
-  string next_hop;     // next_hop for t_uac_dlg
+  //string next_hop;     // next_hop for t_uac_dlg
 
   int cseq;            // CSeq for next request
 

Modified: trunk/core/AmSipMsg.cpp
===================================================================
--- trunk/core/AmSipMsg.cpp     2010-04-19 12:11:58 UTC (rev 1810)
+++ trunk/core/AmSipMsg.cpp     2010-04-20 10:51:36 UTC (rev 1811)
@@ -138,7 +138,7 @@
   _PM(int2str(cseq), "cseq");
   _PM(from_tag, "l-tag");
   _PM(to_tag, "r-tag");
-  _PM(next_hop, "nhop");
+  //_PM(next_hop, "nhop");
   _PMB(route, "rtset");
   _PM(contact, "m");
 
@@ -171,7 +171,7 @@
   _PM(method, "cseq meth");
   _PM(local_tag, "l-tag");
   _PM(remote_tag, "r-tag");
-  _PM(next_hop, "nhop");
+  //_PM(next_hop, "nhop");
   _PMB(route, "rtset");
   _PM(contact, "m");
 

Modified: trunk/core/AmSipMsg.h
===================================================================
--- trunk/core/AmSipMsg.h       2010-04-19 12:11:58 UTC (rev 1810)
+++ trunk/core/AmSipMsg.h       2010-04-20 10:51:36 UTC (rev 1811)
@@ -11,7 +11,7 @@
 {
   public:
     string       method;
-    string       next_hop; // URI
+    //string       next_hop; // URI
     string       route;
 
     string       contact;

Modified: trunk/core/AmUAC.cpp
===================================================================
--- trunk/core/AmUAC.cpp        2010-04-19 12:11:58 UTC (rev 1810)
+++ trunk/core/AmUAC.cpp        2010-04-20 10:51:36 UTC (rev 1811)
@@ -60,8 +60,8 @@
   req.hdrs     = hdrs;
     
   // set outbound proxy as next hop 
-  if (!AmConfig::OutboundProxy.empty()) 
-    req.next_hop = AmConfig::OutboundProxy;
+  //if (!AmConfig::OutboundProxy.empty()) 
+  //  req.next_hop = AmConfig::OutboundProxy;
 
   return AmSessionContainer::instance()->startSessionUAC(req, session_params);
 }

Modified: trunk/core/SipCtrlInterface.cpp
===================================================================
--- trunk/core/SipCtrlInterface.cpp     2010-04-19 12:11:58 UTC (rev 1810)
+++ trunk/core/SipCtrlInterface.cpp     2010-04-20 10:51:36 UTC (rev 1811)
@@ -247,23 +247,24 @@
     string next_hop;
     unsigned int next_port_i = 0;
 
-    if(!req.next_hop.empty()){
-       string next_port;
-       sip_uri parsed_uri;
-       if (parse_uri(&parsed_uri, (char *)req.next_hop.c_str(),
-                     req.next_hop.length()) < 0) {
-           ERROR("invalid next hop URI '%s'\n", req.next_hop.c_str());
-           ERROR("Using default outbound proxy");
-           next_hop = SipCtrlInterface::outbound_host;
-           next_port_i = SipCtrlInterface::outbound_port;
-       } else {
-           next_hop = c2stlstr(parsed_uri.host);
-           if (parsed_uri.port) {
-               next_port_i= parsed_uri.port;       }
-           next_hop += *(c++);
-       }
-    }
-    else if(!SipCtrlInterface::outbound_host.empty()){
+//     if(!req.next_hop.empty()){
+//     string next_port;
+//     sip_uri parsed_uri;
+//     if (parse_uri(&parsed_uri, (char *)req.next_hop.c_str(),
+//                   req.next_hop.length()) < 0) {
+//         ERROR("invalid next hop URI '%s'\n", req.next_hop.c_str());
+//         ERROR("Using default outbound proxy");
+//         next_hop = SipCtrlInterface::outbound_host;
+//         next_port_i = SipCtrlInterface::outbound_port;
+//     } else {
+//         next_hop = c2stlstr(parsed_uri.host);
+//         if (parsed_uri.port) {
+//             next_port_i= parsed_uri.port;       }
+//         next_hop += *(c++);
+//     }
+//     }
+//    else 
+    if(!SipCtrlInterface::outbound_host.empty()){
        next_hop = SipCtrlInterface::outbound_host;
        next_port_i = SipCtrlInterface::outbound_port;
     }
@@ -470,7 +471,7 @@
        DBG_PARAM(req.to_tag);
        DBG("cseq = <%i>\n",req.cseq);
        DBG_PARAM(req.route);
-       DBG_PARAM(req.next_hop);
+       //DBG_PARAM(req.next_hop);
        DBG("hdrs = <%s>\n",req.hdrs.c_str());
        DBG("body = <%s>\n",req.body.c_str());
     }

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to