From 94c264f246d3339ddb2fe1e7879edc9cf07fc410 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 30 Sep 2013 11:17:42 +0200 Subject: [PATCH] fix linphonec bugs --- console/commands.c | 17 +++++++++-------- coreapi/linphonecore.h | 1 - 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/console/commands.c b/console/commands.c index 1e893619d..99effcfcc 100644 --- a/console/commands.c +++ b/console/commands.c @@ -1082,6 +1082,7 @@ lpc_cmd_proxy(LinphoneCore *lc, char *args) } else if (strcmp(arg1,"remove")==0) { + if (arg2==NULL) return 0; linphonec_proxy_remove(lc,atoi(arg2)); } else if (strcmp(arg1,"use")==0) @@ -1109,16 +1110,16 @@ lpc_cmd_proxy(LinphoneCore *lc, char *args) { if (strstr(arg2,"default")) { - proxynum=linphone_core_get_default_proxy(lc, NULL); - if ( proxynum < 0 ) { - linphonec_out("No default proxy defined\n"); - return 1; - } - linphonec_proxy_show(lc,proxynum); + proxynum=linphone_core_get_default_proxy(lc, NULL); + if ( proxynum < 0 ) { + linphonec_out("No default proxy defined\n"); + return 1; + } + linphonec_proxy_show(lc,proxynum); } else { - linphonec_proxy_show(lc, atoi(arg2)); + linphonec_proxy_show(lc, atoi(arg2)); } } else return 0; /* syntax error */ @@ -1942,7 +1943,7 @@ static int lpc_cmd_register(LinphoneCore *lc, char *args){ cfg=(LinphoneProxyConfig*)elem->data; linphone_proxy_config_edit(cfg); } - else cfg=linphone_proxy_config_new(); + else cfg=linphone_core_create_proxy_config(lc); linphone_proxy_config_set_identity(cfg,identity); linphone_proxy_config_set_server_addr(cfg,proxy); linphone_proxy_config_enable_register(cfg,TRUE); diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 1705ad2af..e79630cfe 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -654,7 +654,6 @@ typedef enum _LinphoneRegistrationState{ * @param cs sate */ LINPHONE_PUBLIC const char *linphone_registration_state_to_string(LinphoneRegistrationState cs); - LINPHONE_PUBLIC LinphoneProxyConfig *linphone_proxy_config_new(void); LINPHONE_PUBLIC int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr); LINPHONE_PUBLIC int linphone_proxy_config_set_identity(LinphoneProxyConfig *obj, const char *identity);