diff --git a/console/commands.c b/console/commands.c index 7b1a7912b..c1c33f8eb 100644 --- a/console/commands.c +++ b/console/commands.c @@ -1384,6 +1384,7 @@ static int lpc_cmd_register(LinphoneCore *lc, char *args){ info=linphone_auth_info_new(linphone_address_get_username(from),NULL,passwd,NULL,NULL); linphone_core_add_auth_info(lc,info); linphone_address_destroy(from); + linphone_auth_info_destroy(info); } } elem=linphone_core_get_proxy_config_list(lc); diff --git a/console/linphonec.c b/console/linphonec.c index 629612bb0..f589cf220 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -827,6 +827,8 @@ linphonec_prompt_for_auth_final(LinphoneCore *lc) */ linphone_auth_info_set_passwd(pending_auth, input); linphone_core_add_auth_info(lc, pending_auth); + linphone_auth_info_destroy(pending_auth); + auth_stack.elem[auth_stack.nitems-1]=0; --(auth_stack.nitems); #ifdef HAVE_READLINE /* diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 7957747b0..5f79f6939 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -235,6 +235,10 @@ void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg); void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type); SipSetupContext *linphone_proxy_config_get_sip_setup_context(LinphoneProxyConfig *cfg); SipSetup *linphone_proxy_config_get_sip_setup(LinphoneProxyConfig *cfg); +/** + * normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222 + */ +int linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len); /** * @} diff --git a/gtk-glade/log.glade b/gtk-glade/log.glade index 0dfc558de..fc7206433 100644 --- a/gtk-glade/log.glade +++ b/gtk-glade/log.glade @@ -1,15 +1,15 @@ - - - + + + 540 290 5 Linphone debug window - GTK_WIN_POS_CENTER_ON_PARENT + center-on-parent linphone2.png - GDK_WINDOW_TYPE_HINT_DIALOG + dialog False False @@ -21,17 +21,17 @@ True True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_CORNER_BOTTOM_LEFT + never + automatic + bottom-left True - GTK_SHADOW_IN + in True True False - GTK_WRAP_WORD + word @@ -42,27 +42,30 @@ True - GTK_BUTTONBOX_END + end + gtk-close True True True - gtk-close True - 0 + + False + False 1 False - GTK_PACK_END + end + 0 diff --git a/gtk-glade/logging.c b/gtk-glade/logging.c index 4869beaac..9bdf1dc0e 100644 --- a/gtk-glade/logging.c +++ b/gtk-glade/logging.c @@ -72,14 +72,14 @@ static FILE *linphone_gtk_log_init() static gboolean _log_init = FALSE; const char *dst_fname; - dst_fname = linphone_gtk_get_ui_config("logfile",NULL); - /* For anything to happen, we need a logfile configuration variable, - this is our trigger */ - if (dst_fname) { - /* If we haven't initialised yet, arrange for _logdir to contain a - directory that has been created and _logfname to contain the - path to a file to which we will log */ - if (!_log_init) { + if (!_log_init) { + dst_fname = linphone_gtk_get_ui_config("logfile",NULL); + /* For anything to happen, we need a logfile configuration variable, + this is our trigger */ + if (dst_fname) { + /* arrange for _logdir to contain a + directory that has been created and _logfname to contain the + path to a file to which we will log */ #ifdef WIN32 const char *appdata=getenv("LOCALAPPDATA"); if (appdata) { @@ -103,7 +103,7 @@ static FILE *linphone_gtk_log_init() open the file so that we will be appending to it. */ if (_logdir[0] != '\0') { snprintf(_logfname, sizeof(_logfname), "%s%c%s", - _logdir, PATH_SEPARATOR, dst_fname); + _logdir, PATH_SEPARATOR, dst_fname); /* If the constant LOGFILE_ROTATION is greater than zero, then we kick away a simple rotation that will ensure that there are never more than LOGFILE_ROTATION+1 old copies of the @@ -122,9 +122,9 @@ static FILE *linphone_gtk_log_init() have to loop in reverse here. */ for (i=LOGFILE_ROTATION-1;i>=0;i--) { snprintf(old_fname, sizeof(old_fname), "%s%c%s.%d", - _logdir, PATH_SEPARATOR, dst_fname, i); + _logdir, PATH_SEPARATOR, dst_fname, i); snprintf(new_fname, sizeof(new_fname), "%s%c%s.%d", - _logdir, PATH_SEPARATOR, dst_fname, i+1); + _logdir, PATH_SEPARATOR, dst_fname, i+1); if (ortp_file_exist(old_fname)==0) { if (ortp_file_exist(new_fname)==0) unlink(new_fname); @@ -135,7 +135,7 @@ static FILE *linphone_gtk_log_init() sure to remove the old .0 also, since otherwise rename() would not work as expected. */ snprintf(new_fname, sizeof(new_fname), "%s%c%s.%d", - _logdir, PATH_SEPARATOR, dst_fname, 0); + _logdir, PATH_SEPARATOR, dst_fname, 0); if (ortp_file_exist(new_fname)==0) unlink(new_fname); rename(_logfname, new_fname); @@ -143,11 +143,10 @@ static FILE *linphone_gtk_log_init() /* Start a new log file and mark that we have now initialised */ _logfile = fopen(_logfname, "w"); fprintf(_logfile, "%s\n", LOGFILE_MARKER_START); - _log_init = TRUE; } } + _log_init = TRUE; } - return _logfile; } @@ -214,12 +213,29 @@ static void linphone_gtk_log_file(OrtpLogLevel lev, const char *msg) } } + + +static gboolean delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) +{ + gtk_widget_hide (widget); + return TRUE; +} + +void linphone_gtk_log_hide(){ + if (log_window) + gtk_widget_hide(log_window); +} + void linphone_gtk_create_log_window(void){ GtkTextBuffer *b; log_window=linphone_gtk_create_window("log"); b=gtk_text_view_get_buffer(GTK_TEXT_VIEW(linphone_gtk_get_widget(log_window,"textview"))); gtk_text_buffer_create_tag(b,"red","foreground","red",NULL); gtk_text_buffer_create_tag(b,"orange","foreground","orange",NULL); + /*prevent the log window from being destroyed*/ + g_signal_connect (G_OBJECT (log_window), "delete-event", + G_CALLBACK (delete_event_cb), NULL); + } void linphone_gtk_destroy_log_window(void){