Commit 2d26dc54 authored by Simon Morlat's avatar Simon Morlat

fix some bugs, update translations

parent 2b7bd178
......@@ -643,9 +643,10 @@ static void sip_config_read(LinphoneCore *lc)
linphone_core_enable_ipv6(lc,ipv6);
memset(&tr,0,sizeof(tr));
tr.udp_port=lp_config_get_int(lc->config,"sip","sip_port",0);
tr.tcp_port=lp_config_get_int(lc->config,"sip","sip_tcp_port",0);
tr.tls_port=lp_config_get_int(lc->config,"sip","sip_tls_port",0);
tr.udp_port=lp_config_get_int(lc->config,"sip","sip_port",5060);
tr.tcp_port=lp_config_get_int(lc->config,"sip","sip_tcp_port",5060);
/*we are not listening inbound connection for tls, port has no meaning*/
tr.tls_port=lp_config_get_int(lc->config,"sip","sip_tls_port",LC_SIP_TRANSPORT_RANDOM);
certificates_config_read(lc);
/*setting the dscp must be done before starting the transports, otherwise it is not taken into effect*/
......@@ -3416,7 +3417,7 @@ int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char
}else{
ms_error("Bad state for call redirection.");
return -1;
}
}
return 0;
}
......
......@@ -80,6 +80,7 @@ static int sip_login_do_login(SipSetupContext * ctx, const char *uri, const char
static int sip_login_do_logout(SipSetupContext * ctx){
LinphoneProxyConfig *cfg=sip_setup_context_get_proxy_config(ctx);
linphone_proxy_config_edit(cfg);
linphone_proxy_config_enable_register(cfg,FALSE);
linphone_proxy_config_done(cfg);
return 0;
......
......@@ -21,11 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "lpconfig.h"
void linphone_gtk_set_configuration_uri(GtkWidget *item){
void linphone_gtk_set_configuration_uri(void){
GtkWidget *w=linphone_gtk_create_window("config-uri");
GtkWidget *entry=linphone_gtk_get_widget(w,"uri_entry");
const char *uri=linphone_core_get_provisioning_uri(linphone_gtk_get_core());
gtk_entry_set_text(GTK_ENTRY(entry),uri);
if (uri) gtk_entry_set_text(GTK_ENTRY(entry),uri);
gtk_widget_show(w);
}
......
......@@ -153,7 +153,7 @@ void linphone_gtk_update_video_button(LinphoneCall *call);
typedef float (*get_volume_t)(void *data);
void linphone_gtk_init_audio_meter(GtkWidget *w, get_volume_t get_volume, void *data);
void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg);
void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg, gboolean disable_auto_login);
void linphone_gtk_exit_login_frame(void);
void linphone_gtk_set_ui_config(const char *key, const char *value);
......@@ -167,6 +167,7 @@ void linphone_gtk_unmonitor_usb(void);
gchar *linphone_gtk_get_record_path(const LinphoneAddress *address, gboolean is_conference);
void linphone_gtk_schedule_restart(void);
void linphone_gtk_set_configuration_uri(void);
GtkWidget * linphone_gtk_show_config_fetching(void);
void linphone_gtk_close_config_fetching(GtkWidget *w, LinphoneConfiguringState state);
......@@ -37,8 +37,7 @@ static gboolean do_login_noprompt(LinphoneProxyConfig *cfg){
if (ssctx==NULL) return TRUE;/*not ready ?*/
username=linphone_gtk_get_ui_config ("login_username",NULL);
if (username==NULL) {
linphone_gtk_set_ui_config_int("automatic_login",0);
linphone_gtk_show_login_frame(cfg);
linphone_gtk_show_login_frame(cfg,TRUE);
return FALSE;
}
addr=linphone_address_new(linphone_proxy_config_get_identity(cfg));
......@@ -50,7 +49,7 @@ static gboolean do_login_noprompt(LinphoneProxyConfig *cfg){
return FALSE;
}
void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg){
void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg, gboolean disable_auto_login){
GtkWidget *mw=linphone_gtk_get_main_window();
GtkWidget *label=linphone_gtk_get_widget(mw,"login_label");
const LinphoneAuthInfo *ai;
......@@ -58,13 +57,16 @@ void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg){
LinphoneAddress *from;
LinphoneCore *lc=linphone_gtk_get_core();
const char *passwd=NULL;
const char *userid=NULL;
gboolean auto_login=linphone_gtk_get_ui_config_int("automatic_login",0);
if (linphone_gtk_get_ui_config_int("automatic_login",0) ){
if (auto_login && !disable_auto_login){
g_timeout_add(250,(GSourceFunc)do_login_noprompt,cfg);
return;
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(mw,"automatic_login")),auto_login);
{
const char *login_image=linphone_gtk_get_ui_config("login_image","linphone-banner.png");
if (login_image){
......@@ -100,9 +102,14 @@ void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg){
if (linphone_address_get_username(from)[0]!='?')
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(mw,"login_username")),
linphone_address_get_username(from));
if (ai) passwd=linphone_auth_info_get_passwd(ai);
if (ai) {
passwd=linphone_auth_info_get_passwd(ai);
userid=linphone_auth_info_get_userid(ai);
}
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(mw,"login_password")),
passwd!=NULL ? passwd : "");
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(mw,"login_userid")),
userid ? userid : "");
linphone_address_destroy(from);
}
......@@ -123,8 +130,7 @@ void linphone_gtk_logout_clicked(){
SipSetupContext *ss=linphone_proxy_config_get_sip_setup_context(cfg);
if (ss){
sip_setup_context_logout(ss);
linphone_gtk_set_ui_config_int("automatic_login",FALSE);
linphone_gtk_show_login_frame(cfg);
linphone_gtk_show_login_frame(cfg,TRUE);
}
}
}
......@@ -152,7 +158,6 @@ void linphone_gtk_login_frame_connect_clicked(GtkWidget *button){
autologin=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(mw,"automatic_login")));
linphone_gtk_set_ui_config_int("automatic_login",autologin);
linphone_gtk_set_ui_config("login_username",username);
linphone_gtk_set_ui_config("login_userid",userid);
from=linphone_address_new(linphone_proxy_config_get_identity(cfg));
linphone_address_set_username(from,username);
......
......@@ -1874,7 +1874,7 @@ void linphone_gtk_manage_login(void){
if (cfg){
SipSetup *ss=linphone_proxy_config_get_sip_setup(cfg);
if (ss && (sip_setup_get_capabilities(ss) & SIP_SETUP_CAP_LOGIN)){
linphone_gtk_show_login_frame(cfg);
linphone_gtk_show_login_frame(cfg,FALSE);
}
}
}
......
......@@ -43,13 +43,17 @@ static GtkWidget *create_setup_signin_choice(){
GtkWidget *t1=gtk_radio_button_new_with_label(NULL,_("Create an account on linphone.org"));
GtkWidget *t2=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(t1),_("I have already a linphone.org account and I just want to use it"));
GtkWidget *t3=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(t1),_("I have already a sip account and I just want to use it"));
GtkWidget *t4=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(t1),_("I want to specify a remote configuration URI"));
gtk_box_pack_start (GTK_BOX (vbox), t1, TRUE, TRUE, 2);
gtk_box_pack_start (GTK_BOX (vbox), t2, TRUE, TRUE, 2);
gtk_box_pack_start (GTK_BOX (vbox), t3, TRUE, TRUE, 2);
gtk_box_pack_start (GTK_BOX (vbox), t4, TRUE, TRUE, 2);
gtk_widget_show_all(vbox);
g_object_set_data(G_OBJECT(vbox),"create_account",t1);
g_object_set_data(G_OBJECT(vbox),"setup_linphone_account",t2);
g_object_set_data(G_OBJECT(vbox),"setup_account",t3);
g_object_set_data(G_OBJECT(vbox),"config-uri",t4);
return vbox;
}
......@@ -434,26 +438,33 @@ static void linphone_gtk_assistant_prepare(GtkWidget *assistant, GtkWidget *page
linphone_core_add_auth_info(linphone_gtk_get_core(),info);
g_free(username);
// If account created on sip.linphone.org, we configure linphone to use TLS by default
if (strcmp(creator->domain, "sip:sip.linphone.org") == 0 && linphone_core_sip_transport_supported(linphone_gtk_get_core(),LinphoneTransportTls)) {
LinphoneAddress *addr=linphone_address_new(creator->domain);
char *tmp;
linphone_address_set_transport(addr, LinphoneTransportTls);
tmp=linphone_address_as_string(addr);
linphone_proxy_config_set_server_addr(cfg,tmp);
linphone_proxy_config_set_route(cfg,tmp);
ms_free(tmp);
linphone_address_destroy(addr);
}
if (linphone_core_add_proxy_config(linphone_gtk_get_core(),cfg)==-1)
return;
linphone_core_set_default_proxy(linphone_gtk_get_core(),cfg);
linphone_gtk_load_identities();
// If account created on sip.linphone.org, we configure linphone to use TLS by default
g_warning("Domain : %s", creator->domain);
if (strcmp(creator->domain, "sip:sip.linphone.org") == 0) {
LCSipTransports tr;
LinphoneCore* lc = linphone_gtk_get_core();
linphone_core_get_sip_transports(lc,&tr);
tr.tls_port = tr.udp_port + tr.tcp_port + tr.tls_port;
tr.udp_port = 0;
tr.tcp_port = 0;
linphone_core_set_sip_transports(lc,&tr);
}
}
}
static gint destroy_assistant(GtkWidget* w){
gtk_widget_destroy(w);
return FALSE;
}
static int linphone_gtk_assistant_forward(int curpage, gpointer data){
GtkWidget *w=(GtkWidget*)data;
GtkWidget *box=gtk_assistant_get_nth_page(GTK_ASSISTANT(w),curpage);
......@@ -461,6 +472,7 @@ static int linphone_gtk_assistant_forward(int curpage, gpointer data){
GtkWidget *create_button=(GtkWidget*)g_object_get_data(G_OBJECT(box),"create_account");
GtkWidget *setup_linphone_account=(GtkWidget*)g_object_get_data(G_OBJECT(box),"setup_linphone_account");
GtkWidget *setup_account=(GtkWidget*)g_object_get_data(G_OBJECT(box),"setup_account");
GtkWidget *config_uri=(GtkWidget*)g_object_get_data(G_OBJECT(box),"config-uri");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(create_button))) {
curpage += 3; // Going to P33
......@@ -471,6 +483,13 @@ static int linphone_gtk_assistant_forward(int curpage, gpointer data){
else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(setup_account))) {
curpage += 1; // Going to P31
}
else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(config_uri))) {
/*destroy the assistant and popup config-uri dialog*/
gtk_widget_hide(w);
linphone_gtk_set_configuration_uri();
curpage=0;
g_idle_add((GSourceFunc)destroy_assistant,w);
}
}
else if (curpage == 2) { // Account's informations entered
LinphoneAccountCreator *c=linphone_gtk_assistant_get_creator(w);
......@@ -541,7 +560,7 @@ static LinphoneAccountCreator *linphone_gtk_assistant_get_creator(GtkWidget*w){
void linphone_gtk_close_assistant(void){
if(the_assistant==NULL)
return;
gtk_widget_destroy(the_assistant);
gtk_widget_destroy(the_assistant);
the_assistant = NULL;
}
......@@ -550,6 +569,7 @@ void linphone_gtk_show_assistant(void){
return;
GtkWidget *w=the_assistant=gtk_assistant_new();
gtk_window_set_resizable (GTK_WINDOW(w), FALSE);
gtk_window_set_title(GTK_WINDOW(w),_("SIP account configuration assistant"));
ok = create_pixbuf(linphone_gtk_get_ui_config("ok","ok.png"));
notok = create_pixbuf(linphone_gtk_get_ui_config("notok","notok.png"));
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -462,6 +462,44 @@ static void call_forking_with_push_notification_multiple(void){
linphone_core_manager_destroy(marie2);
}
void call_forking_not_responded(void){
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc_tcp");
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* marie2 = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* marie3 = linphone_core_manager_new( "marie_rc");
MSList* lcs=ms_list_append(NULL,pauline->lc);
lcs=ms_list_append(lcs,marie->lc);
lcs=ms_list_append(lcs,marie2->lc);
lcs=ms_list_append(lcs,marie3->lc);
linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL);
linphone_core_set_user_agent(marie2->lc,"Natted Linphone",NULL);
linphone_core_set_user_agent(marie3->lc,"Natted Linphone",NULL);
linphone_core_set_user_agent(pauline->lc,"Natted Linphone",NULL);
linphone_core_invite_address(pauline->lc,marie->identity);
/*pauline should hear ringback*/
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallOutgoingRinging,1,1000));
/*all devices from Marie should be ringing*/
CU_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallIncomingReceived,1,1000));
CU_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallIncomingReceived,1,1000));
CU_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallIncomingReceived,1,1000));
/*nobody answers, flexisip should close the call after XX seconds*/
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallError,1,22000));
/*all devices should stop ringing*/
CU_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,1,1000));
CU_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallEnd,1,1000));
CU_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallEnd,1,1000));
linphone_core_manager_destroy(pauline);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(marie2);
linphone_core_manager_destroy(marie3);
ms_list_free(lcs);
}
static void early_media_call_forking(void) {
LinphoneCoreManager* marie1 = linphone_core_manager_new("marie_early_rc");
LinphoneCoreManager* marie2 = linphone_core_manager_new("marie_early_rc");
......@@ -559,6 +597,7 @@ test_t flexisip_tests[] = {
{ "Call forking with urgent reply", call_forking_with_urgent_reply },
{ "Call forking with push notification (single)", call_forking_with_push_notification_single },
{ "Call forking with push notification (multiple)", call_forking_with_push_notification_multiple },
{ "Call forking not responded", call_forking_not_responded },
{ "Early-media call forking", early_media_call_forking },
};
......
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