mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 23:58:17 +00:00
Add account creator request engine + some changes
This commit is contained in:
parent
1deaf92b67
commit
2482371bc4
13 changed files with 478 additions and 326 deletions
|
|
@ -27,6 +27,7 @@ LOCAL_CPP_EXTENSION := .cc
|
|||
|
||||
LOCAL_SRC_FILES := \
|
||||
account_creator.c \
|
||||
account_creator_request_engine.c \
|
||||
address.c \
|
||||
authentication.c \
|
||||
bellesip_sal/sal_address_impl.c \
|
||||
|
|
@ -192,10 +193,10 @@ endif
|
|||
|
||||
ifneq ($(BUILD_WEBRTC_AECM),0)
|
||||
LOCAL_STATIC_LIBRARIES += \
|
||||
libwebrtc_aecm
|
||||
libwebrtc_aecm
|
||||
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
|
||||
LOCAL_STATIC_LIBRARIES += \
|
||||
libwebrtc_aecm_neon
|
||||
libwebrtc_aecm_neon
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
@ -211,7 +212,7 @@ endif
|
|||
|
||||
ifneq ($(BUILD_ILBC),0)
|
||||
LOCAL_STATIC_LIBRARIES += \
|
||||
libwebrtc_ilbc
|
||||
libwebrtc_ilbc
|
||||
endif
|
||||
|
||||
|
||||
|
|
@ -323,4 +324,3 @@ LOCAL_CFLAGS += -Wdeclaration-after-statement
|
|||
LOCAL_LDFLAGS := -Wl,-soname,$(LOCAL_MODULE_FILENAME).so
|
||||
|
||||
$(call import-module,android/cpufeatures)
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ set(LINPHONE_PRIVATE_HEADER_FILES
|
|||
|
||||
set(LINPHONE_SOURCE_FILES_C
|
||||
account_creator.c
|
||||
account_creator_request_engine.c
|
||||
address.c
|
||||
authentication.c
|
||||
bellesip_sal/sal_address_impl.c
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ lib_LTLIBRARIES=liblinphone.la
|
|||
|
||||
liblinphone_la_SOURCES=\
|
||||
account_creator.c \
|
||||
account_creator_request_engine.c \
|
||||
address.c \
|
||||
authentication.c \
|
||||
buffer.c \
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
*/
|
||||
|
||||
#include "linphone/account_creator.h"
|
||||
#include "linphone/core.h"
|
||||
#include "private.h"
|
||||
#if !_WIN32
|
||||
#include "regex.h"
|
||||
|
|
@ -25,15 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
|
||||
#include <bctoolbox/crypto.h>
|
||||
|
||||
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneAccountCreatorRequestCbs);
|
||||
|
||||
BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreatorRequestCbs, belle_sip_object_t,
|
||||
NULL, // destroy
|
||||
NULL, // clone
|
||||
NULL, // marshal
|
||||
FALSE
|
||||
);
|
||||
|
||||
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneAccountCreatorResponseCbs);
|
||||
|
||||
BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreatorResponseCbs, belle_sip_object_t,
|
||||
|
|
@ -176,102 +168,6 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr
|
|||
}
|
||||
/************************** End Misc **************************/
|
||||
|
||||
/************************** Start Account Creator requests_cbs **************************/
|
||||
static LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_new(void) {
|
||||
return belle_sip_object_new(LinphoneAccountCreatorRequestCbs);
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_ref(LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
belle_sip_object_ref(requests_cbs);
|
||||
return requests_cbs;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_unref(LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
belle_sip_object_unref(requests_cbs);
|
||||
}
|
||||
|
||||
void *linphone_account_creator_requests_cbs_get_user_data(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->user_data;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_user_data(LinphoneAccountCreatorRequestCbs *requests_cbs, void *ud) {
|
||||
requests_cbs->user_data = ud;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_create_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->create_account_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_create_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->create_account_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_exist_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->is_account_exist_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_is_account_exist_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->is_account_exist_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_activate_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->activate_account_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_activate_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->activate_account_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_activated_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->is_account_activated_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_is_account_activated_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->is_account_activated_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_link_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->link_account_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_link_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->link_account_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_alias_used_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->is_alias_used_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_is_alias_used_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->is_alias_used_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_linked_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->is_account_linked_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_is_account_linked_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->is_account_linked_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_recover_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->is_account_linked_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_recover_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->recover_account_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_update_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->update_account_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_update_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->update_account_request_cb = cb;
|
||||
}
|
||||
|
||||
/************************** End Account Creator requests_cbs **************************/
|
||||
|
||||
/************************** Start Account Creator Cbs **************************/
|
||||
|
||||
static LinphoneAccountCreatorResponseCbs * linphone_account_creator_reponses_cbs_new(void) {
|
||||
|
|
@ -380,7 +276,8 @@ void linphone_account_creator_responses_cbs_set_update_account_cb(LinphoneAccoun
|
|||
static void _linphone_account_creator_destroy(LinphoneAccountCreator *creator) {
|
||||
/*this will drop all pending requests if any*/
|
||||
if (creator->xmlrpc_session) linphone_xml_rpc_session_release(creator->xmlrpc_session);
|
||||
linphone_account_creator_requests_cbs_unref(creator->requests_cbs);
|
||||
if (linphone_account_creator_requests_cbs_get_destructor_cb(creator->requests_cbs) != NULL)
|
||||
linphone_account_creator_requests_cbs_get_destructor_cb(creator->requests_cbs)(creator);
|
||||
linphone_account_creator_responses_cbs_unref(creator->responses_cbs);
|
||||
linphone_proxy_config_destroy(creator->proxy_cfg);
|
||||
if (creator->username) ms_free(creator->username);
|
||||
|
|
@ -406,28 +303,16 @@ BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreator, belle_sip_object_t,
|
|||
LinphoneAccountCreator * linphone_account_creator_new(LinphoneCore *core, const char *xmlrpc_url) {
|
||||
LinphoneAccountCreator *creator;
|
||||
creator = belle_sip_object_new(LinphoneAccountCreator);
|
||||
creator->requests_cbs = linphone_account_creator_requests_cbs_new();
|
||||
creator->requests_cbs = linphone_core_get_account_creator_request_engine_cbs(core);
|
||||
creator->responses_cbs = linphone_account_creator_reponses_cbs_new();
|
||||
creator->core = core;
|
||||
creator->xmlrpc_session = (xmlrpc_url) ? linphone_xml_rpc_session_new(core, xmlrpc_url) : NULL;
|
||||
creator->proxy_cfg = linphone_core_create_proxy_config(core);
|
||||
linphone_account_creator_set_linphone_impl(creator);
|
||||
if (linphone_account_creator_requests_cbs_get_constructor_cb(creator->requests_cbs) != NULL)
|
||||
linphone_account_creator_requests_cbs_get_constructor_cb(creator->requests_cbs)(creator);
|
||||
return creator;
|
||||
}
|
||||
|
||||
void linphone_account_creator_set_linphone_impl(LinphoneAccountCreator *creator) {
|
||||
creator->requests_cbs->create_account_request_cb = linphone_account_creator_create_account_custom;
|
||||
creator->requests_cbs->is_account_exist_request_cb = linphone_account_creator_is_account_exist_custom;
|
||||
creator->requests_cbs->activate_account_request_cb = linphone_account_creator_activate_account_custom;
|
||||
creator->requests_cbs->is_account_activated_request_cb = linphone_account_creator_is_account_activated_custom;
|
||||
creator->requests_cbs->link_account_request_cb = linphone_account_creator_link_phone_number_with_account_custom;
|
||||
creator->requests_cbs->activate_alias_request_cb = linphone_account_creator_activate_phone_number_link_custom;
|
||||
creator->requests_cbs->is_alias_used_request_cb = linphone_account_creator_is_phone_number_used_custom;
|
||||
creator->requests_cbs->is_account_linked_request_cb = linphone_account_creator_is_account_linked_custom;
|
||||
creator->requests_cbs->recover_account_request_cb = linphone_account_creator_recover_phone_account_custom;
|
||||
creator->requests_cbs->update_account_request_cb = linphone_account_creator_update_password_custom;
|
||||
}
|
||||
|
||||
LinphoneAccountCreator * linphone_account_creator_ref(LinphoneAccountCreator *creator) {
|
||||
belle_sip_object_ref(creator);
|
||||
return creator;
|
||||
|
|
|
|||
157
coreapi/account_creator_request_engine.c
Normal file
157
coreapi/account_creator_request_engine.c
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
/*
|
||||
account_creator_request_engine.c
|
||||
Copyright (C) 2017 Belledonne Communications SARL
|
||||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone/account_creator_request_engine.h"
|
||||
#include "linphone/core.h"
|
||||
#include "private.h"
|
||||
|
||||
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneAccountCreatorRequestCbs);
|
||||
|
||||
BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreatorRequestCbs, belle_sip_object_t,
|
||||
NULL, // destroy
|
||||
NULL, // clone
|
||||
NULL, // marshal
|
||||
FALSE
|
||||
);
|
||||
|
||||
/************************** Start Account Creator requests_cbs **************************/
|
||||
LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_new(void) {
|
||||
return belle_sip_object_new(LinphoneAccountCreatorRequestCbs);
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_ref(LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
belle_sip_object_ref(requests_cbs);
|
||||
return requests_cbs;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_unref(LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
belle_sip_object_unref(requests_cbs);
|
||||
}
|
||||
|
||||
void *linphone_account_creator_requests_cbs_get_user_data(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->user_data;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_user_data(LinphoneAccountCreatorRequestCbs *requests_cbs, void *ud) {
|
||||
requests_cbs->user_data = ud;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_constructor_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->account_creator_request_constructor_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_constructor_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func) {
|
||||
requests_cbs->account_creator_request_constructor_cb = func;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_destructor_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->account_creator_request_destructor_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_destructor_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func) {
|
||||
requests_cbs->account_creator_request_destructor_cb = func;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_create_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->create_account_request_cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_exist_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->is_account_exist_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_is_account_exist_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->is_account_exist_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_activate_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->activate_account_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_activate_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->activate_account_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_activated_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->is_account_activated_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_is_account_activated_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->is_account_activated_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_link_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->link_account_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_link_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->link_account_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_activate_alias_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return request_cbs->activate_alias_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_activate_alias_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func) {
|
||||
request_cbs->activate_alias_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_alias_used_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->is_alias_used_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_is_alias_used_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->is_alias_used_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_linked_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->is_account_linked_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_is_account_linked_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->is_account_linked_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_recover_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->is_account_linked_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_recover_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->recover_account_request_cb = cb;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_update_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
|
||||
return requests_cbs->update_account_request_cb;
|
||||
}
|
||||
|
||||
void linphone_account_creator_requests_cbs_set_update_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
|
||||
requests_cbs->update_account_request_cb = cb;
|
||||
}
|
||||
|
||||
/************************** End Account Creator requests_cbs **************************/
|
||||
|
||||
void linphone_core_set_account_creator_request_engine_cbs(LinphoneCore *lc, LinphoneAccountCreatorRequestCbs *cbs) {
|
||||
if (lc->default_ac_request_cbs)
|
||||
linphone_account_creator_requests_cbs_unref(lc->default_ac_request_cbs);
|
||||
lc->default_ac_request_cbs = cbs;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorRequestCbs* linphone_core_get_account_creator_request_engine_cbs(LinphoneCore *lc) {
|
||||
return lc->default_ac_request_cbs;
|
||||
}
|
||||
|
|
@ -2072,6 +2072,23 @@ static void linphone_core_internal_subscription_state_changed(LinphoneCore *lc,
|
|||
}
|
||||
}
|
||||
|
||||
static void _linphone_core_init_account_creator_request_cbs(LinphoneCore *lc) {
|
||||
LinphoneAccountCreatorRequestCbs *cbs = linphone_account_creator_requests_cbs_new();
|
||||
cbs->account_creator_request_constructor_cb = NULL;
|
||||
cbs->account_creator_request_destructor_cb = NULL;
|
||||
cbs->create_account_request_cb = linphone_account_creator_create_account_custom;
|
||||
cbs->is_account_exist_request_cb = linphone_account_creator_is_account_exist_custom;
|
||||
cbs->activate_account_request_cb = linphone_account_creator_activate_account_custom;
|
||||
cbs->is_account_activated_request_cb = linphone_account_creator_is_account_activated_custom;
|
||||
cbs->link_account_request_cb = linphone_account_creator_link_phone_number_with_account_custom;
|
||||
cbs->activate_alias_request_cb = linphone_account_creator_activate_phone_number_link_custom;
|
||||
cbs->is_alias_used_request_cb = linphone_account_creator_is_phone_number_used_custom;
|
||||
cbs->is_account_linked_request_cb = linphone_account_creator_is_account_linked_custom;
|
||||
cbs->recover_account_request_cb = linphone_account_creator_recover_phone_account_custom;
|
||||
cbs->update_account_request_cb = linphone_account_creator_update_password_custom;
|
||||
linphone_core_set_account_creator_request_engine_cbs(lc, cbs);
|
||||
}
|
||||
|
||||
static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig *config, void * userdata){
|
||||
const char *remote_provisioning_uri = NULL;
|
||||
LinphoneFactory *lfactory = linphone_factory_get();
|
||||
|
|
@ -2152,6 +2169,8 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig
|
|||
linphone_configuring_terminated(lc, LinphoneConfiguringSkipped, NULL);
|
||||
} // else linphone_core_start will be called after the remote provisioning (see linphone_core_iterate)
|
||||
lc->bw_controller = ms_bandwidth_controller_new();
|
||||
|
||||
_linphone_core_init_account_creator_request_cbs(lc);
|
||||
}
|
||||
|
||||
LinphoneCore *_linphone_core_new_with_config(LinphoneCoreCbs *cbs, struct _LpConfig *config, void *userdata) {
|
||||
|
|
@ -5736,6 +5755,9 @@ static void linphone_core_uninit(LinphoneCore *lc)
|
|||
if (lc->im_encryption_engine) {
|
||||
linphone_im_encryption_engine_unref(lc->im_encryption_engine);
|
||||
}
|
||||
if (lc->default_ac_request_cbs) {
|
||||
linphone_account_creator_requests_cbs_unref(lc->default_ac_request_cbs);
|
||||
}
|
||||
|
||||
linphone_core_free_payload_types(lc);
|
||||
if (lc->supported_formats) ms_free((void *)lc->supported_formats);
|
||||
|
|
|
|||
|
|
@ -1104,6 +1104,7 @@ struct _LinphoneCore
|
|||
|
||||
LinphoneAddress *default_rls_addr; /*default resource list server*/
|
||||
LinphoneImEncryptionEngine *im_encryption_engine;
|
||||
struct _LinphoneAccountCreatorRequestCbs *default_ac_request_cbs;
|
||||
MSBandwidthController *bw_controller;
|
||||
};
|
||||
|
||||
|
|
@ -1393,6 +1394,9 @@ struct _LinphoneAccountCreatorRequestCbs {
|
|||
belle_sip_object_t base;
|
||||
void *user_data;
|
||||
|
||||
LinphoneAccountCreatorRequestFunc account_creator_request_constructor_cb; /**< Constructor */
|
||||
LinphoneAccountCreatorRequestFunc account_creator_request_destructor_cb; /**< Destructor */
|
||||
|
||||
LinphoneAccountCreatorRequestFunc create_account_request_cb; /**< Request to create account */
|
||||
LinphoneAccountCreatorRequestFunc is_account_exist_request_cb; /**< Request to know if account exist */
|
||||
|
||||
|
|
|
|||
|
|
@ -61,9 +61,7 @@ static void linphone_gtk_test_account_validation_cb(LinphoneAccountCreator *crea
|
|||
|
||||
static void check_account_validation(GtkWidget *assistant) {
|
||||
LinphoneAccountCreator *creator = linphone_gtk_assistant_get_creator(assistant);
|
||||
(linphone_account_creator_requests_cbs_get_is_account_activated_cb(
|
||||
linphone_account_creator_get_requests_cbs(creator))
|
||||
)(creator);
|
||||
linphone_account_creator_is_account_activated(creator);
|
||||
}
|
||||
|
||||
void linphone_gtk_assistant_closed(GtkWidget *w) {
|
||||
|
|
@ -237,9 +235,7 @@ static gboolean check_username_availability(GtkWidget *assistant) {
|
|||
LinphoneAccountCreator *creator = linphone_gtk_assistant_get_creator(assistant);
|
||||
GtkWidget *page = gtk_assistant_get_nth_page(GTK_ASSISTANT(assistant), gtk_assistant_get_current_page(GTK_ASSISTANT(assistant)));
|
||||
g_object_set_data(G_OBJECT(page), "usernameAvailabilityTimerID", GUINT_TO_POINTER(0));
|
||||
(linphone_account_creator_requests_cbs_get_is_account_exist_cb(
|
||||
linphone_account_creator_get_requests_cbs(creator))
|
||||
)(creator);
|
||||
linphone_account_creator_is_account_exist(creator);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
set(HEADER_FILES
|
||||
account_creator.h
|
||||
account_creator_request_engine.h
|
||||
address.h
|
||||
auth_info.h
|
||||
buffer.h
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ linphone_includedir=$(includedir)/linphone
|
|||
|
||||
linphone_include_HEADERS=\
|
||||
account_creator.h \
|
||||
account_creator_request_engine.h \
|
||||
address.h \
|
||||
auth_info.h \
|
||||
buffer.h \
|
||||
|
|
|
|||
|
|
@ -31,12 +31,6 @@ extern "C" {
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function to set custom server request.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
*/
|
||||
typedef LinphoneRequestStatus (*LinphoneAccountCreatorRequestFunc)(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Callback to notify a response of server.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
|
|
@ -55,76 +49,70 @@ typedef void (*LinphoneAccountCreatorResponseFunc)(LinphoneAccountCreator *creat
|
|||
LINPHONE_PUBLIC LinphoneAccountCreator * linphone_account_creator_new(LinphoneCore *core, const char *xmlrpc_url);
|
||||
|
||||
/**
|
||||
* Set Linphone functions to LinphoneAccountCreator.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_set_linphone_impl(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a XML-RPC request to know the existence of account on server.
|
||||
* Send a request to know the existence of account on server.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_exist(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a XML-RPC request to create an account on server.
|
||||
* Send a request to create an account on server.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a XML-RPC request to know if an account is activated on server.
|
||||
* Send a request to know if an account is activated on server.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_activated(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a XML-RPC request to activate an account on server.
|
||||
* Send a request to activate an account on server.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_activate_account(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a XML-RPC request to link an account to an alias.
|
||||
* Send a request to link an account to an alias.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_link_account(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a XML-RPC request to activate an alias.
|
||||
* Send a request to activate an alias.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_activate_alias(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a XML-RPC request to know if an alias is used.
|
||||
* Send a request to know if an alias is used.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_alias_used(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a XML-RPC request to know if an account is linked.
|
||||
* Send a request to know if an account is linked.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_linked(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a XML-RPC request to recover an account.
|
||||
* Send a request to recover an account.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_recover_account(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a XML-RPC request to update an account.
|
||||
* Send a request to update an account.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
|
||||
**/
|
||||
|
|
@ -365,182 +353,10 @@ LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_linked
|
|||
* @param[in] new_pwd const char * : new password for the account creator
|
||||
* @return LinphoneRequestOk if everything is OK, or a specific error otherwise.
|
||||
**/
|
||||
// TODO viré new_pwd qui sera remplacé par le get_user_data de creator
|
||||
LINPHONE_PUBLIC /*TODO*/ LinphoneRequestStatus linphone_account_creator_update_password_custom(LinphoneAccountCreator *creator);
|
||||
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_update_password_custom(LinphoneAccountCreator *creator);
|
||||
|
||||
/************************** End Account Creator Linphone **************************/
|
||||
|
||||
/************************** Start Account Creator Requests **************************/
|
||||
|
||||
/**
|
||||
* Acquire a reference to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The same LinphoneAccountCreatorRequestCbs object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_ref(LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Release a reference to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_unref(LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The user pointer associated with the LinphoneAccountCreatorRequestCbs object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void *linphone_account_creator_requests_cbs_get_user_data(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] ud The user pointer to associate with the LinphoneAccountCreatorRequestCbs object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_user_data(LinphoneAccountCreatorRequestCbs *requests_cbs, void *ud);
|
||||
|
||||
/**
|
||||
* Get the create account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current create account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_create_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The create account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_create_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the is account exist request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current is account exist request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_exist_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The is account exist request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_exist_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the activate account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current activate account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_activate_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The activate account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_activate_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the is account activated request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current is account activated request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_activated_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The is account activated request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_activated_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the link account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current link account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_link_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The link account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_link_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the activate alias request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current link account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_activate_alias_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The activate alias request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_activate_alias_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the is alias used request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current is alias used request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_alias_used_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The is alias used request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_alias_used_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the is account linked request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current is account linked request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_linked_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The is account linked request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_linked_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the recover account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current recover account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_recover_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The recover account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_recover_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the update account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current update account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_update_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The update account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_update_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/************************** End Account Creator Requests **************************/
|
||||
|
||||
/************************** Start Account Creator Cbs **************************/
|
||||
|
||||
/**
|
||||
|
|
|
|||
253
include/linphone/account_creator_request_engine.h
Normal file
253
include/linphone/account_creator_request_engine.h
Normal file
|
|
@ -0,0 +1,253 @@
|
|||
/*
|
||||
account_creator_request_engine.h
|
||||
Copyright (C) 2017 Belledonne Communications SARL
|
||||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef LINPHONE_ACCOUNT_CREATOR_REQUEST_ENGINE_H_
|
||||
#define LINPHONE_ACCOUNT_CREATOR_REQUEST_ENGINE_H_
|
||||
|
||||
#include "linphone/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Function to set custom server request.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
*/
|
||||
typedef LinphoneRequestStatus (*LinphoneAccountCreatorRequestFunc)(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* @addtogroup account_creator_request
|
||||
* @{
|
||||
*/
|
||||
|
||||
/************************** Start Account Creator Requests **************************/
|
||||
|
||||
/**
|
||||
* Create a new LinphoneAccountCreatorRequestCbs object.
|
||||
* @return a new LinphoneAccountCreatorRequestCbs object.
|
||||
**/
|
||||
LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_new(void);
|
||||
|
||||
/**
|
||||
* Acquire a reference to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The same LinphoneAccountCreatorRequestCbs object.
|
||||
**/
|
||||
LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_ref(LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Release a reference to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
**/
|
||||
void linphone_account_creator_requests_cbs_unref(LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The user pointer associated with the LinphoneAccountCreatorRequestCbs object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void *linphone_account_creator_requests_cbs_get_user_data(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] ud The user pointer to associate with the LinphoneAccountCreatorRequestCbs object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_user_data(LinphoneAccountCreatorRequestCbs *requests_cbs, void *ud);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The constructor of account creator requests.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_constructor_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the constructor of account creator requests.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current constructor of create account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_constructor_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The destructor.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_destructor_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the destructor of create account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current destructor of create account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_destructor_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Get the create account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current create account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_create_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The create account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_create_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the is account exist request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current is account exist request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_exist_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The is account exist request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_exist_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the activate account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current activate account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_activate_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The activate account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_activate_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the is account activated request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current is account activated request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_activated_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The is account activated request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_activated_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the link account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current link account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_link_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The link account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_link_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the activate alias request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current link account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_activate_alias_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The activate alias request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_activate_alias_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the is alias used request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current is alias used request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_alias_used_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The is alias used request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_alias_used_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the is account linked request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current is account linked request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_linked_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The is account linked request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_linked_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the recover account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current recover account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_recover_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The recover account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_recover_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/**
|
||||
* Get the update account request.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @return The current update account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_update_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
|
||||
* @param[in] func The update account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_update_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
|
||||
|
||||
/************************** End Account Creator Requests **************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* LINPHONE_ACCOUNT_CREATOR_REQUEST_ENGINE_H_ */
|
||||
|
|
@ -32,6 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "linphone/sipsetup.h"
|
||||
|
||||
#include "linphone/account_creator.h"
|
||||
#include "linphone/account_creator_request_engine.h"
|
||||
#include "linphone/address.h"
|
||||
#include "linphone/auth_info.h"
|
||||
#include "linphone/buffer.h"
|
||||
|
|
@ -2235,6 +2236,20 @@ LINPHONE_PUBLIC void linphone_core_abort_authentication(LinphoneCore *lc, Linpho
|
|||
**/
|
||||
LINPHONE_PUBLIC void linphone_core_clear_all_auth_info(LinphoneCore *lc);
|
||||
|
||||
/**
|
||||
* Sets an default account creator request cbs in the core
|
||||
* @param lc LinphoneCore object
|
||||
* @param cbs LinphoneAccountCreatorRequestCbs object
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_core_set_account_creator_request_engine_cbs(LinphoneCore *lc, LinphoneAccountCreatorRequestCbs *cbs);
|
||||
|
||||
/**
|
||||
* Get default account creator request cbs from the core
|
||||
* @param lc LinphoneCore object
|
||||
* @return LinphoneAccountCreatorRequestCbs object
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestCbs* linphone_core_get_account_creator_request_engine_cbs(LinphoneCore *lc);
|
||||
|
||||
/**
|
||||
* Enable or disable the audio adaptive jitter compensation.
|
||||
* @param[in] lc #LinphoneCore object
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue