diff --git a/linphone/coreapi/fonis.c b/linphone/coreapi/fonis.c index 202a9e37a..040f68cbb 100644 --- a/linphone/coreapi/fonis.c +++ b/linphone/coreapi/fonis.c @@ -23,12 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static ms_thread_t fonis_thread; -typedef struct _FonisContext{ - char domain[128]; - char username[128]; -} FonisContext; - - static void *fonis_thread_func(void *arg){ if (p2pproxy_application_start(0,NULL)!=0){ @@ -55,14 +49,6 @@ static int fonis_create_account(const char *uri, const char *passwd){ static int fonis_login_account(SipSetupContext * ctx,const char *uri, const char *passwd){ if (p2pproxy_accountmgt_isValidAccount==P2PPROXY_ACCOUNTMGT_USER_EXIST) { - FonisContext *fc; - osip_from_t *from; - ctx->data=fc=(FonisContext*)ms_new0(FonisContext,1); - osip_from_init(&from); - osip_from_parse(from,uri); - strncpy(fc->domain,uri->url->host,sizeof(fc->domain); - strncpy(fc->username,uri->url->username,sizeof(fc->username)); - osip_from_free(from); return 0; } else return -1; @@ -78,7 +64,7 @@ static int fonis_get_stun_servers(SipSetupContext *ctx, char *stun1, char *stun2 FonisContext *fc=(FonisContext*)ctx->data; int ret=-1; p2pproxy_resourcemgt_resource_list_t* l=p2pproxy_resourcemgt_new_resource_list(); - if (p2pproxy_resourcemgt_lookup_media_resource(l,fc->domain)==0){ + if (p2pproxy_resourcemgt_lookup_media_resource(l,ctx->domain)==0){ if (l->size>0) strncpy(stun1,l->resource_uri[0],size); if (l->size>1) strncpy(stun2,l->resource_uri[1],size); ret=0; @@ -91,7 +77,7 @@ static int fonis_get_stun_relay(SipSetupContext *ctx, char *relay, size_t size){ FonisContext *fc=(FonisContext*)ctx->data; int ret=-1; p2pproxy_resourcemgt_resource_list_t* l=p2pproxy_resourcemgt_new_resource_list(); - if (p2pproxy_resourcemgt_lookup_media_resource(l,fc->domain)==0){ + if (p2pproxy_resourcemgt_lookup_media_resource(l,ctx->domain)==0){ if (l->size>0) strncpy(relay,l->resource_uri[0],size); ret=0; } diff --git a/linphone/coreapi/linphonecore.c b/linphone/coreapi/linphonecore.c index 23b07c2c2..212fc10b6 100644 --- a/linphone/coreapi/linphonecore.c +++ b/linphone/coreapi/linphonecore.c @@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "linphonecore.h" +#include "sipsetup.h" #include "lpconfig.h" #include "private.h" #include "mediastreamer2/mediastream.h" @@ -676,6 +677,7 @@ void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, co lc->rsvp_enable = 1; lc->rpc_enable = 0; #endif + sip_setup_register_all(); sound_config_read(lc); net_config_read(lc); rtp_config_read(lc); @@ -1050,6 +1052,33 @@ static osip_to_t *osip_to_create(const char *to){ return ret; } +static char *guess_route_if_any(LinphoneCore *lc, osip_to_t *parsed_url){ + const MSList *elem=linphone_core_get_proxy_config_list(lc); + for(;elem!=NULL;elem=elem->next){ + LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data; + char prx[256]; + if (cfg->ssctx && sip_setup_context_get_proxy(cfg->ssctx,parsed_url->url->host,prx,sizeof(prx))==0){ + ms_message("We have a proxy for domain %s",parsed_url->url->host); + if (strcmp(parsed_url->url->host,prx)!=0){ + char *route=NULL; + osip_route_t *rt; + osip_route_init(&rt); + if (osip_route_parse(rt,prx)==0){ + char *rtstr; + osip_uri_uparam_add(rt->url,osip_strdup("lr"),NULL); + osip_route_to_str(rt,&rtstr); + route=ms_strdup(rtstr); + osip_free(rtstr); + } + osip_route_free(rt); + ms_message("Adding a route: %s",route); + return route; + } + } + } + return NULL; +} + bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **real_url, osip_to_t **real_parsed_url, char **route){ enum_lookup_res_t *enumres=NULL; osip_to_t *parsed_url=NULL; @@ -1113,6 +1142,7 @@ bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **rea } else *route=ms_strdup(tmproute); #else + if (tmproute==NULL) *route=guess_route_if_any(lc,*real_parsed_url); if (tmproute) *route=ms_strdup(tmproute); #endif return TRUE; @@ -1124,6 +1154,7 @@ bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **rea if (real_parsed_url!=NULL) *real_parsed_url=parsed_url; else osip_to_free(parsed_url); if (tmproute) *route=ms_strdup(tmproute); + else *route=guess_route_if_any(lc,*real_parsed_url); return TRUE; } /* else we could not do anything with url given by user, so display an error */ @@ -2325,7 +2356,7 @@ void linphone_core_uninit(LinphoneCore *lc) ui_config_uninit(lc); lp_config_sync(lc->config); lp_config_destroy(lc->config); - + sip_setup_unregister_all(); #ifdef VIDEO_ENABLED if (payload_type_h264_packetization_mode_1!=NULL) payload_type_destroy(payload_type_h264_packetization_mode_1); diff --git a/linphone/coreapi/linphonecore.h b/linphone/coreapi/linphonecore.h index 0b32e62f6..4a3be0c8e 100644 --- a/linphone/coreapi/linphonecore.h +++ b/linphone/coreapi/linphonecore.h @@ -141,6 +141,7 @@ typedef struct autoreplier_config struct _LinphoneCore; struct _sdp_context; +struct _SipSetupContext; typedef struct _StreamParams { @@ -285,6 +286,7 @@ typedef struct _LinphoneProxyConfig int reg_time; int rid; char *type; + struct _SipSetupContext *ssctx; bool_t frozen; bool_t reg_sendregister; bool_t auth_pending; diff --git a/linphone/coreapi/misc.c b/linphone/coreapi/misc.c index bd0ea6ba9..5b1634361 100644 --- a/linphone/coreapi/misc.c +++ b/linphone/coreapi/misc.c @@ -572,7 +572,7 @@ static int recvStunResponse(ortp_socket_t sock, char *ipaddr, int *port, int *id void linphone_core_run_stun_tests(LinphoneCore *lc, LinphoneCall *call){ const char *server=linphone_core_get_stun_server(lc); - + if (lc->sip_conf.ipv6_enabled){ ms_warning("stun support is not implemented for ipv6"); return; diff --git a/linphone/coreapi/proxy.c b/linphone/coreapi/proxy.c index 95c005bf8..07c8d06e2 100644 --- a/linphone/coreapi/proxy.c +++ b/linphone/coreapi/proxy.c @@ -19,6 +19,7 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org) */ #include "linphonecore.h" +#include "sipsetup.h" #include #include #include "lpconfig.h" @@ -42,6 +43,7 @@ void linphone_proxy_config_destroy(LinphoneProxyConfig *obj){ if (obj->reg_proxy!=NULL) ms_free(obj->reg_proxy); if (obj->reg_identity!=NULL) ms_free(obj->reg_identity); if (obj->reg_route!=NULL) ms_free(obj->reg_route); + if (obj->ssctx!=NULL) sip_setup_context_free(obj->ssctx); } static void linphone_proxy_config_register(LinphoneProxyConfig *obj){ @@ -503,6 +505,9 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC if (obj==NULL){ return; } + if (obj->type!=NULL){ + lp_config_set_string(config,key,"type",obj->type); + } if (obj->reg_proxy!=NULL){ lp_config_set_string(config,key,"reg_proxy",obj->reg_proxy); } @@ -520,6 +525,8 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LpConfig *config, int index) { const char *tmp; + const char *identity; + const char *proxy; LinphoneProxyConfig *cfg; char key[50]; @@ -528,17 +535,23 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LpConfig *config if (!lp_config_has_section(config,key)){ return NULL; } - tmp=lp_config_get_string(config,key,"reg_proxy",NULL); - if (tmp==NULL) return NULL; - cfg=linphone_proxy_config_new(); - linphone_proxy_config_set_server_addr(cfg,tmp); + identity=lp_config_get_string(config,key,"reg_identity",NULL); + tmp=lp_config_get_string(config,key,"type",NULL); + proxy=lp_config_get_string(config,key,"reg_proxy",NULL); + if (tmp!=NULL && strlen(tmp)>0){ + cfg=linphone_proxy_config_new_from_setup(tmp,identity); + if (cfg==NULL) return NULL; + }else{ + if (!identity || !proxy) return NULL; + cfg=linphone_proxy_config_new(); + linphone_proxy_config_set_identity(cfg,identity); + linphone_proxy_config_set_server_addr(cfg,proxy); + } + tmp=lp_config_get_string(config,key,"reg_route",NULL); if (tmp!=NULL) linphone_proxy_config_set_route(cfg,tmp); - - tmp=lp_config_get_string(config,key,"reg_identity",NULL); - if (tmp!=NULL) linphone_proxy_config_set_identity(cfg,tmp); - + linphone_proxy_config_expires(cfg,lp_config_get_int(config,key,"reg_expires",600)); linphone_proxy_config_enableregister(cfg,lp_config_get_int(config,key,"reg_sendregister",0)); @@ -548,7 +561,21 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LpConfig *config } LinphoneProxyConfig *linphone_proxy_config_new_from_setup(const char *type, const char *identity){ - return NULL; + SipSetup *ss=sip_setup_lookup(type); + LinphoneProxyConfig *cfg; + SipSetupContext *ssc; + if (!ss) return NULL; + cfg=linphone_proxy_config_new(); + linphone_proxy_config_set_identity(cfg,identity); + ssc=sip_setup_context_new(ss); + if (sip_setup_context_login_account(ssc,identity,NULL)==0){ + char proxy[256]; + if (sip_setup_context_get_proxy(ssc,NULL,proxy,sizeof(proxy))==0){ + linphone_proxy_config_set_server_addr(cfg,proxy); + } + } + cfg->ssctx=ssc; + return cfg; } diff --git a/linphone/coreapi/sipsetup.c b/linphone/coreapi/sipsetup.c index f5b52e352..af80ea48f 100644 --- a/linphone/coreapi/sipsetup.c +++ b/linphone/coreapi/sipsetup.c @@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern SipSetup fonis_sip_setup; #endif +void sip_setup_register_all(void){ +} SipSetup *sip_setup_lookup(const char *type_name){ #ifdef HAVE_FONIS @@ -40,8 +42,16 @@ SipSetup *sip_setup_lookup(const char *type_name){ return NULL; } +void sip_setup_unregister_all(void){ +#ifdef HAVE_FONIS + if (fonis_sip_setup.initialized) + fonis_sip_setup.exit(); +#endif +} + + SipSetupContext *sip_setup_context_new(SipSetup *s){ - SipSetupContext *obj=(SipSetupContext*)ms_new(SipSetupContext,1); + SipSetupContext *obj=(SipSetupContext*)ms_new0(SipSetupContext,1); obj->funcs=s; obj->data=NULL; return obj; @@ -54,6 +64,12 @@ int sip_setup_new_account(SipSetup *funcs, const char *uri, const char *passwd){ } int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, const char *passwd){ + osip_from_t *from; + osip_from_init(&from); + osip_from_parse(from,uri); + strncpy(ctx->domain,from->url->host,sizeof(ctx->domain)); + strncpy(ctx->username,from->url->username,sizeof(ctx->username)); + osip_from_free(from); if (ctx->funcs->login_account) return ctx->funcs->login_account(ctx,uri,passwd); return -1; @@ -61,7 +77,7 @@ int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, cons int sip_setup_context_get_proxy(SipSetupContext *ctx, const char *domain, char *proxy, size_t sz){ if (ctx->funcs->get_proxy) - return ctx->funcs->get_proxy(ctx,domain,proxy,sz); + return ctx->funcs->get_proxy(ctx,domain ? domain : ctx->domain,proxy,sz); return -1; } diff --git a/linphone/coreapi/sipsetup.h b/linphone/coreapi/sipsetup.h index d362bf8db..48e763c72 100644 --- a/linphone/coreapi/sipsetup.h +++ b/linphone/coreapi/sipsetup.h @@ -26,6 +26,8 @@ struct _SipSetup; struct _SipSetupContext{ struct _SipSetup *funcs; + char domain[128]; + char username[128]; void *data; }; @@ -45,7 +47,9 @@ struct _SipSetup{ typedef struct _SipSetup SipSetup; +void sip_setup_register_all(void); SipSetup *sip_setup_lookup(const char *type_name); +void sip_setup_unregister_all(void); int sip_setup_new_account(SipSetup *s, const char *uri, const char *passwd); SipSetupContext * sip_setup_context_new(SipSetup *s); diff --git a/linphone/gtk-glade/fonis.c b/linphone/gtk-glade/fonis.c new file mode 100644 index 000000000..dbcbf6853 --- /dev/null +++ b/linphone/gtk-glade/fonis.c @@ -0,0 +1,22 @@ +/* +linphone, gtk-glade interface. +Copyright (C) 2008 Simon MORLAT (simon.morlat@linphone.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + +#include "linphone.h" + diff --git a/linphone/gtk-glade/main.c b/linphone/gtk-glade/main.c index b13d17660..7c868895c 100644 --- a/linphone/gtk-glade/main.c +++ b/linphone/gtk-glade/main.c @@ -41,6 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define LINPHONE_ICON "linphone2.png" +const char *this_program_ident_string="linphone_ident_string=" LINPHONE_VERSION; + static LinphoneCore *the_core=NULL; static GtkWidget *the_ui=NULL; @@ -128,6 +130,52 @@ GtkWidget *linphone_gtk_get_main_window(){ return the_ui; } +static void parse_item(const char *item, const char *window_name, GtkWidget *w){ + char tmp[64]; + char *dot; + strcpy(tmp,item); + dot=strchr(tmp,'.'); + if (dot){ + *dot='\0'; + dot++; + if (strcmp(window_name,tmp)==0){ + GtkWidget *wd=linphone_gtk_get_widget(w,dot); + if (wd) gtk_widget_hide(wd); + } + } +} + +static void parse_hiddens(const char *hiddens, const char *window_name, GtkWidget *w){ + char item[64]; + const char *i; + const char *b; + int len; + for(b=i=hiddens;*i!='\0';++i){ + if (*i==' '){ + len=MIN(i-b,sizeof(item)-1); + strncpy(item,b,len); + item[len]='\0'; + b=i+1; + parse_item(item,window_name,w); + } + } + len=MIN(i-b,sizeof(item)-1); + if (len>0){ + strncpy(item,b,len); + item[len]='\0'; + parse_item(item,window_name,w); + } +} + +static void linphone_gtk_configure_window(GtkWidget *w, const char *window_name){ + const char *hiddens; + if (linphone_gtk_get_core()==NULL) return; + hiddens=linphone_gtk_get_ui_config("hidden_widgets",NULL); + if (hiddens){ + parse_hiddens(hiddens,window_name,w); + } +} + #ifdef USE_LIBGLADE GtkWidget *linphone_gtk_create_window(const char *window_name){ @@ -147,6 +195,7 @@ GtkWidget *linphone_gtk_create_window(const char *window_name){ glade_xml_signal_autoconnect(gxml); w=glade_xml_get_widget(gxml,window_name); if (w==NULL) g_error("Could not retrieve '%s' window from xml file",window_name); + linphone_gtk_configure_window(w,window_name); return w; } @@ -355,9 +404,24 @@ static void completion_add_text(GtkEntry *entry, const char *text){ save_uri_history(); } +static void linphone_gtk_call_terminated(GtkWidget *mw){ + gtk_widget_hide(linphone_gtk_get_widget(mw,"terminate_call")); + gtk_widget_show(linphone_gtk_get_widget(mw,"start_call")); + g_object_set_data(G_OBJECT(mw),"incoming_call",NULL); +} + +gboolean check_call_active(){ + if (!linphone_core_in_call(linphone_gtk_get_core())){ + linphone_gtk_call_terminated(linphone_gtk_get_main_window()); + return FALSE; + } + return TRUE; +} + static void linphone_gtk_call_started(GtkWidget *mw){ gtk_widget_hide(linphone_gtk_get_widget(mw,"start_call")); gtk_widget_show(linphone_gtk_get_widget(mw,"terminate_call")); + g_timeout_add(250,(GSourceFunc)check_call_active,NULL); } void linphone_gtk_start_call(GtkWidget *w){ @@ -379,12 +443,6 @@ void linphone_gtk_uri_bar_activate(GtkWidget *w){ } -static void linphone_gtk_call_terminated(GtkWidget *mw){ - gtk_widget_hide(linphone_gtk_get_widget(mw,"terminate_call")); - gtk_widget_show(linphone_gtk_get_widget(mw,"start_call")); - g_object_set_data(G_OBJECT(mw),"incoming_call",NULL); -} - void linphone_gtk_terminate_call(GtkWidget *button){ linphone_core_terminate_call(linphone_gtk_get_core(),NULL); linphone_gtk_call_terminated(gtk_widget_get_toplevel(button)); @@ -727,28 +785,37 @@ static void linphone_gtk_check_menu_items(void){ static void linphone_gtk_configure_main_window(){ static gboolean config_loaded=FALSE; - static gboolean show_digits=1; - static gboolean show_identities=1; static const char *title; static const char *home; static const char *icon_path; + static const char *start_call_icon; + static const char *stop_call_icon; GtkWidget *w=linphone_gtk_get_main_window(); if (!config_loaded){ - show_digits=linphone_gtk_get_ui_config_int("show_digits",1); - show_identities=linphone_gtk_get_ui_config_int("identity_frame",1); title=linphone_gtk_get_ui_config("title",NULL); home=linphone_gtk_get_ui_config("home","http://www.linphone.org"); icon_path=linphone_gtk_get_ui_config("icon",NULL); + start_call_icon=linphone_gtk_get_ui_config("start_call_icon",NULL); + stop_call_icon=linphone_gtk_get_ui_config("stop_call_icon",NULL); config_loaded=TRUE; } - if (show_digits==FALSE) gtk_widget_hide(linphone_gtk_get_widget(w,"dialpad")); - if (show_identities==FALSE) gtk_widget_hide(linphone_gtk_get_widget(w,"identity_frame")); + linphone_gtk_configure_window(w,"main_window"); if (title) gtk_window_set_title(GTK_WINDOW(w),title); if (icon_path) { GdkPixbuf *pbuf=create_pixbuf(icon_path); gtk_window_set_icon(GTK_WINDOW(w),pbuf); g_object_unref(G_OBJECT(pbuf)); } + if (start_call_icon){ + GdkPixbuf *pbuf=create_pixbuf(start_call_icon); + gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"start_call_icon")),pbuf); + g_object_unref(G_OBJECT(pbuf)); + } + if (stop_call_icon){ + GdkPixbuf *pbuf=create_pixbuf(stop_call_icon); + gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"terminate_call_icon")),pbuf); + g_object_unref(G_OBJECT(pbuf)); + } if (home){ gchar *tmp; GtkWidget *menu_item=linphone_gtk_get_widget(w,"home_item"); diff --git a/linphone/gtk-glade/main.glade b/linphone/gtk-glade/main.glade index 743605db1..1518ae532 100644 --- a/linphone/gtk-glade/main.glade +++ b/linphone/gtk-glade/main.glade @@ -1,6 +1,6 @@ - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -205,14 +205,14 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-close - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Terminate call @@ -244,14 +244,14 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-go-forward - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Start call @@ -318,7 +318,7 @@ Lookup: - 8 + 12 @@ -329,11 +329,12 @@ + 4 1 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK in @@ -353,6 +354,7 @@ Online users + 4 3 @@ -426,175 +428,77 @@ Online users 4 True - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - D + 1 0 - 3 - 4 - 3 - 4 - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - # - 0 - - - 2 - 3 - 3 - 4 - - - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 + 2 0 1 2 - 3 - 4 - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - * - 0 - - - 3 - 4 - - - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - C - 0 - - - 3 - 4 - 2 - 3 - - - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 9 + 3 0 2 3 - 2 - 3 - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 0 - - - 1 - 2 - 2 - 3 - - - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 7 - 0 - - - 2 - 3 - - - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - B + A 0 3 4 - 1 - 2 - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 + 4 0 - 2 - 3 1 2 @@ -620,15 +524,17 @@ Online users - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 4 + 6 0 + 2 + 3 1 2 @@ -636,63 +542,159 @@ Online users - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - A + B 0 3 4 + 1 + 2 - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 + 7 0 - 2 - 3 + 2 + 3 - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 + 8 0 1 2 + 2 + 3 - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 + 9 0 + 2 + 3 + 2 + 3 + + + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + C + 0 + + + 3 + 4 + 2 + 3 + + + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + * + 0 + + + 3 + 4 + + + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 + + + 1 + 2 + 3 + 4 + + + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + # + 0 + + + 2 + 3 + 3 + 4 + + + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + D + 0 + + + 3 + 4 + 3 + 4 @@ -734,19 +736,40 @@ Online users GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Default - + 12 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Default + + + + + + True + True + True + 0 + + + + + + + False + 1 + + @@ -773,34 +796,14 @@ Online users - + True - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 - - - - - True - True - True - 0 - - - - - - - False - 1 - - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 False + False 2 diff --git a/linphone/gtk-glade/p2pwizard.glade b/linphone/gtk-glade/p2pwizard.glade new file mode 100644 index 000000000..feca4d495 --- /dev/null +++ b/linphone/gtk-glade/p2pwizard.glade @@ -0,0 +1,138 @@ + + + + + + Creating a FONICS account + + + + + True + WARNING: experimental feature ! + +FONICS stands for Free Overlay Network for Interactive Communication Systems +Based on SIP and Peer to Peer technologies, it allows people to find each other through the help of a virtual network. +Once you and your friends registered, you'll be able to call each other simply by entering your friend's username in linphone's sip uri box. +Read more information about FONICS at http://www.fonics.org + + True + GTK_JUSTIFY_CENTER + True + True + + + GTK_ASSISTANT_PAGE_INTRO + Introduction + + + + + True + + + True + Please choose a username: + + + + + True + 0 + + + True + 12 + + + True + + + True + + + True + True + + + + + True + True + True + 0 + + + + True + + + True + gtk-apply + + + + + True + Check availability + + + 1 + + + + + + + False + 1 + + + + + False + + + + + True + + + 1 + + + + + + + + + True + True + + + label_item + + + + + 1 + + + + + Create your account ! + + + + + True + Done ! Your account is now created and ready to use. + + + GTK_ASSISTANT_PAGE_CONFIRM + Finished ! + + + + diff --git a/linphone/gtk-glade/update.c b/linphone/gtk-glade/update.c index 873ce9d34..9e43cf6c9 100755 --- a/linphone/gtk-glade/update.c +++ b/linphone/gtk-glade/update.c @@ -25,35 +25,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static int linphone_gtk_get_new_version(const char *version_url, char *version, size_t size){ DWORD dwSize = 0; - DWORD dwDownloaded = 0; - LPSTR pszOutBuffer; - BOOL bResults = FALSE; - HINTERNET hSession = NULL, - hConnect = NULL; - int ret=-1; - + DWORD dwDownloaded = 0; + LPSTR pszOutBuffer; + BOOL bResults = FALSE; + HINTERNET hSession = NULL, hConnect = NULL; + int ret=-1; + hSession=InternetOpen("Linphone",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0); - + if (hSession==NULL) return -1; hConnect=InternetOpenUrl(hSession,version_url,NULL,0,0,0); - + if (hConnect==NULL) { InternetCloseHandle(hSession); return -1; } - - if (InternetReadFile(hConnect,version,size,&dwDownloaded)){ + dwDownloaded=0; + if (InternetReadFile(hConnect,version,size,&dwDownloaded) && dwDownloaded>0){ version[dwDownloaded]='\0'; - ms_message("Got response: %s", version); - ret=0; + ms_message("Got response: %s", version); + ret=0; } - - - // Close any open handles. - if (hConnect) InternetCloseHandle(hConnect); - if (hSession) InternetCloseHandle(hSession); - return ret; + + // Close any open handles. + if (hConnect) InternetCloseHandle(hConnect); + if (hSession) InternetCloseHandle(hSession); + return ret; } #else