Commit e84da216 authored by smorlat's avatar smorlat

fix bug when adding contacts

sipsetup plugins work in progress.



git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@298 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent ca70c148
......@@ -653,8 +653,8 @@ void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *lf)
{
ms_return_if_fail(lf->lc==NULL);
ms_return_if_fail(lf->url!=NULL);
linphone_friend_apply(lf,lc);
lc->friends=ms_list_append(lc->friends,lf);
linphone_friend_apply(lf,lc);
return ;
}
......
......@@ -317,7 +317,7 @@ bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj);
#define linphone_proxy_config_get_addr(obj) ((obj)->reg_proxy)
#define linphone_proxy_config_get_expires(obj) ((obj)->expires)
#define linphone_proxy_config_register_enabled(obj) ((obj)->reg_sendregister)
#define linphone_proxy_config_get_core(obj) ((obj)->lc)
/* destruction is called automatically when removing the proxy config */
void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg);
LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(struct _LpConfig *config, int index);
......
......@@ -92,7 +92,7 @@ void linphone_proxy_config_register_again_with_updated_contact(LinphoneProxyConf
ctt->url->port=osip_strdup(rport);
eXosip_register_send_register(obj->rid,msg);
eXosip_unlock();
ms_message("Resending new register with updated contact %s:%i",received,rport);
ms_message("Resending new register with updated contact %s:%s",received,rport);
}
int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr){
......@@ -567,7 +567,7 @@ void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *t
SipSetup *ss=sip_setup_lookup(type);
SipSetupContext *ssc;
if (!ss) return ;
ssc=sip_setup_context_new(ss);
ssc=sip_setup_context_new(ss,cfg);
if (sip_setup_context_login_account(ssc,cfg->reg_identity,NULL)==0){
char proxy[256];
if (sip_setup_context_get_proxy(ssc,NULL,proxy,sizeof(proxy))==0){
......
......@@ -84,11 +84,15 @@ void sip_setup_unregister_all(void){
}
}
LinphoneProxyConfig *sip_setup_context_get_proxy_config(const SipSetupContext *ctx){
return ctx->cfg;
}
SipSetupContext *sip_setup_context_new(SipSetup *s){
SipSetupContext *sip_setup_context_new(SipSetup *s, struct _LinphoneProxyConfig *cfg){
SipSetupContext *obj=(SipSetupContext*)ms_new0(SipSetupContext,1);
obj->funcs=s;
obj->data=NULL;
obj->cfg=cfg;
if (obj->funcs->init_instance){
obj->funcs->init_instance(obj);
}
......
......@@ -30,6 +30,7 @@ struct _BuddyInfo;
struct _SipSetupContext{
struct _SipSetup *funcs;
struct _LinphoneProxyConfig *cfg;
char domain[128];
char username[128];
void *data;
......@@ -98,7 +99,7 @@ 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);
SipSetupContext * sip_setup_context_new(SipSetup *s, struct _LinphoneProxyConfig *cfg);
int sip_setup_context_get_capabilities(SipSetupContext *ctx);
int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, const char *passwd);
int sip_setup_context_get_proxy(SipSetupContext *ctx, const char *domain, char *proxy, size_t sz);
......@@ -110,10 +111,15 @@ int sip_setup_context_get_buddy_lookup_results(SipSetupContext *ctx, MSList **re
void sip_setup_context_free_results(MSList *results);
void sip_setup_context_free(SipSetupContext *ctx);
/*internal methods*/
struct _LinphoneProxyConfig *sip_setup_context_get_proxy_config(const SipSetupContext *ctx);
#ifdef __cplusplus
}
#endif
#endif
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