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);
{ "autoanswer", lpc_cmd_autoanswer, "Show/set auto-answer mode",
"'autoanswer' \t: show current autoanswer mode\n"
"'autoanswer enable'\t: enable autoanswer mode\n"
- "'autoanswer disable'\t: disable autoanswer mode \n"},
+ "'autoanswer disable'\t: disable autoanswer mode��\n"},
{ "proxy", lpc_cmd_proxy, "Manage proxies",
"'proxy list' : list all proxy setups.\n"
"'proxy add' : add a new proxy setup.\n"
"'firewall none' : use direct connection.\n"
"'firewall nat' : use nat address given with the 'nat' command.\n"
"'firewall stun' : use stun server given with the 'stun' command.\n"
+ "'firewall ice' : use ice.\n"
+ "'firewall upnp' : use uPnP IGD.\n"
},
{ "call-logs", lpc_cmd_call_logs, "Calls history", NULL },
{ "friend", lpc_cmd_friend, "Manage friends",
{ "redirect", lpc_cmd_redirect, "Redirect an incoming call",
"'redirect <redirect-uri>'\t: Redirect all pending incoming calls to the <redirect-uri>\n"
},
+ { "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}
};
char arg1[256]={0};
char arg2[266]={0};
long id2=0;
- int n=sscanf(args,"%s %s %li",arg1,arg2,&id2);
+ int n=sscanf(args,"%255s %265s %li",arg1,arg2,&id2);
if (n==1 || isalpha(*arg1)){
call=linphone_core_get_current_call(lc);
if (call==NULL && ms_list_size(linphone_core_get_calls(lc))==1){
{
linphone_core_set_firewall_policy(lc,LinphonePolicyNoFirewall);
}
+ else if (strcmp(args,"upnp")==0)
+ {
+ linphone_core_set_firewall_policy(lc,LinphonePolicyUseUpnp);
+ }
+ else if (strcmp(args,"ice")==0)
+ {
+ setting = linphone_core_get_stun_server(lc);
+ if ( ! setting )
+ {
+ linphonec_out("No stun server address is defined, use 'stun <address>' first\n");
+ return 1;
+ }
+ linphone_core_set_firewall_policy(lc,LinphonePolicyUseIce);
+ }
else if (strcmp(args,"stun")==0)
{
setting = linphone_core_get_stun_server(lc);
case LinphonePolicyUseNatAddress:
linphonec_out("Using supplied nat address %s.\n", setting ? setting : linphone_core_get_nat_address(lc));
break;
+ case LinphonePolicyUseIce:
+ linphonec_out("Using ice with stun server %s to discover firewall address\n", setting ? setting : linphone_core_get_stun_server(lc));
+ break;
+ case LinphonePolicyUseUpnp:
+ linphonec_out("Using uPnP IGD protocol\n");
+ break;
}
return 1;
}
return 1;
}
passwd[0]=proxy[0]=identity[0]='\0';
- sscanf(args,"%s %s %s",identity,proxy,passwd);
+ sscanf(args,"%511s %511s %511s",identity,proxy,passwd);
if (proxy[0]=='\0' || identity[0]=='\0'){
linphonec_out("Missing parameters, see help register\n");
return 1;
for(;elem!=NULL;elem=elem->next){
if (elem->next==NULL){
cl=(LinphoneCallLog*)elem->data;
- linphonec_out("%i seconds\n",cl->duration);
+ linphonec_out("%i seconds\n",linphone_call_log_get_duration(cl));
}
}
return 1;
if (args == NULL) {
return 0;
}
- switch (sscanf(args,"%s %s %s",section,param,value)) {
+ switch (sscanf(args,"%19s %19s %49s",section,param,value)) {
// case 1 might show all current settings under a section
case 2:
string = lp_config_get_string(linphone_core_get_config(lc), section, param, "(undef)");
if (!args) return 0;
memset(voice,0,sizeof(voice));
- sscanf(args,"%s63",voice);
+ sscanf(args,"%63s",voice);
sentence=args+strlen(voice);
wavfile=tempnam("/tmp/","linphonec-espeak-");
snprintf(cl,sizeof(cl),"espeak -v %s -s 100 -w %s --stdin",voice,wavfile);
VideoParams *params=is_preview ? &lpc_preview_params : &lpc_video_params;
if (!args) return 0;
- err=sscanf(args,"%s %i %i",subcommand,&a,&b);
+ err=sscanf(args,"%63s %i %i",subcommand,&a,&b);
if (err>=1){
if (strcmp(subcommand,"pos")==0){
if (err<3) return 0;
const LinphoneCallParams *cp=linphone_call_get_current_params (call);
if (args){
linphone_call_enable_camera(call,activated);
- if ((activated && !linphone_call_params_video_enabled (cp))){
- /*update the call to add the video stream*/
- LinphoneCallParams *ncp=linphone_call_params_copy(cp);
- linphone_call_params_enable_video(ncp,TRUE);
- linphone_core_update_call(lc,call,ncp);
- linphone_call_params_destroy (ncp);
- linphonec_out("Trying to bring up video stream...\n");
+ if (linphone_call_get_state(call)==LinphoneCallStreamsRunning){
+ if ((activated && !linphone_call_params_video_enabled (cp))){
+ /*update the call to add the video stream*/
+ LinphoneCallParams *ncp=linphone_call_params_copy(cp);
+ linphone_call_params_enable_video(ncp,TRUE);
+ linphone_core_update_call(lc,call,ncp);
+ linphone_call_params_destroy (ncp);
+ linphonec_out("Trying to bring up video stream...\n");
+ }
}
}
if (linphone_call_camera_enabled (call))
return 1;
}
+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,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);
+}
+
/***************************************************************************
*
* Command table management funx