diff --git a/apps/conference/Conference.cpp b/apps/conference/Conference.cpp index 89b5c4d9..1e778ebe 100644 --- a/apps/conference/Conference.cpp +++ b/apps/conference/Conference.cpp @@ -840,13 +840,13 @@ void ConferenceDialog::onSipRequest(const AmSipRequest& req) 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=;Transfer-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()); diff --git a/apps/registrar_client/SIPRegistrarClient.cpp b/apps/registrar_client/SIPRegistrarClient.cpp index a787914a..8bce7d0c 100644 --- a/apps/registrar_client/SIPRegistrarClient.cpp +++ b/apps/registrar_client/SIPRegistrarClient.cpp @@ -102,15 +102,16 @@ void SIPRegistration::doRegistration() { 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 @@ void SIPRegistration::doUnregister() { 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"); diff --git a/core/AmSession.cpp b/core/AmSession.cpp index 4fc386de..4dee96af 100644 --- a/core/AmSession.cpp +++ b/core/AmSession.cpp @@ -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() AmSession::~AmSession() { for(vector::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 @@ void AmSession::negotiate(const string& sdp_body, 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) { diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index 0aef8d8d..ac8a34cf 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -104,7 +104,7 @@ void AmSipDialog::updateStatus(const AmSipRequest& req) local_party = req.to; setRoute(req.route); - next_hop = req.next_hop; + //next_hop = req.next_hop; } } @@ -128,11 +128,7 @@ void AmSipDialog::updateStatusFromLocalRequest(const AmSipRequest& req) 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 @@ void AmSipDialog::updateStatus(const AmSipReply& reply, bool do_200_ack) 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 @@ int AmSipDialog::transfer(const string& target) 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 @@ int AmSipDialog::sendRequest(const string& method, 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 @@ int AmSipDialog::send_200_ack(const AmSipTransaction& t, 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()) diff --git a/core/AmSipDialog.h b/core/AmSipDialog.h index bae4ab69..ae7855ee 100644 --- a/core/AmSipDialog.h +++ b/core/AmSipDialog.h @@ -136,7 +136,7 @@ class AmSipDialog 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 diff --git a/core/AmSipMsg.cpp b/core/AmSipMsg.cpp index 9432c3a2..c1e81fd5 100644 --- a/core/AmSipMsg.cpp +++ b/core/AmSipMsg.cpp @@ -138,7 +138,7 @@ string AmSipRequest::print() _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 @@ string AmSipReply::print() _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"); diff --git a/core/AmSipMsg.h b/core/AmSipMsg.h index 5b959db4..7da36ce8 100644 --- a/core/AmSipMsg.h +++ b/core/AmSipMsg.h @@ -11,7 +11,7 @@ class _AmSipMsgInDlg { public: string method; - string next_hop; // URI + //string next_hop; // URI string route; string contact; diff --git a/core/AmUAC.cpp b/core/AmUAC.cpp index c3c4a5a7..a28e838f 100644 --- a/core/AmUAC.cpp +++ b/core/AmUAC.cpp @@ -60,8 +60,8 @@ AmSession* AmUAC::dialout(const string& user, 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); } diff --git a/core/SipCtrlInterface.cpp b/core/SipCtrlInterface.cpp index 1899f343..7fffc50e 100644 --- a/core/SipCtrlInterface.cpp +++ b/core/SipCtrlInterface.cpp @@ -247,23 +247,24 @@ int SipCtrlInterface::send(AmSipRequest &req) 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 @@ void SipCtrlInterface::handle_sip_request(trans_ticket* tt, sip_msg* msg) 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()); }