Commit 1053f368 authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

Improved doxygen documentation of C wrapper API

parent 2c89761b
......@@ -1146,7 +1146,7 @@ lpc_cmd_proxy(LinphoneCore *lc, char *args)
else linphonec_out("Current default proxy is %d.\n", proxynum);
}
}else if (strcmp(arg1, "unuse")==0){
linphone_core_set_default_proxy(lc, NULL);
linphone_core_set_default_proxy_config(lc, NULL);
linphonec_out("Use no proxy.\n");
}
......@@ -1288,11 +1288,11 @@ static int lpc_cmd_soundcard(LinphoneCore *lc, char *args)
if (strcmp(arg2, "files")==0)
{
linphonec_out("Using wav files instead of soundcard.\n");
linphone_core_use_files(lc,TRUE);
linphone_core_set_use_files(lc,TRUE);
return 1;
}
linphone_core_use_files(lc,FALSE);
linphone_core_set_use_files(lc,FALSE);
dev=linphone_core_get_sound_devices(lc);
index=atoi(arg2); /* FIXME: handle not-a-number */
......@@ -1572,7 +1572,7 @@ linphonec_proxy_add(LinphoneCore *lc)
{
linphonec_out("Invalid sip address (sip:sip.domain.tld).\n");
free(input);
linphone_proxy_config_destroy(cfg);
linphone_proxy_config_unref(cfg);
continue;
}
free(input);
......@@ -1589,7 +1589,7 @@ linphonec_proxy_add(LinphoneCore *lc)
if ( ! input ) {
linphonec_out("Aborted.\n");
linphone_proxy_config_destroy(cfg);
linphone_proxy_config_unref(cfg);
return;
}
......@@ -1600,13 +1600,15 @@ linphonec_proxy_add(LinphoneCore *lc)
continue;
}
linphone_proxy_config_set_identity(cfg, clean);
LinphoneAddress *identity = linphone_address_new(clean);
linphone_proxy_config_set_identity_address(cfg, identity);
if ( ! linphone_proxy_config_get_identity (cfg))
{
linphonec_out("Invalid identity (sip:name@sip.domain.tld).\n");
free(input);
continue;
}
if (identity) linphone_address_unref(identity);
free(input);
break;
}
......@@ -1621,7 +1623,7 @@ linphonec_proxy_add(LinphoneCore *lc)
if ( ! input ) {
linphonec_out("Aborted.\n");
linphone_proxy_config_destroy(cfg);
linphone_proxy_config_unref(cfg);
return;
}
......@@ -1657,7 +1659,7 @@ linphonec_proxy_add(LinphoneCore *lc)
if ( ! input ) {
linphonec_out("Aborted.\n");
linphone_proxy_config_destroy(cfg);
linphone_proxy_config_unref(cfg);
return;
}
......@@ -1682,7 +1684,7 @@ linphonec_proxy_add(LinphoneCore *lc)
if ( ! input ) {
linphonec_out("Aborted.\n");
linphone_proxy_config_destroy(cfg);
linphone_proxy_config_unref(cfg);
return;
}
......@@ -1722,7 +1724,7 @@ linphonec_proxy_add(LinphoneCore *lc)
if ( ! input ) {
linphonec_out("Aborted.\n");
linphone_proxy_config_destroy(cfg);
linphone_proxy_config_unref(cfg);
return;
}
......@@ -1737,7 +1739,7 @@ linphonec_proxy_add(LinphoneCore *lc)
else if ( ! strcmp(clean, "no") )
{
linphonec_out("Declined.\n");
linphone_proxy_config_destroy(cfg);
linphone_proxy_config_unref(cfg);
free(input);
return;
}
......@@ -1751,7 +1753,7 @@ linphonec_proxy_add(LinphoneCore *lc)
linphone_core_add_proxy_config(lc,cfg);
/* automatically set the last entered proxy as the default one */
linphone_core_set_default_proxy(lc,cfg);
linphone_core_set_default_proxy_config(lc,cfg);
linphonec_out("Proxy added.\n");
}
......@@ -1760,14 +1762,15 @@ static void
linphonec_proxy_display(LinphoneProxyConfig *cfg)
{
const char *route=linphone_proxy_config_get_route(cfg);
const char *identity=linphone_proxy_config_get_identity(cfg);
char *identity=linphone_address_as_string(linphone_proxy_config_get_identity_address(cfg));
linphonec_out("sip address: %s\nroute: %s\nidentity: %s\nregister: %s\nexpires: %i\nregistered: %s\n",
linphone_proxy_config_get_addr(cfg),
(route!=NULL)? route:"",
(identity!=NULL)?identity:"",
linphone_proxy_config_register_enabled (cfg)?"yes":"no",
linphone_proxy_config_get_expires (cfg),
linphone_proxy_config_is_registered(cfg) ? "yes" : "no");
linphone_proxy_config_get_state(cfg) == LinphoneRegistrationOk ? "yes" : "no");
ms_free(identity);
}
static void linphonec_proxy_show(LinphoneCore *lc, int index)
......@@ -1828,7 +1831,7 @@ linphonec_proxy_use(LinphoneCore *lc, int index)
linphonec_out("No such proxy (try 'proxy list').");
return 0;
}
linphone_core_set_default_proxy(lc,cfg);
linphone_core_set_default_proxy_config(lc,cfg);
return 1;
}
......@@ -1959,7 +1962,7 @@ static int lpc_cmd_register(LinphoneCore *lc, char *args){
LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(lc);
if (cfg)
{
if(!linphone_proxy_config_is_registered(cfg)) {
if(linphone_proxy_config_get_state(cfg) != LinphoneRegistrationOk) {
linphone_proxy_config_enable_register(cfg,TRUE);
linphone_proxy_config_done(cfg);
}else{
......@@ -1993,18 +1996,20 @@ static int lpc_cmd_register(LinphoneCore *lc, char *args){
linphone_proxy_config_edit(cfg);
}
else cfg=linphone_core_create_proxy_config(lc);
linphone_proxy_config_set_identity(cfg,identity);
LinphoneAddress *addr = linphone_address_new(identity);
linphone_proxy_config_set_identity_address(cfg,addr);
if (addr) linphone_address_unref(addr);
linphone_proxy_config_set_server_addr(cfg,proxy);
linphone_proxy_config_enable_register(cfg,TRUE);
if (elem) linphone_proxy_config_done(cfg);
else linphone_core_add_proxy_config(lc,cfg);
linphone_core_set_default_proxy(lc,cfg);
linphone_core_set_default_proxy_config(lc,cfg);
return 1;
}
static int lpc_cmd_unregister(LinphoneCore *lc, char *args){
LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(lc);
if (cfg && linphone_proxy_config_is_registered(cfg)) {
if (cfg && linphone_proxy_config_get_state(cfg) == LinphoneRegistrationOk) {
linphone_proxy_config_edit(cfg);
linphone_proxy_config_enable_register(cfg,FALSE);
linphone_proxy_config_done(cfg);
......@@ -2036,7 +2041,7 @@ static int lpc_cmd_status(LinphoneCore *lc, char *args)
{
if (cfg)
{
if (linphone_proxy_config_is_registered(cfg)){
if (linphone_proxy_config_get_state(cfg) == LinphoneRegistrationOk){
linphonec_out("registered, identity=%s duration=%i\n",
linphone_proxy_config_get_identity(cfg),
linphone_proxy_config_get_expires(cfg));
......@@ -2048,7 +2053,7 @@ static int lpc_cmd_status(LinphoneCore *lc, char *args)
}
else if (strstr(args,"autoanswer"))
{
if (cfg && linphone_proxy_config_is_registered(cfg))
if (cfg && linphone_proxy_config_get_state(cfg) == LinphoneRegistrationOk)
linphonec_out("autoanswer=%i\n",linphonec_get_autoanswer());
else linphonec_out("unregistered\n");
}
......
......@@ -73,8 +73,10 @@ static const char* ha1_for_passwd(const char* username, const char* realm, const
static unsigned int validate_uri(const char* username, const char* domain, const char* display_name) {
LinphoneAddress* addr;
unsigned int status = 0;
LinphoneProxyConfig* proxy = linphone_proxy_config_new();
linphone_proxy_config_set_identity(proxy, "sip:?@domain.com");
LinphoneProxyConfig* proxy = linphone_core_create_proxy_config(NULL);
addr = linphone_address_new("sip:?@domain.com");
linphone_proxy_config_set_identity_address(proxy, addr);
if (addr) linphone_address_unref(addr);
if (username) {
addr = linphone_proxy_config_normalize_sip_uri(proxy, username);
......@@ -96,7 +98,7 @@ static unsigned int validate_uri(const char* username, const char* domain, const
}
linphone_address_unref(addr);
end:
linphone_proxy_config_destroy(proxy);
linphone_proxy_config_unref(proxy);
return status;
}
......@@ -127,7 +129,7 @@ static char* _get_identity(const LinphoneAccountCreator *creator) {
identity = linphone_address_as_string(addr);
linphone_address_unref(addr);
end:
linphone_proxy_config_destroy(proxy);
linphone_proxy_config_unref(proxy);
}
return identity;
}
......@@ -186,7 +188,7 @@ LinphoneProxyConfig * linphone_account_creator_create_proxy_config(const Linphon
if (linphone_core_add_proxy_config(creator->core, cfg) != -1) {
if (creator->set_as_default) {
linphone_core_set_default_proxy(creator->core, cfg);
linphone_core_set_default_proxy_config(creator->core, cfg);
}
return cfg;
}
......
......@@ -76,10 +76,10 @@
* @brief Managing proxies.
*
* User registration is controled by #LinphoneProxyConfig settings.<br> Each #LinphoneProxyConfig object can be configured with registration informations
* like \link linphone_proxy_config_set_server_addr() proxy address \endlink , \link linphone_proxy_config_set_identity() user id \endlink, \link linphone_proxy_config_expires()
* like \link linphone_proxy_config_set_server_addr() proxy address \endlink , \link linphone_proxy_config_set_identity_address() user id \endlink, \link linphone_proxy_config_expires()
* refresh period \endlink, and so on.
* <br> A created proxy config using linphone_proxy_config_new(), once configured, must be added to #LinphoneCore using function linphone_core_add_proxy_config().
* <br> It is recommended to set a default \link #LinphoneProxyConfig proxy config \endlink using function linphone_core_set_default_proxy(). Once done, if \link #LinphoneProxyConfig
* <br> A created proxy config using linphone_core_create_proxy_config(lc), once configured, must be added to #LinphoneCore using function linphone_core_add_proxy_config().
* <br> It is recommended to set a default \link #LinphoneProxyConfig proxy config \endlink using function linphone_core_set_default_proxy_config(). Once done, if \link #LinphoneProxyConfig
* a proxy config \endlink has been configured with attribute \link linphone_proxy_config_enable_register() enable register \endlink , next call to linphone_core_iterate() triggers
* a SIP register.
* <br> Registration status is reported by LinphoneCoreRegistrationStateChangedCb.
......@@ -89,7 +89,7 @@
*
* LinphoneProxyConfig* proxy_cfg;
* /*create proxy config*/
* proxy_cfg = linphone_proxy_config_new();
* proxy_cfg = linphone_core_create_proxy_config(lc);
* /*parse identity*/
* LinphoneAddress *from = linphone_address_new("sip:toto@sip.titi.com");
* LinphoneAuthInfo *info;
......@@ -98,14 +98,14 @@
* linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
* }
* // configure proxy entries
* linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
* linphone_proxy_config_set_identity_address(proxy_cfg,identity); /*set identity with user name and domain*/
* const char* server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
* linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
* linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
* linphone_address_destroy(from); /*release resource*/
*
* linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
* linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/ \endcode
* linphone_core_set_default_proxy_config(lc,proxy_cfg); /*set to default proxy*/ \endcode
*<br>
* Registration sate call back:
\code
......@@ -154,7 +154,7 @@
* <br>Here under a typical buddy creation:
* <br>
* \code
* LinphoneFriend* my_friend=linphone_friend_new_with_addr("sip:joe@sip.linphone.org"); /*creates friend object for buddy joe*/
* LinphoneFriend* my_friend=linphone_core_create_friend_with_address("sip:joe@sip.linphone.org"); /*creates friend object for buddy joe*/
* linphone_friend_enable_subscribes(my_friend,TRUE); /*configure this friend to emit SUBSCRIBE message after being added to LinphoneCore*/
* linphone_friend_set_inc_subscribe_policy(my_friend,LinphoneSPAccept); /* accept Incoming subscription request for this friend*/
* \endcode
......@@ -299,7 +299,7 @@ and register a keep-alive handler for periodically refreshing the registration.
linphone_core_refresh_registers(theLinphoneCore);
//wait for registration answer
int i=0;
while (!linphone_proxy_config_is_registered(proxyCfg) && i++<40 ) {
while (!linphone_proxy_config_get_state(proxyCfg) == LinphoneRegistrationOk && i++<40 ) {
linphone_core_iterate(theLinphoneCore);
usleep(100000);
}
......
......@@ -12,7 +12,7 @@ Here under a typical buddy creation:
.. code-block:: c
LinphoneFriend* my_friend=linphone_friend_new_with_addr("sip:joe@sip.linphone.org"); /*creates friend object for buddy joe*/
LinphoneFriend* my_friend=linphone_core_create_friend_with_address("sip:joe@sip.linphone.org"); /*creates friend object for buddy joe*/
linphone_friend_enable_subscribes(my_friend,TRUE); /*configure this friend to emit SUBSCRIBE message after being added to LinphoneCore*/
linphone_friend_set_inc_subscribe_policy(my_friend,LinphoneSPAccept); /* accept Incoming subscription request for this friend*/
......
......@@ -43,7 +43,7 @@ The speudo code below shows how to register a keep alive handler:
linphone_core_refresh_registers(theLinphoneCore);
//wait for registration answer
int i=0;
while (!linphone_proxy_config_is_registered(proxyCfg) && i++<40 ) {
while (!linphone_proxy_config_get_state(prpxyCfg) == LinphoneRegistrationOk && i++<40 ) {
linphone_core_iterate(theLinphoneCore);
usleep(100000);
}
......
......@@ -20,7 +20,7 @@ This pseudo code demonstrates basic registration operations:
LinphoneProxyConfig* proxy_cfg;
/*create proxy config*/
proxy_cfg = linphone_proxy_config_new();
proxy_cfg = linphone_core_create_proxy_config(lc);
/*parse identity*/
LinphoneAddress *from = linphone_address_new("sip:toto@sip.titi.com");
LinphoneAuthInfo *info;
......@@ -29,14 +29,14 @@ This pseudo code demonstrates basic registration operations:
linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
}
// configure proxy entries
linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
linphone_proxy_config_set_identity_address(proxy_cfg,from); /*set identity with user name and domain*/
const char* server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_address_destroy(from); /*release resource*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
linphone_core_set_default_proxy_config(lc,proxy_cfg); /*set to default proxy*/
Registration state call back:
......
......@@ -127,7 +127,7 @@ int main(int argc, char *argv[]){
/*sip proxy might be requested*/
if (identity != NULL) {
/*create proxy config*/
LinphoneProxyConfig* proxy_cfg = linphone_proxy_config_new();
LinphoneProxyConfig* proxy_cfg = linphone_core_create_proxy_config(NULL);
/*parse identity*/
LinphoneAddress *from = linphone_address_new(identity);
LinphoneAuthInfo *info;
......@@ -141,14 +141,14 @@ int main(int argc, char *argv[]){
}
// configure proxy entries
linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
linphone_proxy_config_set_identity_address(proxy_cfg,from); /*set identity with user name and domain*/
linphone_proxy_config_set_server_addr(proxy_cfg,linphone_address_get_domain(from)); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_proxy_config_enable_publish(proxy_cfg,TRUE); /* enable presence satus publication for this proxy*/
linphone_address_unref(from); /*release resource*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
linphone_core_set_default_proxy_config(lc,proxy_cfg); /*set to default proxy*/
/* Loop until registration status is available */
......
......@@ -119,7 +119,7 @@ int main(int argc, char *argv[]){
lc=linphone_core_new(&vtable,NULL,NULL,data);
/*create proxy config*/
proxy_cfg = linphone_proxy_config_new();
proxy_cfg = linphone_core_create_proxy_config(lc);
/*parse identity*/
from = linphone_address_new(identity);
if (from==NULL){
......@@ -132,14 +132,14 @@ int main(int argc, char *argv[]){
}
// configure proxy entries
linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
linphone_proxy_config_set_identity_address(proxy_cfg,from); /*set identity with user name and domain*/
server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_address_unref(from); /*release resource*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
linphone_core_set_default_proxy_config(lc,proxy_cfg); /*set to default proxy*/
i=0;
/* main loop for receiving notifications and doing background linphonecore work: */
......
......@@ -92,7 +92,7 @@ int main(int argc, char *argv[]){
lc=linphone_core_new(&vtable,NULL,NULL,NULL);
/*create proxy config*/
proxy_cfg = linphone_proxy_config_new();
proxy_cfg = linphone_core_create_proxy_config(lc);
/*parse identity*/
from = linphone_address_new(identity);
if (from==NULL){
......@@ -105,14 +105,14 @@ int main(int argc, char *argv[]){
}
// configure proxy entries
linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
linphone_proxy_config_set_identity_address(proxy_cfg,from); /*set identity with user name and domain*/
server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_address_unref(from); /*release resource*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
linphone_core_set_default_proxy_config(lc,proxy_cfg); /*set to default proxy*/
/* main loop for receiving notifications and doing background linphonecore work: */
......
......@@ -1852,7 +1852,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDefaultProxyConfig( J
,jobject thiz
,jlong lc
,jlong pc) {
linphone_core_set_default_proxy((LinphoneCore*)lc,(LinphoneProxyConfig*)pc);
linphone_core_set_default_proxy_config((LinphoneCore*)lc,(LinphoneProxyConfig*)pc);
}
extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getDefaultProxyConfig(JNIEnv* env
......@@ -2003,7 +2003,7 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInComingInvitePend
,jobject thiz
,jlong lc) {
return (jboolean)linphone_core_inc_invite_pending((LinphoneCore*)lc);
return (jboolean)linphone_core_is_incoming_invite_pending((LinphoneCore*)lc);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_acceptCall(JNIEnv* env
,jobject thiz
......@@ -2862,7 +2862,9 @@ extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_finalize(JNIEnv*
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setIdentity(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jidentity) {
const char* identity = GetStringUTFChars(env, jidentity);
linphone_proxy_config_set_identity((LinphoneProxyConfig*)proxyCfg,identity);
LinphoneAddress *addr = linphone_address_new(identity);
linphone_proxy_config_set_identity_address((LinphoneProxyConfig*)proxyCfg,addr);
if (addr) linphone_address_unref(addr);
ReleaseStringUTFChars(env, jidentity, identity);
}
extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getIdentity(JNIEnv* env,jobject thiz,jlong proxyCfg) {
......@@ -2944,7 +2946,7 @@ extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_enableRegister(JN
linphone_proxy_config_enable_register((LinphoneProxyConfig*)proxyCfg,enableRegister);
}
extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_isRegistered(JNIEnv* env,jobject thiz,jlong proxyCfg) {
return (jboolean)linphone_proxy_config_is_registered((LinphoneProxyConfig*)proxyCfg);
return (jboolean)linphone_proxy_config_get_state((LinphoneProxyConfig*)proxyCfg) == LinphoneRegistrationOk
}
extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_isRegisterEnabled(JNIEnv* env,jobject thiz,jlong proxyCfg) {
return (jboolean)linphone_proxy_config_register_enabled((LinphoneProxyConfig*)proxyCfg);
......@@ -5407,7 +5409,7 @@ extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_getPrivacy(JNIEnv
}
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_enableAvpf(JNIEnv *env, jobject thiz, jlong ptr, jboolean enable) {
linphone_proxy_config_enable_avpf((LinphoneProxyConfig *)ptr, (bool)enable);
}
extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_avpfEnabled(JNIEnv *env, jobject thiz, jlong ptr) {
......
......@@ -1178,7 +1178,7 @@ const char** linphone_config_get_sections_names(LpConfig *lpconfig) {
return sections_names;
}
const bctbx_list_t * linphone_config_get_sections_names_list(LpConfig *lpconfig) {
const bctbx_list_t * linphone_config_get_sections_names_list(LinphoneConfig *lpconfig) {
const bctbx_list_t *sections = lpconfig->sections;
bctbx_list_t *sections_names = NULL;
int i;
......
......@@ -191,10 +191,6 @@ static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *cf
linphone_proxy_config_set_conference_factory_uri(cfg, conference_factory_uri ? ms_strdup(conference_factory_uri) : NULL);
}
LinphoneProxyConfig *linphone_proxy_config_new() {
return linphone_core_create_proxy_config(NULL);
}
static char * append_linphone_address(LinphoneAddress *addr,char *out) {
char *res = out;
if (addr) {
......@@ -313,10 +309,6 @@ void _linphone_proxy_config_destroy(LinphoneProxyConfig *cfg){
_linphone_proxy_config_release_ops(cfg);
}
void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg) {
belle_sip_object_unref(cfg);
}
void _linphone_proxy_config_release(LinphoneProxyConfig *cfg) {
_linphone_proxy_config_release_ops(cfg);
belle_sip_object_unref(cfg);
......@@ -331,10 +323,6 @@ void linphone_proxy_config_unref(LinphoneProxyConfig *cfg) {
belle_sip_object_unref(cfg);
}
bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *cfg){
return cfg->state == LinphoneRegistrationOk;
}
LinphoneStatus linphone_proxy_config_set_server_addr(LinphoneProxyConfig *cfg, const char *server_addr){
LinphoneAddress *addr=NULL;
char *modified=NULL;
......@@ -380,16 +368,6 @@ LinphoneStatus linphone_proxy_config_set_identity_address(LinphoneProxyConfig *c
return 0;
}
LinphoneStatus linphone_proxy_config_set_identity(LinphoneProxyConfig *cfg, const char *identity){
if (identity!=NULL && strlen(identity)>0){
LinphoneAddress *addr=linphone_address_new(identity);
int ret=linphone_proxy_config_set_identity_address(cfg, addr);
if (addr) linphone_address_unref(addr);
return ret;
}
return -1;
}
const char *linphone_proxy_config_get_domain(const LinphoneProxyConfig *cfg){
return cfg->identity_address ? linphone_address_get_domain(cfg->identity_address) : NULL;
}
......@@ -775,7 +753,7 @@ bool_t linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const
}
char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, const char *username) {
LinphoneProxyConfig *tmpproxy = proxy ? proxy : linphone_proxy_config_new();
LinphoneProxyConfig *tmpproxy = proxy ? proxy : linphone_core_create_proxy_config(NULL);
char* result = NULL;
std::shared_ptr<DialPlan> dialplan;
char * nationnal_significant_number = NULL;
......@@ -1280,8 +1258,8 @@ void linphone_core_set_default_proxy_config(LinphoneCore *lc, LinphoneProxyConfi
}
void linphone_core_set_default_proxy_index(LinphoneCore *lc, int index){
if (index<0) linphone_core_set_default_proxy(lc,NULL);
else linphone_core_set_default_proxy(lc,reinterpret_cast<LinphoneProxyConfig *>(bctbx_list_nth_data(lc->sip_conf.proxies,index)));
if (index<0) linphone_core_set_default_proxy_config(lc,NULL);
else linphone_core_set_default_proxy_config(lc,reinterpret_cast<LinphoneProxyConfig *>(bctbx_list_nth_data(lc->sip_conf.proxies,index)));
}
int linphone_core_get_default_proxy(LinphoneCore *lc, LinphoneProxyConfig **config){
......@@ -1384,7 +1362,14 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore* lc
cfg=linphone_core_create_proxy_config(lc);
CONFIGURE_STRING_VALUE(cfg, config, key, identity, "reg_identity")
char* default_value = linphone_proxy_config_get_identity(cfg) ? ms_strdup(linphone_proxy_config_get_identity(cfg)) : NULL;
const char *identity = lp_config_get_string(config, key, "reg_identity", default_value);
LinphoneAddress *identity_address = linphone_address_new(identity);
linphone_proxy_config_set_identity_address(cfg, identity_address);
if (identity_address) linphone_address_unref(identity_address);
if (default_value) ms_free(default_value);
CONFIGURE_STRING_VALUE(cfg, config, key, server_addr, "reg_proxy")
bctbx_list_t *routes = linphone_config_get_string_list(config, key, "reg_route", NULL);
linphone_proxy_config_set_routes(cfg, routes);
......@@ -1696,10 +1681,6 @@ int linphone_proxy_config_get_publish_expires(const LinphoneProxyConfig *cfg) {
}
}
void linphone_proxy_config_enable_avpf(LinphoneProxyConfig *cfg, bool_t enable) {
cfg->avpf_mode=enable ? LinphoneAVPFEnabled : LinphoneAVPFDisabled;
}
bool_t linphone_proxy_config_avpf_enabled(LinphoneProxyConfig *cfg) {
if (cfg->avpf_mode==LinphoneAVPFDefault && cfg->lc){
return linphone_core_get_avpf_mode(cfg->lc)==LinphoneAVPFEnabled;
......
......@@ -64,7 +64,7 @@ static int sip_login_do_login(SipSetupContext * ctx, const char *uri, const char
guess_display_name(parsed_uri);
}
tmp=linphone_address_as_string(parsed_uri);
linphone_proxy_config_set_identity(cfg,tmp);
linphone_proxy_config_set_identity_address(cfg,parsed_uri);
if (passwd ) {
auth=linphone_auth_info_new(linphone_address_get_username(parsed_uri),userid,passwd,NULL,NULL,
linphone_address_get_domain(parsed_uri));
......
......@@ -65,17 +65,17 @@ void RegisterCommand::exec(Daemon *app, const string& args) {
if (!userid.empty() && (userid.compare("NULL") != 0)) cuserid = userid.c_str();
if (!realm.empty() && (realm.compare("NULL") != 0)) crealm = realm.c_str();
if (!parameter.empty()) cparameter = parameter.c_str();
LinphoneProxyConfig *cfg = linphone_proxy_config_new();
LinphoneProxyConfig *cfg = linphone_core_create_proxy_config(NULL);
LinphoneAddress *from = linphone_address_new(cidentity);
if (cpassword != NULL) {
LinphoneAddress *from = linphone_address_new(cidentity);
if (from != NULL) {
LinphoneAuthInfo *info = linphone_auth_info_new(linphone_address_get_username(from), cuserid, cpassword, NULL, crealm, NULL);
linphone_core_add_auth_info(lc, info); /* Add authentication info to LinphoneCore */
linphone_address_unref(from);
linphone_auth_info_unref(info);
}
}
linphone_proxy_config_set_identity(cfg, cidentity);
linphone_proxy_config_set_identity_address(cfg, from);
if (from) linphone_address_unref(from);
linphone_proxy_config_set_server_addr(cfg, cproxy);
linphone_proxy_config_enable_register(cfg, TRUE);
linphone_proxy_config_set_contact_parameters(cfg, cparameter);
......
......@@ -148,16 +148,16 @@ LINPHONE_PUBLIC void linphone_account_creator_unref(LinphoneAccountCreator *crea
/**
* Retrieve the user pointer associated with the LinphoneAccountCreator.
* @param[in] creator #LinphoneAccountCreator object.
* @return The user pointer associated with the LinphoneAccountCreator.
* @return The user pointer associated with the LinphoneAccountCreator. @maybenil
**/
LINPHONE_PUBLIC void *linphone_account_creator_get_user_data(const LinphoneAccountCreator *creator);
/**
* Assign a user pointer to the LinphoneAccountCreator.
* @param[in] creator #LinphoneAccountCreator object.
* @param[in] ud The user pointer to associate with the LinphoneAccountCreator.
* @param[in] user_data The user pointer to associate with the LinphoneAccountCreator. @maybenil
**/
LINPHONE_PUBLIC void linphone_account_creator_set_user_data(LinphoneAccountCreator *creator, void *ud);
LINPHONE_PUBLIC void linphone_account_creator_set_user_data(LinphoneAccountCreator *creator, void *user_data);