]> sjero.net Git - linphone/commitdiff
improve states naming
authorSimon Morlat <simon.morlat@linphone.org>
Thu, 16 Sep 2010 20:57:09 +0000 (22:57 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Thu, 16 Sep 2010 20:57:09 +0000 (22:57 +0200)
configure.in
console/commands.c
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/private.h
coreapi/sal.c

index 57862bdb25ff7d0e03b51fd2cabd593a5815906c..fc1c4c0a798ed46860f34003fa54f954ae3a1b7e 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT([linphone],[3.3.99.2],[linphone-developers@nongnu.org])
+AC_INIT([linphone],[3.3.99.3],[linphone-developers@nongnu.org])
 AC_CANONICAL_SYSTEM
 
 dnl Source packaging numbers
index 9e37b3569da88d781d3f29aa4de06c2581f6852b..619746cda1ab53cc5a350f60fe579fbf1e448991 100644 (file)
@@ -2198,7 +2198,7 @@ static int lpc_cmd_video_window(LinphoneCore *lc, char *args){
 }
 
 static void lpc_display_global_state(LinphoneCore *lc){
-       linphonec_out("****************Global liblinphone state********************\n\t%s",
+       linphonec_out("Global liblinphone state\n%s\n",
                      linphone_global_state_to_string(linphone_core_get_global_state(lc)));
 }
 
@@ -2206,24 +2206,36 @@ static void lpc_display_call_states(LinphoneCore *lc){
        LinphoneCall *call;
        const MSList *elem;
        char *tmp;
-       linphonec_out("****************Calls states*******************************\nId    |            Destination         |      State\n");
-
-       for(elem=linphone_core_get_calls(lc);elem!=NULL;elem=elem->next){
-               call=(LinphoneCall*)elem->data;
-               tmp=linphone_call_get_remote_address_as_string (call);
-               linphonec_out("%2.2i|%10.10s|%s",(int)(long)linphone_call_get_user_pointer(call),
-                             tmp,linphone_call_state_to_string(linphone_call_get_state(call)));
-               ms_free(tmp);
+       linphonec_out("Call states\n"
+                     "Id |            Destination              |      State\n"
+                     "---------------------------------------------------------------\n");
+       elem=linphone_core_get_calls(lc);
+       if (elem==NULL){
+               linphonec_out("(empty)\n");
+       }else{
+               for(;elem!=NULL;elem=elem->next){
+                       call=(LinphoneCall*)elem->data;
+                       tmp=linphone_call_get_remote_address_as_string (call);
+                       linphonec_out("%-2i | %-35s | %s\n",(int)(long)linphone_call_get_user_pointer(call),
+                                                 tmp,linphone_call_state_to_string(linphone_call_get_state(call)));
+                       ms_free(tmp);
+               }
        }
 }
 
 static void lpc_display_proxy_states(LinphoneCore *lc){
        const MSList *elem;
-       linphonec_out("****************Proxy registration states*****************\nIdentity      |      State\n");
-       for(elem=linphone_core_get_proxy_config_list (lc);elem!=NULL;elem=elem->next){
-               LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data;
-               linphonec_out("%20.10s | %s",linphone_proxy_config_get_identity (cfg),
-                             linphone_registration_state_to_string(linphone_proxy_config_get_state(cfg)));
+       linphonec_out("Proxy registration states\n"
+                     "           Identity                      |      State\n"
+                     "------------------------------------------------------------\n");
+       elem=linphone_core_get_proxy_config_list (lc);
+       if (elem==NULL) linphonec_out("(empty)\n");
+       else {
+               for(;elem!=NULL;elem=elem->next){
+                       LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data;
+                       linphonec_out("%-40s | %s\n",linphone_proxy_config_get_identity (cfg),
+                                                 linphone_registration_state_to_string(linphone_proxy_config_get_state(cfg)));
+               }
        }
 }
 
index 338c84336cf4b311de914f1f1af1bcc743365075..812fa8cf7812b1580b1d1a2415a2a9347059c02e 100644 (file)
@@ -655,7 +655,6 @@ void linphone_call_start_media_streams(LinphoneCall *call){
                                if (captcard==NULL) {
                                        ms_warning("No card defined for capture !");
                                }
-                               ms_message("streamdir is %i",stream->dir);
                                /*Replace soundcard filters by inactive file players or recorders
                                 when placed in recvonly or sendonly mode*/
                                if (stream->port==0 || stream->dir==SalStreamRecvOnly){
index e4e4b14f8bd097edd4f61aa588f01c456ac1bd9c..b35ea38d72362f67fce889ff2f5dc25c36a9804f 100644 (file)
@@ -903,6 +903,7 @@ static void linphone_core_free_payload_types(void){
 }
 
 void linphone_core_set_state(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message){
+       lc->state=gstate;
        if (lc->vtable.global_state_changed){
                lc->vtable.global_state_changed(lc,gstate,message);
        }
@@ -3835,5 +3836,5 @@ const char *linphone_global_state_to_string(LinphoneGlobalState gs){
 }
 
 LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *lc){
-       return LinphoneGlobalOn;
+       return lc->state;
 }
index fdf9b1f33459aa0f61a2f4e2fc49a1726da8e9b4..b9e33b049081825f5634d81ce48fc1cf4772c312 100644 (file)
@@ -355,6 +355,7 @@ struct _LinphoneCore
 {
        LinphoneCoreVTable vtable;
        Sal *sal;
+       LinphoneGlobalState state;
        struct _LpConfig *config;
        net_config_t net_conf;
        sip_config_t sip_conf;
index 463884d709c01c448d3e98425f034789927e01de..ca5b4d815bada807207bf77bf5e9e306f156757d 100644 (file)
@@ -81,11 +81,17 @@ void sal_media_description_set_dir(SalMediaDescription *md, SalStreamDir stream_
 
 bool_t sal_media_description_has_dir(const SalMediaDescription *md, SalStreamDir stream_dir){
        int i;
+       bool_t found=FALSE;
+
+       /* we are looking for at least one stream with requested direction, inactive streams are ignored*/
        for(i=0;i<md->nstreams;++i){
                const SalStreamDescription *ss=&md->streams[i];
-               if (ss->dir==stream_dir) return TRUE;
+               if (ss->dir==stream_dir) found=TRUE;
+               else{
+                       if (ss->dir!=SalStreamInactive) return FALSE;
+               }
        }
-       return FALSE;
+       return found;
 }
 
 static void assign_string(char **str, const char *arg){