]> sjero.net Git - linphone/commitdiff
Zrtp reset verified command.
authorGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Thu, 17 Nov 2011 11:44:50 +0000 (12:44 +0100)
committerGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Fri, 18 Nov 2011 08:55:56 +0000 (09:55 +0100)
console/commands.c

index e40dda66c35bc20fd690627a89071ac18052d983..bccb09c8102987244158e29237dc544394c0022c 100644 (file)
@@ -104,6 +104,7 @@ static int lpc_cmd_identify(LinphoneCore *lc, char *args);
 static int lpc_cmd_ringback(LinphoneCore *lc, char *args);
 static int lpc_cmd_conference(LinphoneCore *lc, char *args);
 static int lpc_cmd_zrtp_verified(LinphoneCore *lc, char *args);
+static int lpc_cmd_zrtp_unverified(LinphoneCore *lc, char *args);
 
 /* Command handler helpers */
 static void linphonec_proxy_add(LinphoneCore *lc);
@@ -352,6 +353,9 @@ static LPC_COMMAND advanced_commands[] = {
        { "zrtp-set-verified", lpc_cmd_zrtp_verified,"Set ZRTP SAS verified.",
                "'Set ZRTP SAS verified'\n"
        },
+       { "zrtp-set-unverified", lpc_cmd_zrtp_unverified,"Set ZRTP SAS not verified.",
+               "'Set ZRTP SAS not verified'\n"
+       },
        {       NULL,NULL,NULL,NULL}
 };
 
@@ -2556,13 +2560,19 @@ static int lpc_cmd_ringback(LinphoneCore *lc, char *args){
        return 1;
 }
 
-static int lpc_cmd_zrtp_verified(LinphoneCore *lc, char *args){
+static int zrtp_set_verified(LinphoneCore *lc, char *args, bool_t verified){
        LinphoneCall *call=linphone_core_get_current_call(lc);
        if (linphone_call_params_get_media_encryption(linphone_call_get_current_params(call))==LinphoneMediaEncryptionZRTP){
-               linphone_call_set_authentication_token_verified(call,TRUE);
+               linphone_call_set_authentication_token_verified(call,verified);
        }
        return 1;
 }
+static int lpc_cmd_zrtp_verified(LinphoneCore *lc, char *args){
+       return zrtp_set_verified(lc,args,TRUE);
+}
+static int lpc_cmd_zrtp_unverified(LinphoneCore *lc, char *args){
+       return zrtp_set_verified(lc,args,FALSE);
+}
 
 /***************************************************************************
  *