]> sjero.net Git - linphone/commitdiff
bugfix: do not retry without encryption when call is cancelled
authorSimon Morlat <simon.morlat@linphone.org>
Wed, 4 Apr 2012 10:29:03 +0000 (12:29 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Wed, 4 Apr 2012 10:29:03 +0000 (12:29 +0200)
coreapi/callbacks.c

index 3f0ac8114535afd3c8648aab68c0d5c48b55d84d..bde6a2f400a7a58b7a88ebaf5ce55cbb594b72e1 100644 (file)
@@ -561,16 +561,18 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
                                        int i;
                                        ms_message("Outgoing call failed with SRTP (SAVP) enabled - retrying with AVP");
                                        linphone_call_stop_media_streams(call);
-                                       /* clear SRTP local params */
-                                       call->params.media_encryption = LinphoneMediaEncryptionNone;
-                                       for(i=0; i<call->localdesc->nstreams; i++) {
-                                               call->localdesc->streams[i].proto = SalProtoRtpAvp;
-                                               memset(call->localdesc->streams[i].crypto, 0, sizeof(call->localdesc->streams[i].crypto));
+                                       if (call->state==LinphoneCallOutgoingInit || call->state==LinphoneCallOutgoingProgress){
+                                               /* clear SRTP local params */
+                                               call->params.media_encryption = LinphoneMediaEncryptionNone;
+                                               for(i=0; i<call->localdesc->nstreams; i++) {
+                                                       call->localdesc->streams[i].proto = SalProtoRtpAvp;
+                                                       memset(call->localdesc->streams[i].crypto, 0, sizeof(call->localdesc->streams[i].crypto));
+                                               }
+                                               linphone_core_start_invite(lc, call, NULL);
                                        }
-                                       linphone_core_start_invite(lc, call, NULL);
                                        return;
                                }
-                               msg=_("No common codecs");
+                               msg=_("Incompatible media parameters.");
                                if (lc->vtable.display_status)
                                        lc->vtable.display_status(lc,msg);
                        break;