Module: sems
Branch: rco/forking
Commit: 317d6e59e9d85e79f450b348cd30ad4770532345
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=317d6e59e9d85e79f450b348cd30ad4770532345

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 acc4b5b..f8f8c40 100644
--- a/core/AmB2BSession.cpp
+++ b/core/AmB2BSession.cpp
@@ -382,8 +382,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 (!req.body.empty() && t->second.method == SIP_METH_INVITE) {
     // delayed SDP negotiation - save SDP
diff --git a/core/AmSession.cpp b/core/AmSession.cpp
index bdeaab8..7877a8a 100644
--- a/core/AmSession.cpp
+++ b/core/AmSession.cpp
@@ -914,8 +914,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 7963778..dc7febe 100644
--- a/core/AmSipDialog.cpp
+++ b/core/AmSipDialog.cpp
@@ -296,7 +296,7 @@ void AmSipDialog::updateStatus(const AmSipReply& reply)
            hdl->onInvite2xx(reply);
        }
        else {
-           send_200_ack(t);
+           send_200_ack(reply.cseq);
        }
     }
     else {
@@ -691,9 +691,9 @@ int AmSipDialog::sendRequest(const string& method,
   return 0;
 }
 
-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;
@@ -701,9 +701,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);
@@ -717,7 +717,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,
@@ -733,7 +733,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;
 
@@ -748,7 +748,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();
     
@@ -775,7 +775,7 @@ int AmSipDialog::send_200_ack(const AmSipTransaction& t,
   if (SipCtrlInterface::send(req))
     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 86d73f3..6f64516 100644
--- a/core/AmSipDialog.h
+++ b/core/AmSipDialog.h
@@ -196,7 +196,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 = "",
@@ -239,9 +239,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

Reply via email to