Module: sems
Branch: master
Commit: 836bda4e7b30f71af9e810043695391d24fe270c
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=836bda4e7b30f71af9e810043695391d24fe270c

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Sat May 21 14:39:26 2011 +0200

b/f: translate cseq in replies to the INV request sent by connectCallee().

---

 core/AmB2BSession.cpp |   15 ++++++++++++---
 core/AmB2BSession.h   |    1 +
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp
index 51e81b8..19fdd11 100644
--- a/core/AmB2BSession.cpp
+++ b/core/AmB2BSession.cpp
@@ -44,7 +44,7 @@ AmB2BSession::AmB2BSession()
     rtp_relay_enabled(false),
     rtp_relay_force_symmetric_rtp(false),
     relay_rtp_streams(NULL), relay_rtp_streams_cnt(0),
-    est_invite_cseq(0)
+    est_invite_cseq(0),est_invite_other_cseq(0)
 {
   for (unsigned int i=0; i<MAX_RELAY_STREAMS; i++)
     other_stream_fds[i] = 0;
@@ -56,7 +56,7 @@ AmB2BSession::AmB2BSession(const string& other_local_tag)
     rtp_relay_enabled(false),
     rtp_relay_force_symmetric_rtp(false),
     relay_rtp_streams(NULL), relay_rtp_streams_cnt(0),
-    est_invite_cseq(0)
+    est_invite_cseq(0),est_invite_other_cseq(0)
 {
   for (unsigned int i=0; i<MAX_RELAY_STREAMS; i++)
     other_stream_fds[i] = 0;
@@ -444,7 +444,15 @@ void AmB2BSession::onSipReply(const AmSipReply& reply,
     }
   } else {
     AmSession::onSipReply(reply, old_dlg_status, trans_method);
-    relayEvent(new B2BSipReplyEvent(reply, false, trans_method));
+
+    AmSipReply n_reply = reply;
+    if(est_invite_cseq == reply.cseq){
+      n_reply.cseq = est_invite_other_cseq;
+    }
+    else {
+      // the reply here will not have the proper cseq for the other side.
+    }
+    relayEvent(new B2BSipReplyEvent(n_reply, false, trans_method));
   }
 }
 
@@ -1162,6 +1170,7 @@ void AmB2BCalleeSession::onB2BEvent(B2BEvent* ev)
 
     // save CSeq of establising INVITE
     est_invite_cseq = dlg.cseq - 1;
+    est_invite_other_cseq = co_ev->r_cseq;
 
     return;
   }    
diff --git a/core/AmB2BSession.h b/core/AmB2BSession.h
index 5c1af46..35ac228 100644
--- a/core/AmB2BSession.h
+++ b/core/AmB2BSession.h
@@ -144,6 +144,7 @@ class AmB2BSession: public AmSession
 
   /** CSeq of the INVITE that established this call */
   unsigned int est_invite_cseq;
+  unsigned int est_invite_other_cseq;
   auto_ptr<AmSdp> invite_sdp;
 
   /** content-type of established session */

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

Reply via email to