Commit 696fdb84 authored by Simon Morlat's avatar Simon Morlat
Browse files

improve states naming

parent 82e88822
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
......
......@@ -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)));
}
}
}
......
......@@ -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){
......
......@@ -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;
}
......@@ -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;
......
......@@ -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){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment