Module: sems Branch: master Commit: 5ffec5db3325955a806f9148e0312f30f040f23e URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=5ffec5db3325955a806f9148e0312f30f040f23e
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Wed Oct 6 15:58:39 2010 +0200 changed: send_200_ack() now takes cseq instead of AmSipTransaction --- core/AmB2BSession.cpp | 3 +-- core/AmSession.cpp | 4 ++-- core/AmSipDialog.cpp | 18 +++++++++--------- core/AmSipDialog.h | 6 +++--- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp index 0840d52..3832a82 100644 --- a/core/AmB2BSession.cpp +++ b/core/AmB2BSession.cpp @@ -667,8 +667,7 @@ void AmB2BSession::relaySip(const AmSipRequest& req) } DBG("sending relayed ACK\n"); - dlg.send_200_ack(AmSipTransaction(t->second.method, t->first,t->second.tt), - req.content_type, req.body, req.hdrs, SIP_FLAGS_VERBATIM); + dlg.send_200_ack(t->first, req.content_type, req.body, req.hdrs, SIP_FLAGS_VERBATIM); if ((refresh_method != REFRESH_UPDATE) && !req.body.empty() && diff --git a/core/AmSession.cpp b/core/AmSession.cpp index d035225..6aae0aa 100644 --- a/core/AmSession.cpp +++ b/core/AmSession.cpp @@ -989,8 +989,8 @@ void AmSession::onSipReply(const AmSipReply& reply, void AmSession::onInvite2xx(const AmSipReply& reply) { - AmSipTransaction* t = dlg.get_uac_trans(reply.cseq); - if(t) dlg.send_200_ack(*t); + if(dlg.get_uac_trans(reply.cseq)) + dlg.send_200_ack(reply.cseq); } void AmSession::onNoAck(unsigned int cseq) diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index c868f19..a7a61b0 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -392,7 +392,7 @@ void AmSipDialog::updateStatus(const AmSipReply& reply) hdl->onInvite2xx(reply); } else { - send_200_ack(t); + send_200_ack(reply.cseq); } } else { @@ -1052,9 +1052,9 @@ void AmSipDialog::rel100OnRequestOut(const string &method, string &hdrs) } -string AmSipDialog::get_uac_trans_method(unsigned int cseq) +string AmSipDialog::get_uac_trans_method(unsigned int t_cseq) { - TransMap::iterator t = uac_trans.find(cseq); + TransMap::iterator t = uac_trans.find(t_cseq); if (t != uac_trans.end()) return t->second.method; @@ -1062,9 +1062,9 @@ string AmSipDialog::get_uac_trans_method(unsigned int cseq) return ""; } -AmSipTransaction* AmSipDialog::get_uac_trans(unsigned int cseq) +AmSipTransaction* AmSipDialog::get_uac_trans(unsigned int t_cseq) { - TransMap::iterator t = uac_trans.find(cseq); + TransMap::iterator t = uac_trans.find(t_cseq); if (t != uac_trans.end()) return &(t->second); @@ -1078,7 +1078,7 @@ int AmSipDialog::drop() return 1; } -int AmSipDialog::send_200_ack(const AmSipTransaction& t, +int AmSipDialog::send_200_ack(unsigned int inv_cseq, const string& content_type, const string& body, const string& hdrs, @@ -1094,7 +1094,7 @@ int AmSipDialog::send_200_ack(const AmSipTransaction& t, string m_hdrs = hdrs; if(hdl) - hdl->onSendRequest("ACK",content_type,body,m_hdrs,flags,t.cseq); + hdl->onSendRequest("ACK",content_type,body,m_hdrs,flags,inv_cseq); AmSipRequest req; @@ -1109,7 +1109,7 @@ int AmSipDialog::send_200_ack(const AmSipTransaction& t, if(!remote_tag.empty()) req.to += ";tag=" + remote_tag; - req.cseq = t.cseq;// should be the same as the INVITE + req.cseq = inv_cseq;// should be the same as the INVITE req.callid = callid; req.contact = getContactHdr(); @@ -1134,7 +1134,7 @@ int AmSipDialog::send_200_ack(const AmSipTransaction& t, if (SipCtrlInterface::send(req, next_hop_ip, next_hop_port, outbound_interface)) return -1; - uac_trans.erase(t.cseq); + uac_trans.erase(inv_cseq); return 0; } diff --git a/core/AmSipDialog.h b/core/AmSipDialog.h index baceb2c..6870026 100644 --- a/core/AmSipDialog.h +++ b/core/AmSipDialog.h @@ -262,7 +262,7 @@ class AmSipDialog int flags = 0); /** @return 0 on success */ - int send_200_ack(const AmSipTransaction& t, + int send_200_ack(unsigned int inv_cseq, const string& content_type = "", const string& body = "", const string& hdrs = "", @@ -307,9 +307,9 @@ class AmSipDialog /** * @return the method of the corresponding uac request */ - string get_uac_trans_method(unsigned int cseq); + string get_uac_trans_method(unsigned int t_cseq); - AmSipTransaction* get_uac_trans(unsigned int cseq); + AmSipTransaction* get_uac_trans(unsigned int t_cseq); /** * This method should only be used to send responses _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
