From d6010e4aafd21358ea6c687f2b7c7db4aafd50d6 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Tue, 3 Mar 2009 08:19:43 +0000 Subject: [PATCH] fixes bug introduced with r1273: connectCallee does not re-invite caller (compared cseq of the wrong leg's INVITE) git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1288 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmB2BSession.cpp | 62 ++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp index 3cf0239f..b36daf60 100644 --- a/core/AmB2BSession.cpp +++ b/core/AmB2BSession.cpp @@ -172,9 +172,7 @@ void AmB2BSession::onSipReply(const AmSipReply& reply) 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& req) 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 @@ void AmB2BCallerSession::onB2BEvent(B2BEvent* ev) 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; } }