]> sjero.net Git - linphone/blobdiff - console/commands.c
Aac-eld add missing header according to RFC3640 3.3.6
[linphone] / console / commands.c
index 776d2b2609e4e1b59a8653259391f36ad342ee7d..67b2446f45ae806fa1ae969c7a172062aa62c27e 100644 (file)
@@ -206,7 +206,7 @@ static LPC_COMMAND commands[] = {
        { "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"
@@ -244,6 +244,8 @@ static LPC_COMMAND commands[] = {
                "'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",
@@ -850,6 +852,20 @@ lpc_cmd_firewall(LinphoneCore *lc, char *args)
                {
                        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);
@@ -883,6 +899,12 @@ lpc_cmd_firewall(LinphoneCore *lc, char *args)
                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;
 }
@@ -1949,7 +1971,7 @@ static int lpc_cmd_duration(LinphoneCore *lc, char *args){
        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;
@@ -2488,13 +2510,15 @@ static int lpc_cmd_camera(LinphoneCore *lc, char *args){
                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))