Commit 2816a196 authored by smorlat's avatar smorlat

update it transation.

fix mute mode
repair --call when in login mode.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@648 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent d9ea6f29
......@@ -146,40 +146,44 @@ static int realm_match(const char *realm1, const char *realm2){
return FALSE;
}
static int auth_info_compare(const void *pinfo,const void *pref){
LinphoneAuthInfo *info=(LinphoneAuthInfo*)pinfo;
LinphoneAuthInfo *ref=(LinphoneAuthInfo*)pref;
if (realm_match(info->realm,ref->realm) && key_match(info->username,ref->username)) return 0;
return -1;
}
static int auth_info_compare_only_realm(const void *pinfo,const void *pref){
LinphoneAuthInfo *info=(LinphoneAuthInfo*)pinfo;
LinphoneAuthInfo *ref=(LinphoneAuthInfo*)pref;
if (realm_match(info->realm,ref->realm) ) return 0;
return -1;
}
LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, const char *realm, const char *username)
{
LinphoneAuthInfo ref;
MSList *elem;
ref.realm=(char*)realm;
ref.username=(char*)username;
elem=ms_list_find_custom(lc->auth_info,auth_info_compare,(void*)&ref);
if (elem==NULL) {
elem=ms_list_find_custom(lc->auth_info,auth_info_compare_only_realm,(void*)&ref);
if (elem==NULL) return NULL;
LinphoneAuthInfo *ret=NULL,*candidate=NULL;
for (elem=lc->auth_info;elem!=NULL;elem=elem->next){
LinphoneAuthInfo *pinfo=(LinphoneAuthInfo*)elem->data;
if (realm==NULL){
/*return the authinfo for any realm provided that there is only one for that username*/
if (key_match(pinfo->username,username)){
if (ret!=NULL){
ms_warning("There are several auth info for username '%s'",username);
return NULL;
}
ret=pinfo;
}
}else{
/*return the exact authinfo, or an authinfo for which realm was not supplied yet*/
if (pinfo->realm!=NULL){
if (realm_match(pinfo->realm,realm)
&& key_match(pinfo->username,username))
ret=pinfo;
}else{
if (key_match(pinfo->username,username))
candidate=pinfo;
}
}
}
return (LinphoneAuthInfo*)elem->data;
if (ret==NULL && candidate!=NULL)
ret=candidate;
return ret;
}
void linphone_core_add_auth_info(LinphoneCore *lc, LinphoneAuthInfo *info)
{
int n;
MSList *elem;
char *userid;
LinphoneAuthInfo *ai;
if (info->userid==NULL || info->userid[0]=='\0') userid=info->username;
else userid=info->userid;
eXosip_lock();
......@@ -189,14 +193,17 @@ void linphone_core_add_auth_info(LinphoneCore *lc, LinphoneAuthInfo *info)
/* if the user was prompted, re-allow automatic_action */
if (lc->automatic_action>0) lc->automatic_action--;
/* find if we are attempting to modify an existing auth info */
elem=ms_list_find_custom(lc->auth_info,auth_info_compare,info);
if (elem!=NULL){
ai=linphone_core_find_auth_info(lc,info->realm,info->username);
if (ai!=NULL){
elem=ms_list_find(lc->auth_info,ai);
if (elem==NULL){
ms_error("AuthInfo list corruption ?");
return;
}
linphone_auth_info_destroy((LinphoneAuthInfo*)elem->data);
elem->data=(void *)info;
n=ms_list_position(lc->auth_info,elem);
}else {
lc->auth_info=ms_list_append(lc->auth_info,(void *)info);
n=ms_list_size(lc->auth_info)-1;
}
}
......
......@@ -1513,8 +1513,8 @@ void linphone_core_init_media_streams(LinphoneCore *lc){
audio_stream_enable_echo_limiter(lc->audiostream,ELControlMic);
else if (strcasecmp(type,"speaker")==0)
audio_stream_enable_echo_limiter(lc->audiostream,ELControlSpeaker);
audio_stream_enable_gain_control(lc->audiostream,TRUE);
}
audio_stream_enable_gain_control(lc->audiostream,TRUE);
if (linphone_core_echo_cancelation_enabled(lc)){
int len,delay,framesize;
len=lp_config_get_int(lc->config,"sound","ec_tail_len",0);
......@@ -1576,9 +1576,6 @@ static void post_configure_audio_streams(LinphoneCore *lc){
f=st->volrecv;
if (speed==-1) speed=0.02;
if (force==-1) force=5;
}else {
ms_fatal("Should not happen");
return;
}
if (speed!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_SPEED,&speed);
......
......@@ -33,7 +33,7 @@ static void sip_login_init_instance(SipSetupContext *ctx){
static int sip_login_do_login(SipSetupContext * ctx, const char *uri, const char *passwd){
LinphoneProxyConfig *cfg=sip_setup_context_get_proxy_config(ctx);
LinphoneCore *lc=linphone_proxy_config_get_core(cfg);
LinphoneAuthInfo *auth=linphone_auth_info_new(ctx->username,NULL,passwd,NULL,ctx->domain);
LinphoneAuthInfo *auth=linphone_auth_info_new(ctx->username,NULL,passwd,NULL,NULL);
linphone_proxy_config_set_identity(cfg,uri);
linphone_core_add_auth_info(lc,auth);
linphone_proxy_config_enable_register(cfg,TRUE);
......
......@@ -50,7 +50,8 @@ void linphone_gtk_in_call_view_set_calling(const char *uri){
}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_INFO,GTK_ICON_SIZE_DIALOG);
}
void linphone_gtk_in_call_view_set_in_call(const char *uri){
void linphone_gtk_in_call_view_set_in_call(){
LinphoneCore *lc=linphone_gtk_get_core();
GtkWidget *main_window=linphone_gtk_get_main_window();
GtkWidget *status=linphone_gtk_get_widget(main_window,"in_call_status");
GtkWidget *callee=linphone_gtk_get_widget(main_window,"in_call_uri");
......@@ -59,10 +60,27 @@ void linphone_gtk_in_call_view_set_in_call(const char *uri){
GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
GdkPixbufAnimation *pbuf=create_pixbuf_animation("incall_anim.gif");
GtkWidget *terminate_button=linphone_gtk_get_widget(main_window,"in_call_terminate");
const char *uri=linphone_core_get_remote_uri(lc);
osip_from_t *from;
char *displayname=NULL,*id=NULL;
gtk_widget_set_sensitive(terminate_button,TRUE);
gtk_label_set_markup(GTK_LABEL(status),_("<b>In call with</b>"));
uri_label=g_markup_printf_escaped("<span size=\"large\"><i>%s</i></span>", uri);
osip_from_init(&from);
osip_from_parse(from,uri);
if (from->displayname!=NULL && strlen(from->displayname)>0)
displayname=osip_strdup(from->displayname);
if (from->displayname!=NULL) osip_free(from->displayname)
from->displayname=NULL;
osip_from_to_str(from,&id);
osip_from_free(from);
if (displayname!=NULL)
uri_label=g_markup_printf_escaped("<span size=\"large\">%s</span>\n<i>%s</i>",
displayname,id);
else
uri_label=g_markup_printf_escaped("<span size=\"large\"<i>%s</i></span>\n",id);
gtk_label_set_markup(GTK_LABEL(callee),uri_label);
g_free(uri_label);
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
......
......@@ -80,7 +80,7 @@ void linphone_gtk_show_directory_search(void);
void linphone_gtk_show_in_call_view(void);
void linphone_gtk_show_idle_view(void);
void linphone_gtk_in_call_view_set_calling(const char *uri);
void linphone_gtk_in_call_view_set_in_call(const char *uri);
void linphone_gtk_in_call_view_set_in_call(void);
void linphone_gtk_in_call_view_update_duration(int duration);
void linphone_gtk_in_call_view_terminate(const char *error_msg);
void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg);
......@@ -112,4 +112,6 @@ void linphone_gtk_login_frame_connect_clicked(GtkWidget *button){
t=g_timeout_add(50,(GSourceFunc)check_login_ok,cfg);
g_object_set_data(G_OBJECT(mw),"login_tout",GINT_TO_POINTER(t));
}
/*we need to refresh the identities since the proxy config may have changed.*/
linphone_gtk_load_identities();
}
......@@ -401,10 +401,15 @@ static gboolean linphone_gtk_iterate(LinphoneCore *lc){
}
}
if (addr_to_call!=NULL){
GtkWidget *uri_bar=linphone_gtk_get_widget(linphone_gtk_get_main_window(),"uribar");
gtk_entry_set_text(GTK_ENTRY(uri_bar),addr_to_call);
addr_to_call=NULL;
linphone_gtk_start_call(uri_bar);
/*make sure we are not showing the login screen*/
GtkWidget *mw=linphone_gtk_get_main_window();
GtkWidget *login_frame=linphone_gtk_get_widget(mw,"login_frame");
if (!GTK_WIDGET_VISIBLE(login_frame)){
GtkWidget *uri_bar=linphone_gtk_get_widget(mw,"uribar");
gtk_entry_set_text(GTK_ENTRY(uri_bar),addr_to_call);
addr_to_call=NULL;
linphone_gtk_start_call(uri_bar);
}
}
in_iterate=FALSE;
return TRUE;
......@@ -558,7 +563,7 @@ void linphone_gtk_accept_call(GtkWidget *button){
g_object_set_data(G_OBJECT(linphone_gtk_get_main_window()),"incoming_call",NULL);
gtk_widget_destroy(gtk_widget_get_toplevel(button));
linphone_gtk_call_started(linphone_gtk_get_main_window());
linphone_gtk_in_call_view_set_in_call(linphone_core_get_remote_uri(lc));
linphone_gtk_in_call_view_set_in_call();
linphone_gtk_show_in_call_view();
}
......@@ -767,7 +772,7 @@ static void linphone_gtk_general_state(LinphoneCore *lc, LinphoneGeneralState *g
switch(gstate->new_state){
case GSTATE_CALL_OUT_CONNECTED:
case GSTATE_CALL_IN_CONNECTED:
linphone_gtk_in_call_view_set_in_call(linphone_core_get_remote_uri(lc));
linphone_gtk_in_call_view_set_in_call();
break;
case GSTATE_CALL_ERROR:
linphone_gtk_call_terminated(gstate->message);
......
......@@ -958,6 +958,7 @@ Online users</property>
<widget class="GtkLabel" id="in_call_uri">
<property name="visible">True</property>
<property name="label" translatable="yes">label</property>
<property name="justify">center</property>
</widget>
</child>
<child>
......
......@@ -21,7 +21,7 @@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
PACKAGE = @PACKAGE@
VERSION = @VERSION@
SHELL = /bin/sh
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
......@@ -56,7 +56,7 @@ ALL_LINGUAS = @ALL_LINGUAS@
PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi)
USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi)
USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
......
......@@ -10,6 +10,7 @@ gtk-glade/update.c
gtk-glade/buddylookup.c
gtk-glade/setupwizard.c
gtk-glade/incall_view.c
gtk-glade/loginframe.c
gtk-glade/main.glade
gtk-glade/about.glade
gtk-glade/contact.glade
......
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.
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