Module: sems Branch: master Commit: f8d8d7db1d18818ebd46237a8cd66b995ed70463 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=f8d8d7db1d18818ebd46237a8cd66b995ed70463
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 Conflicts: core/AmB2BSession.cpp --- core/AmB2BSession.cpp | 38 +++++++++++++++++++++++++++----------- 1 files changed, 27 insertions(+), 11 deletions(-) diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp index a2f99f7..05e4c6f 100644 --- a/core/AmB2BSession.cpp +++ b/core/AmB2BSession.cpp @@ -1039,19 +1039,28 @@ 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())) { - DBG("sending re-INVITE to caller with early media SDP\n"); - 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.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(); + break; + } } + } - + callee_status = Ringing; + } else if(reply.code < 300){ callee_status = Connected; @@ -1060,7 +1069,14 @@ void AmB2BCallerSession::onB2BEvent(B2BEvent* ev) DBG("received 200 class reply to establishing INVITE: " "switching to SIP relay only mode, sending re-INVITE to caller\n"); 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.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
