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

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Tue Jul 12 14:18:22 2011 +0200

b/f: ignore SDP in 200 if OA completed through INV/183.

---

 core/AmSipDialog.cpp |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp
index 9827997..722cb34 100644
--- a/core/AmSipDialog.cpp
+++ b/core/AmSipDialog.cpp
@@ -710,13 +710,21 @@ void AmSipDialog::onRxReply(const AmSipReply& reply)
      !reply.body.empty() && 
      (reply.content_type == SIP_APPLICATION_SDP)) {
 
-    const char* err_txt=NULL;
-    int err_code = onRxSdp(reply.body,&err_txt);
-    if(err_code){
-      // TODO: only if initial INVITE (if re-INV, app should decide)
-      DBG("error %i (%s) with SDP received in %i reply: sending ACK+BYE\n",
-         err_code,err_txt?err_txt:"none",reply.code);
-      bye();
+    if((oa_trans.state == OA_Completed) &&
+       (reply.cseq == oa_trans.cseq)) {
+      
+      DBG("ignoring subsequent SDP reply within the same transaction\n");
+      DBG("this usually happens when 183 and 200 have SDP\n");
+    }
+    else {
+      const char* err_txt=NULL;
+      int err_code = onRxSdp(reply.cseq,reply.body,&err_txt);
+      if(err_code){
+       // TODO: only if initial INVITE (if re-INV, app should decide)
+       DBG("error %i (%s) with SDP received in %i reply: sending ACK+BYE\n",
+           err_code,err_txt?err_txt:"none",reply.code);
+       bye();
+      }
     }
   }
 

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

Reply via email to