Author: sayer
Date: 2009-03-03 09:19:43 +0100 (Tue, 03 Mar 2009)
New Revision: 1288

Modified:
   trunk/core/AmB2BSession.cpp
Log:
fixes bug introduced with r1273: connectCallee does not re-invite caller
(compared cseq of the wrong leg's INVITE)



Modified: trunk/core/AmB2BSession.cpp
===================================================================
--- trunk/core/AmB2BSession.cpp 2009-02-18 16:42:39 UTC (rev 1287)
+++ trunk/core/AmB2BSession.cpp 2009-03-03 08:19:43 UTC (rev 1288)
@@ -172,9 +172,7 @@
 
     if(reply.code >= 200)
       relayed_req.erase(t);
-  }
-  else {
-
+  } else {
     AmSession::onSipReply(reply);
     relayEvent(new B2BSipReplyEvent(reply,false));
   }
@@ -227,10 +225,9 @@
 
 void AmB2BSession::relaySip(const AmSipRequest& orig, const AmSipReply& reply)
 {
-    //string content_type = getHeader(reply.hdrs,"Content-Type");
-    dlg.reply(orig,reply.code,reply.reason,
-             reply.content_type,
-             reply.body,reply.hdrs,SIP_FLAGS_VERBATIM);
+  dlg.reply(orig,reply.code,reply.reason,
+           reply.content_type,
+           reply.body,reply.hdrs,SIP_FLAGS_VERBATIM);
 }
 
 // 
@@ -267,43 +264,42 @@
     AmSipReply& reply = ((B2BSipReplyEvent*)ev)->reply;
 
     if(other_id != reply.local_tag){
-      DBG("Dialog missmatch!\n");
+      DBG("Dialog mismatch!\n");
       return;
     }
-    if (reply.cseq == invite_req.cseq) {
-      DBG("reply received from other leg\n");
+
+    DBG("reply received from other leg\n");
       
-      switch(callee_status){
-      case NoReply:
-      case Ringing:
+    switch(callee_status){
+    case NoReply:
+    case Ringing:
        
-       if(reply.code < 200){
+      if(reply.code < 200){
          
-         callee_status = Ringing;
-       }
-       else if(reply.code < 300){
+       callee_status = Ringing;
+      }
+      else if(reply.code < 300){
          
-         callee_status  = Connected;
+       callee_status  = Connected;
          
-         if (!sip_relay_only) {
-           sip_relay_only = true;
-           reinviteCaller(reply);
-         }
+       if (!sip_relay_only) {
+         sip_relay_only = true;
+         reinviteCaller(reply);
        }
-       else {
-         //    DBG("received %i from other leg: other_id=%s; 
reply.local_tag=%s\n",
-         //        reply.code,other_id.c_str(),reply.local_tag.c_str());
+      }
+      else {
+       //      DBG("received %i from other leg: other_id=%s; 
reply.local_tag=%s\n",
+       //          reply.code,other_id.c_str(),reply.local_tag.c_str());
          
-         terminateOtherLeg();
-       }
+       terminateOtherLeg();
+      }
        
-       processed = onOtherReply(reply);
-       break;
+      processed = onOtherReply(reply);
+      break;
        
-      default:
-       DBG("reply from callee: %i %s\n",reply.code,reply.reason.c_str());
-       break;
-      }
+    default:
+      DBG("reply from callee: %i %s\n",reply.code,reply.reason.c_str());
+      break;
     }
   }
    

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

Reply via email to