From 179122390ed2aa84d5b6a218654cd61a7a8011f7 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 19 May 2015 12:25:24 +0200 Subject: [PATCH] media-encryption command should return an error if the requested media encryption is not supported. --- daemon/commands/media-encryption.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/daemon/commands/media-encryption.cc b/daemon/commands/media-encryption.cc index fb3bd34d5..6180790e4 100644 --- a/daemon/commands/media-encryption.cc +++ b/daemon/commands/media-encryption.cc @@ -62,7 +62,10 @@ void MediaEncryptionCommand::exec(Daemon *app, const char *args) { app->sendResponse(Response("Incorrect parameter.", Response::Error)); return; } - linphone_core_set_media_encryption(app->getCore(), encryption); - app->sendResponse(MediaEncryptionResponse(app->getCore())); + if (linphone_core_set_media_encryption(app->getCore(), encryption)==0){ + app->sendResponse(MediaEncryptionResponse(app->getCore())); + }else{ + app->sendResponse(Response("Unsupported media encryption", Response::Error)); + } } }