From a405553fc7fecd77b561ee56259eaabfcad250bf Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 15 Nov 2013 15:06:51 +0100 Subject: [PATCH] make sure in case of 415 caused by SRTP, call is retried even if in ringing state (I.E push case)) --- coreapi/callbacks.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index a256122c7..23f9663fa 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -630,9 +630,13 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de if (call->params.media_encryption == LinphoneMediaEncryptionSRTP && !linphone_core_is_media_encryption_mandatory(lc)) { int i; - ms_message("Outgoing call failed with SRTP (SAVP) enabled - retrying with AVP"); + ms_message("Outgoing call [%p] failed with SRTP (SAVP) enabled",call); linphone_call_stop_media_streams(call); - if (call->state==LinphoneCallOutgoingInit || call->state==LinphoneCallOutgoingProgress){ + if ( call->state==LinphoneCallOutgoingInit + || call->state==LinphoneCallOutgoingProgress + || call->state==LinphoneCallOutgoingRinging /*push case*/ + || call->state==LinphoneCallOutgoingEarlyMedia){ + ms_message("Retrying call [%p] with AVP",call); /* clear SRTP local params */ call->params.media_encryption = LinphoneMediaEncryptionNone; for(i=0; ilocaldesc->n_active_streams; i++) { @@ -640,8 +644,9 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de memset(call->localdesc->streams[i].crypto, 0, sizeof(call->localdesc->streams[i].crypto)); } linphone_core_restart_invite(lc, call); + return; } - return; + } msg=_("Incompatible media parameters."); if (lc->vtable.display_status)