From cc57a0886feca69db61e0154887ec65014149910 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Fri, 6 May 2011 10:30:37 +0200 Subject: [PATCH] b/f: do not update route or remote_uri on failure reply. --- core/AmSipDialog.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index e97e20a7..753d815d 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -323,21 +323,23 @@ void AmSipDialog::updateStatus(const AmSipReply& reply) // responses to INVITE if ( (reply.code > 100) - && (reply.code < 300) - && !reply.remote_tag.empty() + && (reply.code < 300) { + + if(!reply.remote_tag.empty() && (remote_tag.empty() || ((status < Connected) && (reply.code >= 200))) ) { - remote_tag = reply.remote_tag; - } + remote_tag = reply.remote_tag; + } - // allow route overwriting - if ((status < Connected) && !reply.route.empty()) { + // allow route overwriting + if ((status < Connected) && !reply.route.empty()) { route = reply.route; - } + } - if (reply.next_request_uri.length()) - remote_uri = reply.next_request_uri; + if (reply.next_request_uri.length()) + remote_uri = reply.next_request_uri; + } switch(status){ case Disconnecting: