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

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Mon Sep 23 15:52:45 2013 +0200

b/f:b2bua: if 200 to INV without SDP, use SDP from 18x for caller re-Invite

reported by Andrew Pogrebennyk

---

 core/AmB2BSession.cpp |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp
index 89f802f..2a4ad11 100644
--- a/core/AmB2BSession.cpp
+++ b/core/AmB2BSession.cpp
@@ -897,25 +897,40 @@ void AmB2BCallerSession::onB2BEvent(B2BEvent* ev)
     case NoReply:
     case Ringing:
       if (reply.cseq == invite_req.cseq) {
-       if(reply.code < 200){
-         if ((!sip_relay_only) && sip_relay_early_media_sdp &&
-             reply.code>=180 && reply.code<=183 && (!reply.body.empty())) {
-           if (reinviteCaller(reply)) {
-             ERROR("re-INVITEing caller for early session failed - "
-                   "stopping this and other leg\n");
-             terminateOtherLeg();
-             terminateLeg();
+       if (reply.code < 200) {
+
+         if ((!sip_relay_only) &&
+             (reply.code>=180 && reply.code<=183 && (!reply.body.empty()))) {
+           // save early media SDP
+           updateSessionDescription(reply.content_type, reply.body);
+
+           if (sip_relay_early_media_sdp) {
+             if (reinviteCaller(reply)) {
+               ERROR("re-INVITEing caller for early session failed - "
+                     "stopping this and other leg\n");
+               terminateOtherLeg();
+               terminateLeg();
+             }
            }
          }
-         
+
          callee_status = Ringing;
+
        } else if(reply.code < 300){
          
          callee_status  = Connected;
          
          if (!sip_relay_only) {
            sip_relay_only = true;
-           if (reinviteCaller(reply)) {
+           AmSipReply n_reply = reply;
+
+           if (n_reply.body.empty() && !established_body.empty()) {
+             DBG("callee FR without SDP, using provisional response's (18x) 
one\n");
+             n_reply.content_type = established_content_type;
+             n_reply.body = established_body;
+           }
+
+           if (reinviteCaller(n_reply)) {
              ERROR("re-INVITEing caller failed - stopping this and other 
leg\n");
              terminateOtherLeg();
              terminateLeg();

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

Reply via email to