media-encryption command should return an error if the requested media encryption is not supported.

This commit is contained in:
Simon Morlat 2015-05-19 12:25:24 +02:00
parent ae7e3fe0f2
commit 179122390e

View file

@ -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));
}
}
}