diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index 21b1c7c35..d3d1f6401 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -52,7 +52,7 @@ set(LINPHONE_PRIVATE_HEADER_FILES set(LINPHONE_SOURCE_FILES_C account_creator.c - account_creator_request_engine.c + account_creator_service.c address.c authentication.c bellesip_sal/sal_address_impl.c diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index 41c36f4f9..67502c8c0 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -26,7 +26,7 @@ lib_LTLIBRARIES=liblinphone.la liblinphone_la_SOURCES=\ account_creator.c \ - account_creator_request_engine.c \ + account_creator_service.c \ address.c \ authentication.c \ buffer.c \ diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index 5c48e7529..d32b2248b 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -26,9 +26,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include -BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneAccountCreatorResponseCbs); +BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneAccountCreatorCbs); -BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreatorResponseCbs, belle_sip_object_t, +BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreatorCbs, belle_sip_object_t, NULL, // destroy NULL, // clone NULL, // marshal @@ -182,105 +182,105 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr /************************** Start Account Creator Cbs **************************/ -static LinphoneAccountCreatorResponseCbs * linphone_account_creator_reponses_cbs_new(void) { - return belle_sip_object_new(LinphoneAccountCreatorResponseCbs); +static LinphoneAccountCreatorCbs * linphone_account_creator_cbs_new(void) { + return belle_sip_object_new(LinphoneAccountCreatorCbs); } -LinphoneAccountCreatorResponseCbs * linphone_account_creator_responses_cbs_ref(LinphoneAccountCreatorResponseCbs *responses_cbs) { - belle_sip_object_ref(responses_cbs); - return responses_cbs; +LinphoneAccountCreatorCbs * linphone_account_creator_cbs_ref(LinphoneAccountCreatorCbs *cbs) { + belle_sip_object_ref(cbs); + return cbs; } -void linphone_account_creator_responses_cbs_unref(LinphoneAccountCreatorResponseCbs *responses_cbs) { - belle_sip_object_unref(responses_cbs); +void linphone_account_creator_cbs_unref(LinphoneAccountCreatorCbs *cbs) { + belle_sip_object_unref(cbs); } -void *linphone_account_creator_responses_cbs_get_user_data(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->user_data; +void *linphone_account_creator_cbs_get_user_data(const LinphoneAccountCreatorCbs *cbs) { + return cbs->user_data; } -void linphone_account_creator_responses_cbs_set_user_data(LinphoneAccountCreatorResponseCbs *responses_cbs, void *ud) { - responses_cbs->user_data = ud; +void linphone_account_creator_cbs_set_user_data(LinphoneAccountCreatorCbs *cbs, void *ud) { + cbs->user_data = ud; } -LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_create_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->create_account_response_cb; +LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_create_account(const LinphoneAccountCreatorCbs *cbs) { + return cbs->create_account_response_cb; } -void linphone_account_creator_responses_cbs_set_create_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb) { - responses_cbs->create_account_response_cb = cb; +void linphone_account_creator_cbs_set_create_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb) { + cbs->create_account_response_cb = cb; } -LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_account_exist_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->is_account_exist_response_cb; +LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_exist(const LinphoneAccountCreatorCbs *cbs) { + return cbs->is_account_exist_response_cb; } -void linphone_account_creator_responses_cbs_set_is_account_exist_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb) { - responses_cbs->is_account_exist_response_cb = cb; +void linphone_account_creator_cbs_set_is_account_exist(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb) { + cbs->is_account_exist_response_cb = cb; } -LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_activate_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->activate_account_response_cb; +LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_activate_account(const LinphoneAccountCreatorCbs *cbs) { + return cbs->activate_account_response_cb; } -void linphone_account_creator_responses_cbs_set_activate_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb) { - responses_cbs->activate_account_response_cb = cb; +void linphone_account_creator_cbs_set_activate_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb) { + cbs->activate_account_response_cb = cb; } -LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_account_activated_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->is_account_activated_response_cb; +LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_activated(const LinphoneAccountCreatorCbs *cbs) { + return cbs->is_account_activated_response_cb; } -void linphone_account_creator_responses_cbs_set_is_account_activated_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb) { - responses_cbs->is_account_activated_response_cb = cb; +void linphone_account_creator_cbs_set_is_account_activated(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb) { + cbs->is_account_activated_response_cb = cb; } -LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_link_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->link_account_response_cb; +LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_link_account(const LinphoneAccountCreatorCbs *cbs) { + return cbs->link_account_response_cb; } -void linphone_account_creator_responses_cbs_set_link_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb) { - responses_cbs->link_account_response_cb = cb; +void linphone_account_creator_cbs_set_link_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb) { + cbs->link_account_response_cb = cb; } -LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_activate_alias_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->activate_alias_response_cb; +LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_activate_alias(const LinphoneAccountCreatorCbs *cbs) { + return cbs->activate_alias_response_cb; } -void linphone_account_creator_responses_cbs_set_activate_alias_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb) { - responses_cbs->activate_alias_response_cb = cb; +void linphone_account_creator_cbs_set_activate_alias(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb) { + cbs->activate_alias_response_cb = cb; } -LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_alias_used_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->is_alias_used_response_cb; +LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_alias_used(const LinphoneAccountCreatorCbs *cbs) { + return cbs->is_alias_used_response_cb; } -void linphone_account_creator_responses_cbs_set_is_alias_used_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb) { - responses_cbs->is_alias_used_response_cb = cb; +void linphone_account_creator_cbs_set_is_alias_used(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb) { + cbs->is_alias_used_response_cb = cb; } -LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_account_linked_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->is_account_linked_response_cb; +LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_linked(const LinphoneAccountCreatorCbs *cbs) { + return cbs->is_account_linked_response_cb; } -void linphone_account_creator_responses_cbs_set_is_account_linked_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb) { - responses_cbs->is_account_linked_response_cb = cb; +void linphone_account_creator_cbs_set_is_account_linked(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb) { + cbs->is_account_linked_response_cb = cb; } -LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_recover_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->recover_account_response_cb; +LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_recover_account(const LinphoneAccountCreatorCbs *cbs) { + return cbs->recover_account_response_cb; } -void linphone_account_creator_responses_cbs_set_recover_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb) { - responses_cbs->recover_account_response_cb = cb; +void linphone_account_creator_cbs_set_recover_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb) { + cbs->recover_account_response_cb = cb; } -LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_update_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs) { - return responses_cbs->update_account_response_cb; +LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_update_account(const LinphoneAccountCreatorCbs *cbs) { + return cbs->update_account_response_cb; } -void linphone_account_creator_responses_cbs_set_update_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb) { - responses_cbs->update_account_response_cb = cb; +void linphone_account_creator_cbs_set_update_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb) { + cbs->update_account_response_cb = cb; } /************************** End Account Creator Cbs **************************/ @@ -288,9 +288,9 @@ 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); - if (creator->requests_cbs != NULL && 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); + if (creator->service != NULL && linphone_account_creator_service_get_destructor_cb(creator->service) != NULL) + linphone_account_creator_service_get_destructor_cb(creator->service)(creator); + linphone_account_creator_cbs_unref(creator->cbs); linphone_proxy_config_destroy(creator->proxy_cfg); if (creator->username) ms_free(creator->username); if (creator->display_name) ms_free(creator->display_name); @@ -318,16 +318,16 @@ LinphoneAccountCreator * linphone_account_creator_new(LinphoneCore *core, const LinphoneAccountCreator *creator; const char* domain = lp_config_get_string(core->config, "assistant", "domain", NULL); creator = belle_sip_object_new(LinphoneAccountCreator); - creator->requests_cbs = linphone_core_get_account_creator_request_engine_cbs(core); - creator->responses_cbs = linphone_account_creator_reponses_cbs_new(); + creator->service = linphone_core_get_account_creator_service(core); + creator->cbs = linphone_account_creator_cbs_new(); creator->core = core; creator->xmlrpc_session = (xmlrpc_url) ? linphone_xml_rpc_session_new(core, xmlrpc_url) : NULL; if (domain) { linphone_account_creator_set_domain(creator, domain); } creator->proxy_cfg = linphone_core_create_proxy_config(core); - if (creator->requests_cbs != NULL && linphone_account_creator_requests_cbs_get_constructor_cb(creator->requests_cbs) != NULL) - linphone_account_creator_requests_cbs_get_constructor_cb(creator->requests_cbs)(creator); + if (creator->service != NULL && linphone_account_creator_service_get_constructor_cb(creator->service) != NULL) + linphone_account_creator_service_get_constructor_cb(creator->service)(creator); return creator; } @@ -348,44 +348,44 @@ void linphone_account_creator_set_user_data(LinphoneAccountCreator *creator, voi creator->user_data = ud; } -LinphoneUsernameCheck linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username) { +LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username) { int min_length = lp_config_get_int(creator->core->config, "assistant", "username_min_length", -1); int max_length = lp_config_get_int(creator->core->config, "assistant", "username_max_length", -1); bool_t use_phone_number = lp_config_get_int(creator->core->config, "assistant", "use_phone_number", 0); const char* regex = lp_config_get_string(creator->core->config, "assistant", "username_regex", 0); if (!username) { creator->username = NULL; - return LinphoneUsernameOk; + return LinphoneAccountCreatorUsernameStatusOk; } else if (min_length > 0 && strlen(username) < (size_t)min_length) { - return LinphoneUsernameTooShort; + return LinphoneAccountCreatorUsernameStatusTooShort; } else if (max_length > 0 && strlen(username) > (size_t)max_length) { - return LinphoneUsernameTooLong; + return LinphoneAccountCreatorUsernameStatusTooLong; } else if (use_phone_number && !linphone_proxy_config_is_phone_number(NULL, username)) { - return LinphoneUsernameInvalid; + return LinphoneAccountCreatorUsernameStatusInvalid; } else if (regex && !is_matching_regex(username, regex)) { - return LinphoneUsernameInvalidCharacters; + return LinphoneAccountCreatorUsernameStatusInvalidCharacters; } else if (validate_uri(username, NULL, NULL) != 0) { - return LinphoneUsernameInvalid; + return LinphoneAccountCreatorUsernameStatusInvalid; } set_string(&creator->username, username, TRUE); - return LinphoneUsernameOk; + return LinphoneAccountCreatorUsernameStatusOk; } const char * linphone_account_creator_get_username(const LinphoneAccountCreator *creator) { return creator->username; } -LinphonePhoneNumberMask linphone_account_creator_set_phone_number(LinphoneAccountCreator *creator, const char *phone_number, const char *country_code) { +LinphoneAccountCreatorPhoneNumberStatusMask linphone_account_creator_set_phone_number(LinphoneAccountCreator *creator, const char *phone_number, const char *country_code) { char *normalized_phone_number; - LinphonePhoneNumberMask return_status = 0; + LinphoneAccountCreatorPhoneNumberStatusMask return_status = 0; if (!phone_number || !country_code) { if (!phone_number && !country_code) { creator->phone_number = NULL; creator->phone_country_code = NULL; - return (LinphonePhoneNumberMask)LinphonePhoneNumberOk; + return (LinphoneAccountCreatorPhoneNumberStatusMask)LinphoneAccountCreatorPhoneNumberStatusOk; } else { - return (LinphonePhoneNumberMask)LinphonePhoneNumberInvalid; + return (LinphoneAccountCreatorPhoneNumberStatusMask)LinphoneAccountCreatorPhoneNumberStatusInvalid; } } else { LinphoneProxyConfig *numCfg = creator->proxy_cfg; @@ -393,7 +393,7 @@ LinphonePhoneNumberMask linphone_account_creator_set_phone_number(LinphoneAccoun linphone_proxy_config_set_dial_prefix(numCfg, creator->phone_country_code); normalized_phone_number = linphone_proxy_config_normalize_phone_number(numCfg, phone_number); if (!normalized_phone_number) { - return LinphonePhoneNumberInvalid; + return LinphoneAccountCreatorPhoneNumberStatusInvalid; } // if phone is valid, we lastly want to check that length is OK @@ -401,21 +401,21 @@ LinphonePhoneNumberMask linphone_account_creator_set_phone_number(LinphoneAccoun const LinphoneDialPlan* plan = linphone_dial_plan_by_ccc(creator->phone_country_code); int size = (int)strlen(phone_number); if (linphone_dial_plan_is_generic(plan)) { - return_status = LinphonePhoneNumberCountryCodeInvalid; + return_status = LinphoneAccountCreatorPhoneNumberStatusInvalidCountryCode; } if (size < plan->nnl - 1) { - return_status += LinphonePhoneNumberTooShort; + return_status += LinphoneAccountCreatorPhoneNumberStatusTooShort; goto end; } else if (size > plan->nnl + 1) { - return_status += LinphonePhoneNumberTooLong; + return_status += LinphoneAccountCreatorPhoneNumberStatusTooLong; goto end; - } else if (return_status & LinphonePhoneNumberCountryCodeInvalid) { + } else if (return_status & LinphoneAccountCreatorPhoneNumberStatusInvalidCountryCode) { goto end; } } } set_string(&creator->phone_number, normalized_phone_number, TRUE); - return_status = LinphonePhoneNumberOk; + return_status = LinphoneAccountCreatorPhoneNumberStatusOk; end: ms_free(normalized_phone_number); return return_status; @@ -425,240 +425,240 @@ const char * linphone_account_creator_get_phone_number(const LinphoneAccountCrea return creator->phone_number; } -LinphonePasswordCheck linphone_account_creator_set_password(LinphoneAccountCreator *creator, const char *password) { +LinphoneAccountCreatorPasswordStatus linphone_account_creator_set_password(LinphoneAccountCreator *creator, const char *password) { int min_length = lp_config_get_int(creator->core->config, "assistant", "password_min_length", -1); int max_length = lp_config_get_int(creator->core->config, "assistant", "password_max_length", -1); if (!password) { creator->password = NULL; - return LinphonePasswordTooShort; + return LinphoneAccountCreatorPasswordStatusTooShort; } if (min_length > 0 && strlen(password) < (size_t)min_length) { - return LinphonePasswordTooShort; + return LinphoneAccountCreatorPasswordStatusTooShort; } else if (max_length > 0 && strlen(password) > (size_t)max_length) { - return LinphonePasswordTooLong; + return LinphoneAccountCreatorPasswordStatusTooLong; } set_string(&creator->password, password, FALSE); - return LinphonePasswordOk; + return LinphoneAccountCreatorPasswordStatusOk; } const char * linphone_account_creator_get_password(const LinphoneAccountCreator *creator) { return creator->password; } -LinphonePasswordCheck linphone_account_creator_set_ha1(LinphoneAccountCreator *creator, const char *ha1){ +LinphoneAccountCreatorPasswordStatus linphone_account_creator_set_ha1(LinphoneAccountCreator *creator, const char *ha1){ set_string(&creator->ha1, ha1, FALSE); - return LinphonePasswordOk; + return LinphoneAccountCreatorPasswordStatusOk; } const char * linphone_account_creator_get_ha1(const LinphoneAccountCreator *creator) { return creator->ha1; } -LinphoneActivationCodeCheck linphone_account_creator_set_activation_code(LinphoneAccountCreator *creator, const char *activation_code){ +LinphoneAccountCreatorActivationCodeStatus linphone_account_creator_set_activation_code(LinphoneAccountCreator *creator, const char *activation_code){ set_string(&creator->activation_code, activation_code, FALSE); - return LinphoneActivationCodeOk; + return LinphoneAccountCreatorActivationCodeStatusOk; } const char * linphone_account_creator_get_activation_code(const LinphoneAccountCreator *creator) { return creator->activation_code; } -LinphoneLanguageCheck linphone_account_creator_set_language(LinphoneAccountCreator *creator, const char *lang) { +LinphoneAccountCreatorLanguageStatus linphone_account_creator_set_language(LinphoneAccountCreator *creator, const char *lang) { set_string(&creator->language, lang, FALSE); - return LinphoneLanguageOk; + return LinphoneAccountCreatorLanguageStatusOk; } const char * linphone_account_creator_get_language(const LinphoneAccountCreator *creator) { return creator->language; } -LinphoneUsernameCheck linphone_account_creator_set_display_name(LinphoneAccountCreator *creator, const char *display_name) { +LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_display_name(LinphoneAccountCreator *creator, const char *display_name) { if (validate_uri(NULL, display_name, NULL) != 0) { - return LinphoneUsernameInvalid; + return LinphoneAccountCreatorUsernameStatusInvalid; } set_string(&creator->display_name, display_name, FALSE); - return LinphoneUsernameOk; + return LinphoneAccountCreatorUsernameStatusOk; } const char * linphone_account_creator_get_display_name(const LinphoneAccountCreator *creator) { return creator->display_name; } -LinphoneEmailCheck linphone_account_creator_set_email(LinphoneAccountCreator *creator, const char *email) { +LinphoneAccountCreatorEmailStatus linphone_account_creator_set_email(LinphoneAccountCreator *creator, const char *email) { if (!is_matching_regex(email, "^.+@.+\\..*$")) { - return LinphoneEmailMalformed; + return LinphoneAccountCreatorEmailStatusMalformed; } if (!is_matching_regex(email, "^.+@.+\\.[A-Za-z]{2}[A-Za-z]*$")) { - return LinphoneEmailInvalidCharacters; + return LinphoneAccountCreatorEmailStatusInvalidCharacters; } set_string(&creator->email, email, TRUE); - return LinphoneEmailOk; + return LinphoneAccountCreatorEmailStatusOk; } const char * linphone_account_creator_get_email(const LinphoneAccountCreator *creator) { return creator->email; } -LinphoneRequestStatus linphone_account_creator_set_domain(LinphoneAccountCreator *creator, const char *domain) { +LinphoneAccountCreatorStatus linphone_account_creator_set_domain(LinphoneAccountCreator *creator, const char *domain) { if (domain && validate_uri(NULL, domain, NULL) != 0) { - return LinphoneRequestFailed; + return LinphoneAccountCreatorStatusRequestFailed; } set_string(&creator->domain, domain, TRUE); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } const char * linphone_account_creator_get_domain(const LinphoneAccountCreator *creator) { return creator->domain; } -LinphoneRequestStatus linphone_account_creator_set_route(LinphoneAccountCreator *creator, const char *route) { +LinphoneAccountCreatorStatus linphone_account_creator_set_route(LinphoneAccountCreator *creator, const char *route) { if (!route || linphone_proxy_config_set_route(creator->proxy_cfg, route) != 0) - return LinphoneRequestFailed; + return LinphoneAccountCreatorStatusRequestFailed; set_string(&creator->route, route, TRUE); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } const char * linphone_account_creator_get_route(const LinphoneAccountCreator *creator) { return creator->route; } -LinphoneAccountCreatorResponseCbs * linphone_account_creator_get_responses_cbs(const LinphoneAccountCreator *creator) { - return creator->responses_cbs; +LinphoneAccountCreatorCbs * linphone_account_creator_get_callbacks(const LinphoneAccountCreator *creator) { + return creator->cbs; } -LinphoneAccountCreatorRequestCbs * linphone_account_creator_get_requests_cbs(const LinphoneAccountCreator *creator) { - return creator->requests_cbs; +LinphoneAccountCreatorService * linphone_account_creator_get_service(const LinphoneAccountCreator *creator) { + return creator->service; } -LinphoneRequestStatus linphone_account_creator_is_account_exist(LinphoneAccountCreator *creator) { - if (creator->requests_cbs->is_account_exist_request_cb == NULL - || creator->responses_cbs->is_account_exist_response_cb == NULL) { - return LinphoneRequestMissingCallbacks; +LinphoneAccountCreatorStatus linphone_account_creator_is_account_exist(LinphoneAccountCreator *creator) { + if (creator->service->is_account_exist_request_cb == NULL + || creator->cbs->is_account_exist_response_cb == NULL) { + return LinphoneAccountCreatorStatusMissingCallbacks; } - return creator->requests_cbs->is_account_exist_request_cb(creator); + return creator->service->is_account_exist_request_cb(creator); } -LinphoneRequestStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator) { - if (creator->requests_cbs->create_account_request_cb == NULL - || creator->responses_cbs->create_account_response_cb == NULL) { - return LinphoneRequestMissingCallbacks; +LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator) { + if (creator->service->create_account_request_cb == NULL + || creator->cbs->create_account_response_cb == NULL) { + return LinphoneAccountCreatorStatusMissingCallbacks; } - return creator->requests_cbs->create_account_request_cb(creator); + return creator->service->create_account_request_cb(creator); } -LinphoneRequestStatus linphone_account_creator_is_account_activated(LinphoneAccountCreator *creator) { - if (creator->requests_cbs->is_account_activated_request_cb == NULL - || creator->responses_cbs->is_account_activated_response_cb == NULL) { - return LinphoneRequestMissingCallbacks; +LinphoneAccountCreatorStatus linphone_account_creator_is_account_activated(LinphoneAccountCreator *creator) { + if (creator->service->is_account_activated_request_cb == NULL + || creator->cbs->is_account_activated_response_cb == NULL) { + return LinphoneAccountCreatorStatusMissingCallbacks; } - return creator->requests_cbs->is_account_activated_request_cb(creator); + return creator->service->is_account_activated_request_cb(creator); } -LinphoneRequestStatus linphone_account_creator_activate_account(LinphoneAccountCreator *creator) { - if (creator->requests_cbs->activate_account_request_cb == NULL - || creator->responses_cbs->activate_account_response_cb == NULL) { - return LinphoneRequestMissingCallbacks; +LinphoneAccountCreatorStatus linphone_account_creator_activate_account(LinphoneAccountCreator *creator) { + if (creator->service->activate_account_request_cb == NULL + || creator->cbs->activate_account_response_cb == NULL) { + return LinphoneAccountCreatorStatusMissingCallbacks; } - return creator->requests_cbs->activate_account_request_cb(creator); + return creator->service->activate_account_request_cb(creator); } -LinphoneRequestStatus linphone_account_creator_link_account(LinphoneAccountCreator *creator) { - if (creator->requests_cbs->link_account_request_cb == NULL - || creator->responses_cbs->link_account_response_cb == NULL) { - return LinphoneRequestMissingCallbacks; +LinphoneAccountCreatorStatus linphone_account_creator_link_account(LinphoneAccountCreator *creator) { + if (creator->service->link_account_request_cb == NULL + || creator->cbs->link_account_response_cb == NULL) { + return LinphoneAccountCreatorStatusMissingCallbacks; } - return creator->requests_cbs->link_account_request_cb(creator); + return creator->service->link_account_request_cb(creator); } -LinphoneRequestStatus linphone_account_creator_activate_alias(LinphoneAccountCreator *creator) { - if (creator->requests_cbs->activate_alias_request_cb == NULL - || creator->responses_cbs->activate_alias_response_cb == NULL) { - return LinphoneRequestMissingCallbacks; +LinphoneAccountCreatorStatus linphone_account_creator_activate_alias(LinphoneAccountCreator *creator) { + if (creator->service->activate_alias_request_cb == NULL + || creator->cbs->activate_alias_response_cb == NULL) { + return LinphoneAccountCreatorStatusMissingCallbacks; } - return creator->requests_cbs->activate_alias_request_cb(creator); + return creator->service->activate_alias_request_cb(creator); } -LinphoneRequestStatus linphone_account_creator_is_alias_used(LinphoneAccountCreator *creator) { - if (creator->requests_cbs->is_alias_used_request_cb == NULL - || creator->responses_cbs->is_alias_used_response_cb == NULL) { - return LinphoneRequestMissingCallbacks; +LinphoneAccountCreatorStatus linphone_account_creator_is_alias_used(LinphoneAccountCreator *creator) { + if (creator->service->is_alias_used_request_cb == NULL + || creator->cbs->is_alias_used_response_cb == NULL) { + return LinphoneAccountCreatorStatusMissingCallbacks; } - return creator->requests_cbs->is_alias_used_request_cb(creator); + return creator->service->is_alias_used_request_cb(creator); } -LinphoneRequestStatus linphone_account_creator_is_account_linked(LinphoneAccountCreator *creator) { - if (creator->requests_cbs->is_account_linked_request_cb == NULL - || creator->responses_cbs->is_account_linked_response_cb == NULL) { - return LinphoneRequestMissingCallbacks; +LinphoneAccountCreatorStatus linphone_account_creator_is_account_linked(LinphoneAccountCreator *creator) { + if (creator->service->is_account_linked_request_cb == NULL + || creator->cbs->is_account_linked_response_cb == NULL) { + return LinphoneAccountCreatorStatusMissingCallbacks; } - return creator->requests_cbs->is_account_linked_request_cb(creator); + return creator->service->is_account_linked_request_cb(creator); } -LinphoneRequestStatus linphone_account_creator_recover_account(LinphoneAccountCreator *creator) { - if (creator->requests_cbs->recover_account_request_cb == NULL - || creator->responses_cbs->recover_account_response_cb == NULL) { - return LinphoneRequestMissingCallbacks; +LinphoneAccountCreatorStatus linphone_account_creator_recover_account(LinphoneAccountCreator *creator) { + if (creator->service->recover_account_request_cb == NULL + || creator->cbs->recover_account_response_cb == NULL) { + return LinphoneAccountCreatorStatusMissingCallbacks; } - return creator->requests_cbs->recover_account_request_cb(creator); + return creator->service->recover_account_request_cb(creator); } -LinphoneRequestStatus linphone_account_creator_update_account(LinphoneAccountCreator *creator) { - if (creator->requests_cbs->update_account_request_cb == NULL - || creator->responses_cbs->update_account_response_cb == NULL) { - return LinphoneRequestMissingCallbacks; +LinphoneAccountCreatorStatus linphone_account_creator_update_account(LinphoneAccountCreator *creator) { + if (creator->service->update_account_request_cb == NULL + || creator->cbs->update_account_response_cb == NULL) { + return LinphoneAccountCreatorStatusMissingCallbacks; } - return creator->requests_cbs->update_account_request_cb(creator); + return creator->service->update_account_request_cb(creator); } /************************** End Account Creator data **************************/ /************************** Start Account Creator Linphone **************************/ -LinphoneRequestStatus linphone_account_creator_constructor_custom(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus linphone_account_creator_constructor_linphone(LinphoneAccountCreator *creator) { linphone_proxy_config_set_realm(creator->proxy_cfg, "sip.linphone.org"); linphone_proxy_config_set_route(creator->proxy_cfg, "sip.linphone.org"); linphone_proxy_config_set_server_addr(creator->proxy_cfg, "sip.linphone.org"); linphone_proxy_config_set_identity(creator->proxy_cfg, "sip:username@sip.linphone.org"); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } /****************** START OF ACCOUNT USED SECTION *****************************/ static void _is_account_exist_response_cb(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->responses_cbs->is_account_exist_response_cb != NULL) { - LinphoneRequestStatus status = LinphoneRequestFailed; + if (creator->cbs->is_account_exist_response_cb != NULL) { + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { - status = (strcmp(resp, "ERROR_ACCOUNT_DOESNT_EXIST") == 0) ? LinphoneRequestAccountNotExist : ( - (strcmp(resp, "ERROR_ALIAS_DOESNT_EXIST") == 0) ? LinphoneRequestAccountExist : - LinphoneRequestAccountExistWithAlias); - if (status == LinphoneRequestAccountExistWithAlias) { + status = (strcmp(resp, "ERROR_ACCOUNT_DOESNT_EXIST") == 0) ? LinphoneAccountCreatorStatusAccountNotExist : ( + (strcmp(resp, "ERROR_ALIAS_DOESNT_EXIST") == 0) ? LinphoneAccountCreatorStatusAccountExist : + LinphoneAccountCreatorStatusAccountExistWithAlias); + if (status == LinphoneAccountCreatorStatusAccountExistWithAlias) { set_string(&creator->phone_number, resp, FALSE); } } - creator->responses_cbs->is_account_exist_response_cb(creator, status, resp); + creator->cbs->is_account_exist_response_cb(creator, status, resp); } } -LinphoneRequestStatus linphone_account_creator_is_account_exist_custom(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus linphone_account_creator_is_account_exist_linphone(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; if (!creator->username && !creator->phone_number) { - if (creator->responses_cbs->is_account_exist_response_cb != NULL) { - creator->responses_cbs->is_account_exist_response_cb(creator, LinphoneRequestMissingArguments, "Missing required parameters"); + if (creator->cbs->is_account_exist_response_cb != NULL) { + creator->cbs->is_account_exist_response_cb(creator, LinphoneAccountCreatorStatusMissingArguments, "Missing required parameters"); } - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "get_phone_number_for_account", @@ -671,24 +671,24 @@ LinphoneRequestStatus linphone_account_creator_is_account_exist_custom(LinphoneA linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } /****************** END OF CREATE ACCOUNT USED SECTION ************************/ /****************** START OF CREATE ACCOUNT SECTION ***************************/ static void _create_account_cb_custom(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->responses_cbs->create_account_response_cb != NULL) { - LinphoneRequestStatus status = LinphoneRequestFailed; + if (creator->cbs->create_account_response_cb != NULL) { + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { - status = (strcmp(resp, "OK") == 0) ? LinphoneRequestAccountCreated - : (strcmp(resp, "ERROR_CANNOT_SEND_SMS") == 0) ? LinphoneRequestErrorServer - : (strcmp(resp, "ERROR_ACCOUNT_ALREADY_IN_USE") == 0) ? LinphoneRequestAccountExist - : (strcmp(resp, "ERROR_ALIAS_ALREADY_IN_USE") == 0) ? LinphoneRequestAccountExistWithAlias - :LinphoneRequestAccountNotCreated; + status = (strcmp(resp, "OK") == 0) ? LinphoneAccountCreatorStatusAccountCreated + : (strcmp(resp, "ERROR_CANNOT_SEND_SMS") == 0) ? LinphoneAccountCreatorStatusServerError + : (strcmp(resp, "ERROR_ACCOUNT_ALREADY_IN_USE") == 0) ? LinphoneAccountCreatorStatusAccountExist + : (strcmp(resp, "ERROR_ALIAS_ALREADY_IN_USE") == 0) ? LinphoneAccountCreatorStatusAccountExistWithAlias + :LinphoneAccountCreatorStatusAccountNotCreated; } - creator->responses_cbs->create_account_response_cb(creator, status, resp); + creator->cbs->create_account_response_cb(creator, status, resp); } } @@ -723,16 +723,16 @@ static LinphoneXmlRpcRequest * _create_account_with_email_custom(LinphoneAccount return request; } -LinphoneRequestStatus linphone_account_creator_create_account_custom(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus linphone_account_creator_create_account_linphone(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; char *identity = _get_identity(creator); if (!identity || (!(request = _create_account_with_phone_custom(creator)) && !(request = _create_account_with_email_custom(creator)))) { - if (creator->responses_cbs->create_account_response_cb != NULL) { - creator->responses_cbs->create_account_response_cb(creator, LinphoneRequestMissingArguments, "Missing required parameters"); + if (creator->cbs->create_account_response_cb != NULL) { + creator->cbs->create_account_response_cb(creator, LinphoneAccountCreatorStatusMissingArguments, "Missing required parameters"); } if (identity) ms_free(identity); - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } linphone_xml_rpc_request_set_user_data(request, creator); @@ -740,38 +740,38 @@ LinphoneRequestStatus linphone_account_creator_create_account_custom(LinphoneAcc linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); ms_free(identity); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } /****************** END OF CREATE ACCOUNT SECTION *****************************/ /****************** START OF VALIDATE ACCOUNT SECTION *************************/ static void _activate_account_cb_custom(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->responses_cbs->activate_account_response_cb != NULL) { - LinphoneRequestStatus status = LinphoneRequestFailed; + if (creator->cbs->activate_account_response_cb != NULL) { + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { if (strcmp(resp, "ERROR_ACCOUNT_ALREADY_ACTIVATED") == 0) { - status = LinphoneRequestAccountAlreadyActivated; + status = LinphoneAccountCreatorStatusAccountAlreadyActivated; } else if (strstr(resp, "ERROR_") == resp) { - status = LinphoneRequestAccountNotActivated; + status = LinphoneAccountCreatorStatusAccountNotActivated; } else { - status = LinphoneRequestAccountActivated; + status = LinphoneAccountCreatorStatusAccountActivated; set_string(&creator->ha1, resp, FALSE); } } - creator->responses_cbs->activate_account_response_cb(creator, status, resp); + creator->cbs->activate_account_response_cb(creator, status, resp); } } -LinphoneRequestStatus linphone_account_creator_activate_account_custom(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus linphone_account_creator_activate_account_linphone(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; char *identity = _get_identity(creator); if (!identity || !creator->activation_code) { - if (creator->responses_cbs->is_account_activated_response_cb != NULL) { - creator->responses_cbs->is_account_activated_response_cb(creator, LinphoneRequestMissingArguments, "Missing required parameters"); + if (creator->cbs->is_account_activated_response_cb != NULL) { + creator->cbs->is_account_activated_response_cb(creator, LinphoneAccountCreatorStatusMissingArguments, "Missing required parameters"); } - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } if (creator->phone_number) { @@ -793,31 +793,31 @@ LinphoneRequestStatus linphone_account_creator_activate_account_custom(LinphoneA linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); ms_free(identity); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } /****************** END OF CREATE VALIDATE ACCOUNT SECTION ********************/ /****************** START OF ACCOUNT VALIDATED SECTION ************************/ static void _is_account_activated_cb_custom(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->responses_cbs->is_account_activated_response_cb != NULL) { - LinphoneRequestStatus status = LinphoneRequestFailed; + if (creator->cbs->is_account_activated_response_cb != NULL) { + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { - status = (strcmp(resp, "OK") == 0) ? LinphoneRequestAccountActivated : LinphoneRequestAccountNotActivated; + status = (strcmp(resp, "OK") == 0) ? LinphoneAccountCreatorStatusAccountActivated : LinphoneAccountCreatorStatusAccountNotActivated; } - creator->responses_cbs->is_account_activated_response_cb(creator, status, resp); + creator->cbs->is_account_activated_response_cb(creator, status, resp); } } -LinphoneRequestStatus linphone_account_creator_is_account_activated_custom(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus linphone_account_creator_is_account_activated_linphone(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; char *identity = _get_identity(creator); if (!identity) { - if (creator->responses_cbs->is_account_activated_response_cb != NULL) { - creator->responses_cbs->is_account_activated_response_cb(creator, LinphoneRequestMissingArguments, "Missing required parameters"); + if (creator->cbs->is_account_activated_response_cb != NULL) { + creator->cbs->is_account_activated_response_cb(creator, LinphoneAccountCreatorStatusMissingArguments, "Missing required parameters"); } - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "is_account_activated", LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number, @@ -828,7 +828,7 @@ LinphoneRequestStatus linphone_account_creator_is_account_activated_custom(Linph linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); ms_free(identity); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } /****************** END OF CREATE ACCOUNT VALIDATED SECTION********************/ @@ -836,26 +836,26 @@ LinphoneRequestStatus linphone_account_creator_is_account_activated_custom(Linph static void _is_phone_number_used_cb_custom(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->responses_cbs->is_alias_used_response_cb != NULL) { - LinphoneRequestStatus status = LinphoneRequestFailed; + if (creator->cbs->is_alias_used_response_cb != NULL) { + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { - status = (strcmp(resp, "OK_ACCOUNT") == 0) ? LinphoneRequestAliasIsAccount - : (strcmp(resp, "OK_ALIAS") == 0) ? LinphoneRequestAliasExist - : LinphoneRequestAliasNotExist; + status = (strcmp(resp, "OK_ACCOUNT") == 0) ? LinphoneAccountCreatorStatusAliasIsAccount + : (strcmp(resp, "OK_ALIAS") == 0) ? LinphoneAccountCreatorStatusAliasExist + : LinphoneAccountCreatorStatusAliasNotExist; } - creator->responses_cbs->is_alias_used_response_cb(creator, status, resp); + creator->cbs->is_alias_used_response_cb(creator, status, resp); } } -LinphoneRequestStatus linphone_account_creator_is_phone_number_used_custom(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus linphone_account_creator_is_phone_number_used_linphone(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; char *identity = _get_identity(creator); if (!identity) { - if (creator->responses_cbs->is_alias_used_response_cb != NULL) { - creator->responses_cbs->is_alias_used_response_cb(creator, LinphoneRequestMissingArguments, "Missing required parameters"); + if (creator->cbs->is_alias_used_response_cb != NULL) { + creator->cbs->is_alias_used_response_cb(creator, LinphoneAccountCreatorStatusMissingArguments, "Missing required parameters"); } - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "is_phone_number_used", LinphoneXmlRpcArgString, creator->phone_number, @@ -866,7 +866,7 @@ LinphoneRequestStatus linphone_account_creator_is_phone_number_used_custom(Linph linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); ms_free(identity); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } /****************** END OF PHONE NUMBER VALIDATED SECTION *********************/ @@ -874,23 +874,23 @@ LinphoneRequestStatus linphone_account_creator_is_phone_number_used_custom(Linph /****************** START OF LINK PHONE NUMBER WITH ACCOUNT SECTION ***********/ static void _link_phone_number_with_account_cb_custom(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->responses_cbs->link_account_response_cb != NULL) { - LinphoneRequestStatus status = LinphoneRequestFailed; + if (creator->cbs->link_account_response_cb != NULL) { + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { - status = (strcmp(resp, "OK") == 0) ? LinphoneRequestOk : LinphoneRequestAccountNotLinked; + status = (strcmp(resp, "OK") == 0) ? LinphoneAccountCreatorStatusRequestOk : LinphoneAccountCreatorStatusAccountNotLinked; } - creator->responses_cbs->link_account_response_cb(creator, status, resp); + creator->cbs->link_account_response_cb(creator, status, resp); } } -LinphoneRequestStatus linphone_account_creator_link_phone_number_with_account_custom(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus linphone_account_creator_link_phone_number_with_account_linphone(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; if (!creator->phone_number || !creator->username) { - if (creator->responses_cbs->link_account_response_cb != NULL) { - creator->responses_cbs->link_account_response_cb(creator, LinphoneRequestMissingArguments, "Missing required parameters"); + if (creator->cbs->link_account_response_cb != NULL) { + creator->cbs->link_account_response_cb(creator, LinphoneAccountCreatorStatusMissingArguments, "Missing required parameters"); } - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "link_phone_number_with_account", LinphoneXmlRpcArgString, creator->phone_number, @@ -902,27 +902,27 @@ LinphoneRequestStatus linphone_account_creator_link_phone_number_with_account_cu linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _link_phone_number_with_account_cb_custom); linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } static void _get_phone_number_for_account_cb_custom(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->responses_cbs->is_account_linked_response_cb != NULL) { - LinphoneRequestStatus status = LinphoneRequestFailed; + if (creator->cbs->is_account_linked_response_cb != NULL) { + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { status = (strcmp(resp, "ERROR_USERNAME_PARAMETER_NOT_FOUND") == 0 || strcmp(resp, "ERROR_ACCOUNT_DOESNT_EXIST") == 0 - || strcmp(resp, "ERROR_ALIAS_DOESNT_EXIST") == 0) ? LinphoneRequestAccountNotLinked : LinphoneRequestAccountLinked; + || strcmp(resp, "ERROR_ALIAS_DOESNT_EXIST") == 0) ? LinphoneAccountCreatorStatusAccountNotLinked : LinphoneAccountCreatorStatusAccountLinked; } - creator->responses_cbs->is_account_linked_response_cb(creator, status, resp); + creator->cbs->is_account_linked_response_cb(creator, status, resp); } } -LinphoneRequestStatus linphone_account_creator_is_account_linked_custom(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus linphone_account_creator_is_account_linked_linphone(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; if (!creator->username || !linphone_proxy_config_get_domain(creator->proxy_cfg)) { - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "get_phone_number_for_account", LinphoneXmlRpcArgString, creator->username, @@ -932,30 +932,30 @@ LinphoneRequestStatus linphone_account_creator_is_account_linked_custom(Linphone linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _get_phone_number_for_account_cb_custom); linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } /****************** END OF LINK PHONE NUMBER WITH ACCOUNT SECTION *************/ /****************** START OF ACTIVE PHONE NUMBER LINK **************************/ static void _activate_phone_number_link_cb_custom(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->responses_cbs->activate_alias_response_cb != NULL) { - LinphoneRequestStatus status = LinphoneRequestFailed; + if (creator->cbs->activate_alias_response_cb != NULL) { + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { - status = (strstr(resp, "ERROR_") == resp) ? LinphoneRequestAccountNotActivated : LinphoneRequestAccountActivated; + status = (strstr(resp, "ERROR_") == resp) ? LinphoneAccountCreatorStatusAccountNotActivated : LinphoneAccountCreatorStatusAccountActivated; } - creator->responses_cbs->activate_alias_response_cb(creator, status, resp); + creator->cbs->activate_alias_response_cb(creator, status, resp); } } -LinphoneRequestStatus linphone_account_creator_activate_phone_number_link_custom(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus linphone_account_creator_activate_phone_number_link_linphone(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; if (!creator->phone_number || !creator->username || !creator->activation_code || (!creator->password && !creator->ha1) || !linphone_proxy_config_get_domain(creator->proxy_cfg)) { - if (creator->responses_cbs->activate_alias_response_cb != NULL) { - creator->responses_cbs->activate_alias_response_cb(creator, LinphoneRequestMissingArguments, "Missing required parameters"); + if (creator->cbs->activate_alias_response_cb != NULL) { + creator->cbs->activate_alias_response_cb(creator, LinphoneAccountCreatorStatusMissingArguments, "Missing required parameters"); } - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "activate_phone_number_link", LinphoneXmlRpcArgString, creator->phone_number, @@ -968,37 +968,37 @@ LinphoneRequestStatus linphone_account_creator_activate_phone_number_link_custom linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _activate_phone_number_link_cb_custom); linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } /****************** END OF ACTIVE PHONE NUMBER LINK **************************/ /****************** START OF ACTIVE PHONE NUMBER LINK **************************/ static void _recover_phone_account_cb_custom(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->responses_cbs->recover_account_response_cb != NULL) { - LinphoneRequestStatus status = LinphoneRequestFailed; + if (creator->cbs->recover_account_response_cb != NULL) { + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { if (strstr(resp, "ERROR_") == resp) { - status = (strstr(resp, "ERROR_CANNOT_SEND_SMS") == resp) ? LinphoneRequestErrorServer - : (strstr(resp, "ERROR_ACCOUNT_DOESNT_EXIST") == resp) ? LinphoneRequestAccountNotExist - : LinphoneRequestFailed; + status = (strstr(resp, "ERROR_CANNOT_SEND_SMS") == resp) ? LinphoneAccountCreatorStatusServerError + : (strstr(resp, "ERROR_ACCOUNT_DOESNT_EXIST") == resp) ? LinphoneAccountCreatorStatusAccountNotExist + : LinphoneAccountCreatorStatusRequestFailed; } else { - status = LinphoneRequestOk; + status = LinphoneAccountCreatorStatusRequestOk; set_string(&creator->username, resp, FALSE); } } - creator->responses_cbs->recover_account_response_cb(creator, status, resp); + creator->cbs->recover_account_response_cb(creator, status, resp); } } -LinphoneRequestStatus linphone_account_creator_recover_phone_account_custom(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus linphone_account_creator_recover_phone_account_linphone(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; if (!creator->phone_number) { - if (creator->responses_cbs->recover_account_response_cb != NULL) { - creator->responses_cbs->recover_account_response_cb(creator, LinphoneRequestMissingArguments, "Missing required parameters"); + if (creator->cbs->recover_account_response_cb != NULL) { + creator->cbs->recover_account_response_cb(creator, LinphoneAccountCreatorStatusMissingArguments, "Missing required parameters"); } - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "recover_phone_account", LinphoneXmlRpcArgString, creator->phone_number, @@ -1009,30 +1009,30 @@ LinphoneRequestStatus linphone_account_creator_recover_phone_account_custom(Linp linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _recover_phone_account_cb_custom); linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } /****************** END OF ACTIVE PHONE NUMBER LINK **************************/ /****************** START OF UPDATE ACCOUNT **************************/ static void _password_updated_cb_custom(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->responses_cbs->update_account_response_cb != NULL) { - LinphoneRequestStatus status = LinphoneRequestFailed; + if (creator->cbs->update_account_response_cb != NULL) { + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { if (strcmp(resp, "OK") == 0) { - status = LinphoneRequestOk; + status = LinphoneAccountCreatorStatusRequestOk; } else if (strcmp(resp, "ERROR_PASSWORD_DOESNT_MATCH") == 0) { - status = LinphoneRequestAccountNotExist; + status = LinphoneAccountCreatorStatusAccountNotExist; } else { - status = LinphoneRequestErrorServer; + status = LinphoneAccountCreatorStatusServerError; } } - creator->responses_cbs->update_account_response_cb(creator, status, resp); + creator->cbs->update_account_response_cb(creator, status, resp); } } -LinphoneRequestStatus linphone_account_creator_update_password_custom(LinphoneAccountCreator *creator){ +LinphoneAccountCreatorStatus linphone_account_creator_update_password_linphone(LinphoneAccountCreator *creator){ LinphoneXmlRpcRequest *request; char *identity = _get_identity(creator); const char* new_pwd = (const char*)linphone_account_creator_get_user_data(creator); @@ -1042,10 +1042,10 @@ LinphoneRequestStatus linphone_account_creator_update_password_custom(LinphoneAc || (!creator->password && !creator->ha1) || !new_pwd ) ) { - if (creator->responses_cbs->update_account_response_cb != NULL) { - creator->responses_cbs->update_account_response_cb(creator, LinphoneRequestMissingArguments, "Missing required parameters"); + if (creator->cbs->update_account_response_cb != NULL) { + creator->cbs->update_account_response_cb(creator, LinphoneAccountCreatorStatusMissingArguments, "Missing required parameters"); } - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } const char * username = creator->username ? creator->username : creator->phone_number; @@ -1064,7 +1064,7 @@ LinphoneRequestStatus linphone_account_creator_update_password_custom(LinphoneAc linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } /****************** END OF UPDATE ACCOUNT **************************/ diff --git a/coreapi/account_creator_request_engine.c b/coreapi/account_creator_request_engine.c deleted file mode 100644 index fce88ea79..000000000 --- a/coreapi/account_creator_request_engine.c +++ /dev/null @@ -1,161 +0,0 @@ -/* -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 cb) { - requests_cbs->account_creator_request_constructor_cb = cb; -} - -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 cb) { - requests_cbs->account_creator_request_destructor_cb = cb; -} - -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_activate_alias_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) { - return requests_cbs->activate_alias_request_cb; -} - -void linphone_account_creator_requests_cbs_set_activate_alias_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) { - requests_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; -} diff --git a/coreapi/account_creator_service.c b/coreapi/account_creator_service.c new file mode 100644 index 000000000..cd090148f --- /dev/null +++ b/coreapi/account_creator_service.c @@ -0,0 +1,161 @@ +/* +account_creator_service.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_service.h" +#include "linphone/core.h" +#include "private.h" + +BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneAccountCreatorService); + +BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreatorService, belle_sip_object_t, + NULL, // destroy + NULL, // clone + NULL, // marshal + FALSE +); + +/************************** Start Account Creator service **************************/ +LinphoneAccountCreatorService * linphone_account_creator_service_new(void) { + return belle_sip_object_new(LinphoneAccountCreatorService); +} + +LinphoneAccountCreatorService * linphone_account_creator_service_ref(LinphoneAccountCreatorService *service) { + belle_sip_object_ref(service); + return service; +} + +void linphone_account_creator_service_unref(LinphoneAccountCreatorService *service) { + belle_sip_object_unref(service); +} + +void *linphone_account_creator_service_get_user_data(const LinphoneAccountCreatorService *service) { + return service->user_data; +} + +void linphone_account_creator_service_set_user_data(LinphoneAccountCreatorService *service, void *ud) { + service->user_data = ud; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_constructor_cb(const LinphoneAccountCreatorService *service) { + return service->account_creator_service_constructor_cb; +} + +void linphone_account_creator_service_set_constructor_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->account_creator_service_constructor_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_destructor_cb(const LinphoneAccountCreatorService *service) { + return service->account_creator_service_destructor_cb; +} + +void linphone_account_creator_service_set_destructor_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->account_creator_service_destructor_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_create_account_cb(const LinphoneAccountCreatorService *service) { + return service->create_account_request_cb; +} + +void linphone_account_creator_service_set_create_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->create_account_request_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_exist_cb(const LinphoneAccountCreatorService *service) { + return service->is_account_exist_request_cb; +} + +void linphone_account_creator_service_set_is_account_exist_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->is_account_exist_request_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_activate_account_cb(const LinphoneAccountCreatorService *service) { + return service->activate_account_request_cb; +} + +void linphone_account_creator_service_set_activate_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->activate_account_request_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_activated_cb(const LinphoneAccountCreatorService *service) { + return service->is_account_activated_request_cb; +} + +void linphone_account_creator_service_set_is_account_activated_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->is_account_activated_request_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_link_account_cb(const LinphoneAccountCreatorService *service) { + return service->link_account_request_cb; +} + +void linphone_account_creator_service_set_link_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->link_account_request_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_activate_alias_cb(const LinphoneAccountCreatorService *service) { + return service->activate_alias_request_cb; +} + +void linphone_account_creator_service_set_activate_alias_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->activate_alias_request_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_alias_used_cb(const LinphoneAccountCreatorService *service) { + return service->is_alias_used_request_cb; +} + +void linphone_account_creator_service_set_is_alias_used_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->is_alias_used_request_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_linked_cb(const LinphoneAccountCreatorService *service) { + return service->is_account_linked_request_cb; +} + +void linphone_account_creator_service_set_is_account_linked_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->is_account_linked_request_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_recover_account_cb(const LinphoneAccountCreatorService *service) { + return service->is_account_linked_request_cb; +} + +void linphone_account_creator_service_set_recover_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->recover_account_request_cb = cb; +} + +LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_update_account_cb(const LinphoneAccountCreatorService *service) { + return service->update_account_request_cb; +} + +void linphone_account_creator_service_set_update_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) { + service->update_account_request_cb = cb; +} + +/************************** End Account Creator service **************************/ + +void linphone_core_set_account_creator_service(LinphoneCore *lc, LinphoneAccountCreatorService *service) { + if (lc->default_ac_service) + linphone_account_creator_service_unref(lc->default_ac_service); + lc->default_ac_service = service; +} + +LinphoneAccountCreatorService * linphone_core_get_account_creator_service(LinphoneCore *lc) { + return lc->default_ac_service; +} diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 236b6e322..9fe02609f 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2080,21 +2080,21 @@ 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 = linphone_account_creator_constructor_custom; - 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_account_creator_service(LinphoneCore *lc) { + LinphoneAccountCreatorService *service = linphone_account_creator_service_new(); + service->account_creator_service_constructor_cb = linphone_account_creator_constructor_linphone; + service->account_creator_service_destructor_cb = NULL; + service->create_account_request_cb = linphone_account_creator_create_account_linphone; + service->is_account_exist_request_cb = linphone_account_creator_is_account_exist_linphone; + service->activate_account_request_cb = linphone_account_creator_activate_account_linphone; + service->is_account_activated_request_cb = linphone_account_creator_is_account_activated_linphone; + service->link_account_request_cb = linphone_account_creator_link_phone_number_with_account_linphone; + service->activate_alias_request_cb = linphone_account_creator_activate_phone_number_link_linphone; + service->is_alias_used_request_cb = linphone_account_creator_is_phone_number_used_linphone; + service->is_account_linked_request_cb = linphone_account_creator_is_account_linked_linphone; + service->recover_account_request_cb = linphone_account_creator_recover_phone_account_linphone; + service->update_account_request_cb = linphone_account_creator_update_password_linphone; + linphone_core_set_account_creator_service(lc, service); } static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig *config, void * userdata){ @@ -2112,7 +2112,7 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig linphone_task_list_init(&lc->hooks); - _linphone_core_init_account_creator_request_cbs(lc); + _linphone_core_init_account_creator_service(lc); linphone_core_cbs_set_notify_received(internal_cbs, linphone_core_internal_notify_received); linphone_core_cbs_set_subscription_state_changed(internal_cbs, linphone_core_internal_subscription_state_changed); @@ -5763,8 +5763,8 @@ 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); + if (lc->default_ac_service) { + linphone_account_creator_service_unref(lc->default_ac_service); } linphone_core_free_payload_types(lc); diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 2eb94f8e1..d754d6423 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -8188,15 +8188,15 @@ extern "C" void Java_org_linphone_core_LinphoneXmlRpcSessionImpl_sendRequest(JNI // Account creator -static void account_creator_is_account_used(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) { +static void account_creator_is_account_used(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { ms_error("cannot attach VM\n"); return; } - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs); if (listener == NULL) { ms_error("account_creator_response() notification without listener"); return ; @@ -8213,7 +8213,7 @@ static void account_creator_is_account_used(LinphoneAccountCreator *creator, Lin env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject); } -static void account_creator_create_account(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) { +static void account_creator_create_account(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -8221,8 +8221,8 @@ static void account_creator_create_account(LinphoneAccountCreator *creator, Linp return; } - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs); if (listener == NULL) { ms_error("account_creator_response() notification without listener"); return ; @@ -8239,7 +8239,7 @@ static void account_creator_create_account(LinphoneAccountCreator *creator, Linp env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject); } -static void account_creator_activate_account(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) { +static void account_creator_activate_account(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -8247,8 +8247,8 @@ static void account_creator_activate_account(LinphoneAccountCreator *creator, Li return; } - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs); if (listener == NULL) { ms_error("account_creator_response() notification without listener"); return ; @@ -8265,7 +8265,7 @@ static void account_creator_activate_account(LinphoneAccountCreator *creator, Li env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject); } -static void account_creator_link_phone_number_with_account(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) { +static void account_creator_link_phone_number_with_account(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -8273,8 +8273,8 @@ static void account_creator_link_phone_number_with_account(LinphoneAccountCreato return; } - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs); if (listener == NULL) { ms_error("account_creator_response() notification without listener"); return ; @@ -8291,7 +8291,7 @@ static void account_creator_link_phone_number_with_account(LinphoneAccountCreato env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject); } -static void account_creator_activate_phone_number_link(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) { +static void account_creator_activate_phone_number_link(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -8299,8 +8299,8 @@ static void account_creator_activate_phone_number_link(LinphoneAccountCreator *c return; } - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs); if (listener == NULL) { ms_error("account_creator_response() notification without listener"); return ; @@ -8317,7 +8317,7 @@ static void account_creator_activate_phone_number_link(LinphoneAccountCreator *c env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject); } -static void account_creator_is_account_linked(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) { +static void account_creator_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -8325,8 +8325,8 @@ static void account_creator_is_account_linked(LinphoneAccountCreator *creator, L return; } - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs); if (listener == NULL) { ms_error("account_creator_response() notification without listener"); return ; @@ -8343,7 +8343,7 @@ static void account_creator_is_account_linked(LinphoneAccountCreator *creator, L env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject); } -static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) { +static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -8351,8 +8351,8 @@ static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator return; } - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs); if (listener == NULL) { ms_error("account_creator_response() notification without listener"); return ; @@ -8369,7 +8369,7 @@ static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject); } -static void account_creator_is_account_activated(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) { +static void account_creator_is_account_activated(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -8377,8 +8377,8 @@ static void account_creator_is_account_activated(LinphoneAccountCreator *creator return; } - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs); if (listener == NULL) { ms_error("account_creator_response() notification without listener"); return ; @@ -8395,7 +8395,7 @@ static void account_creator_is_account_activated(LinphoneAccountCreator *creator env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject); } -static void account_creator_phone_account_recovered(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) { +static void account_creator_phone_account_recovered(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -8403,8 +8403,8 @@ static void account_creator_phone_account_recovered(LinphoneAccountCreator *crea return; } - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs); if (listener == NULL) { ms_error("account_creator_response() notification without listener"); return ; @@ -8421,7 +8421,7 @@ static void account_creator_phone_account_recovered(LinphoneAccountCreator *crea env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject); } -static void account_creator_password_updated(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) { +static void account_creator_password_updated(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -8429,8 +8429,8 @@ static void account_creator_password_updated(LinphoneAccountCreator *creator, Li return; } - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs); if (listener == NULL) { ms_error("account_creator_response() notification without listener"); return ; @@ -8463,26 +8463,26 @@ extern "C" void Java_org_linphone_core_LinphoneAccountCreatorImpl_unref(JNIEnv * extern "C" void Java_org_linphone_core_LinphoneAccountCreatorImpl_setListener(JNIEnv* env, jobject thiz, jlong ptr, jobject jlistener) { LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; jobject listener = env->NewGlobalRef(jlistener); - LinphoneAccountCreatorResponseCbs *cbs; + LinphoneAccountCreatorCbs *cbs; - cbs = linphone_account_creator_get_responses_cbs(account_creator); - linphone_account_creator_responses_cbs_set_user_data(cbs, listener); - linphone_account_creator_responses_cbs_set_is_account_exist_cb(cbs, account_creator_is_account_used); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_create_account); - linphone_account_creator_responses_cbs_set_activate_account_cb(cbs, account_creator_activate_account); - linphone_account_creator_responses_cbs_set_link_account_cb(cbs, account_creator_link_phone_number_with_account); - linphone_account_creator_responses_cbs_set_activate_alias_cb(cbs, account_creator_activate_phone_number_link); - linphone_account_creator_responses_cbs_set_is_account_activated_cb(cbs, account_creator_is_account_activated); - linphone_account_creator_responses_cbs_set_recover_account_cb(cbs, account_creator_phone_account_recovered); - linphone_account_creator_responses_cbs_set_is_alias_used_cb(cbs, account_creator_is_phone_number_used); - linphone_account_creator_responses_cbs_set_is_account_linked_cb(cbs, account_creator_is_account_linked); - linphone_account_creator_responses_cbs_set_update_account_cb(cbs, account_creator_password_updated); + cbs = linphone_account_creator_get_callbacks(account_creator); + linphone_account_creator_cbs_set_user_data(cbs, listener); + linphone_account_creator_cbs_set_is_account_exist(cbs, account_creator_is_account_used); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_create_account); + linphone_account_creator_cbs_set_activate_account(cbs, account_creator_activate_account); + linphone_account_creator_cbs_set_link_account(cbs, account_creator_link_phone_number_with_account); + linphone_account_creator_cbs_set_activate_alias(cbs, account_creator_activate_phone_number_link); + linphone_account_creator_cbs_set_is_account_activated(cbs, account_creator_is_account_activated); + linphone_account_creator_cbs_set_recover_account(cbs, account_creator_phone_account_recovered); + linphone_account_creator_cbs_set_is_alias_used(cbs, account_creator_is_phone_number_used); + linphone_account_creator_cbs_set_is_account_linked(cbs, account_creator_is_account_linked); + linphone_account_creator_cbs_set_update_account(cbs, account_creator_password_updated); } extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setUsername(JNIEnv *env, jobject thiz, jlong ptr, jstring jusername) { const char *username = GetStringUTFChars(env, jusername); LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; - LinphoneUsernameCheck status = linphone_account_creator_set_username(account_creator, username); + LinphoneAccountCreatorUsernameStatus status = linphone_account_creator_set_username(account_creator, username); ReleaseStringUTFChars(env, jusername, username); return (jint) status; } @@ -8497,7 +8497,7 @@ extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setPhoneNumber const char *phone_number = GetStringUTFChars(env, jphonenumber); const char *country_code = GetStringUTFChars(env, jcountrycode); LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; - LinphonePhoneNumberMask status = linphone_account_creator_set_phone_number(account_creator, phone_number, country_code); + LinphoneAccountCreatorPhoneNumberStatusMask status = linphone_account_creator_set_phone_number(account_creator, phone_number, country_code); ReleaseStringUTFChars(env, jphonenumber, phone_number); ReleaseStringUTFChars(env, jcountrycode, country_code); return (jint) status; @@ -8512,7 +8512,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getPhoneNum extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setPassword(JNIEnv *env, jobject thiz, jlong ptr, jstring jpassword) { const char *password = GetStringUTFChars(env, jpassword); LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; - LinphonePasswordCheck status = linphone_account_creator_set_password(account_creator, password); + LinphoneAccountCreatorPasswordStatus status = linphone_account_creator_set_password(account_creator, password); ReleaseStringUTFChars(env, jpassword, password); return (jint) status; } @@ -8526,7 +8526,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getPassword extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setHa1(JNIEnv *env, jobject thiz, jlong ptr, jstring jha1) { const char *ha1 = GetStringUTFChars(env, jha1); LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; - LinphonePasswordCheck status = linphone_account_creator_set_ha1(account_creator, ha1); + LinphoneAccountCreatorPasswordStatus status = linphone_account_creator_set_ha1(account_creator, ha1); ReleaseStringUTFChars(env, jha1, ha1); return (jint) status; } @@ -8540,7 +8540,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getHa1(JNIE extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setActivationCode(JNIEnv *env, jobject thiz, jlong ptr, jstring jcode) { const char *activation_code = GetStringUTFChars(env, jcode); LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; - LinphoneActivationCodeCheck status = linphone_account_creator_set_activation_code(account_creator, activation_code); + LinphoneAccountCreatorActivationCodeStatus status = linphone_account_creator_set_activation_code(account_creator, activation_code); ReleaseStringUTFChars(env, jcode, activation_code); return (jint) status; } @@ -8548,7 +8548,7 @@ extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setActivationC extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setLanguage(JNIEnv *env, jobject thiz, jlong ptr, jstring jlang) { const char *lang = GetStringUTFChars(env, jlang); LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; - LinphoneLanguageCheck status = linphone_account_creator_set_language(account_creator, lang); + LinphoneAccountCreatorLanguageStatus status = linphone_account_creator_set_language(account_creator, lang); ReleaseStringUTFChars(env, jlang, lang); return (jint) status; } @@ -8556,7 +8556,7 @@ extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setLanguage(JN extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setDisplayName(JNIEnv *env, jobject thiz, jlong ptr, jstring jname) { const char *name = GetStringUTFChars(env, jname); LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; - LinphoneUsernameCheck status = linphone_account_creator_set_display_name(account_creator, name); + LinphoneAccountCreatorUsernameStatus status = linphone_account_creator_set_display_name(account_creator, name); ReleaseStringUTFChars(env, jname, name); return (jint) status; } @@ -8570,7 +8570,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getDisplayN extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setEmail(JNIEnv *env, jobject thiz, jlong ptr, jstring jemail) { const char *email = GetStringUTFChars(env, jemail); LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; - LinphoneEmailCheck status = linphone_account_creator_set_email(account_creator, email); + LinphoneAccountCreatorEmailStatus status = linphone_account_creator_set_email(account_creator, email); ReleaseStringUTFChars(env, jemail, email); return (jint) status; } diff --git a/coreapi/private.h b/coreapi/private.h index f4dffdfd0..67c384efc 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -1128,7 +1128,7 @@ struct _LinphoneCore LinphoneAddress *default_rls_addr; /*default resource list server*/ LinphoneImEncryptionEngine *im_encryption_engine; - struct _LinphoneAccountCreatorRequestCbs *default_ac_request_cbs; + struct _LinphoneAccountCreatorService *default_ac_service; MSBandwidthController *bw_controller; }; @@ -1414,12 +1414,12 @@ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneXmlRpcSession); * Account creator interface * ****************************************************************************/ -struct _LinphoneAccountCreatorRequestCbs { +struct _LinphoneAccountCreatorService { belle_sip_object_t base; void *user_data; - LinphoneAccountCreatorRequestFunc account_creator_request_constructor_cb; /**< Constructor */ - LinphoneAccountCreatorRequestFunc account_creator_request_destructor_cb; /**< Destructor */ + LinphoneAccountCreatorRequestFunc account_creator_service_constructor_cb; /**< Constructor */ + LinphoneAccountCreatorRequestFunc account_creator_service_destructor_cb; /**< Destructor */ LinphoneAccountCreatorRequestFunc create_account_request_cb; /**< Request to create account */ LinphoneAccountCreatorRequestFunc is_account_exist_request_cb; /**< Request to know if account exist */ @@ -1436,28 +1436,28 @@ struct _LinphoneAccountCreatorRequestCbs { LinphoneAccountCreatorRequestFunc update_account_request_cb; /**< Request to update account */ }; -BELLE_SIP_DECLARE_VPTR(LinphoneAccountCreatorRequestCbs); +BELLE_SIP_DECLARE_VPTR(LinphoneAccountCreatorService); -struct _LinphoneAccountCreatorResponseCbs { +struct _LinphoneAccountCreatorCbs { belle_sip_object_t base; void *user_data; - LinphoneAccountCreatorResponseFunc create_account_response_cb; /**< Response of create_account request */ - LinphoneAccountCreatorResponseFunc is_account_exist_response_cb; /**< Response of is_account_exist request */ + LinphoneAccountCreatorCbsStatusCb create_account_response_cb; /**< Response of create_account request */ + LinphoneAccountCreatorCbsStatusCb is_account_exist_response_cb; /**< Response of is_account_exist request */ - LinphoneAccountCreatorResponseFunc activate_account_response_cb; /**< Response of activate_account request */ - LinphoneAccountCreatorResponseFunc is_account_activated_response_cb; /**< Response of is_account_activated request */ + LinphoneAccountCreatorCbsStatusCb activate_account_response_cb; /**< Response of activate_account request */ + LinphoneAccountCreatorCbsStatusCb is_account_activated_response_cb; /**< Response of is_account_activated request */ - LinphoneAccountCreatorResponseFunc link_account_response_cb; /**< Response of link_account request */ - LinphoneAccountCreatorResponseFunc activate_alias_response_cb; /**< Response of activation alias */ - LinphoneAccountCreatorResponseFunc is_alias_used_response_cb; /**< Response of is_alias_used request */ - LinphoneAccountCreatorResponseFunc is_account_linked_response_cb; /**< Response of is_account_linked request */ + LinphoneAccountCreatorCbsStatusCb link_account_response_cb; /**< Response of link_account request */ + LinphoneAccountCreatorCbsStatusCb activate_alias_response_cb; /**< Response of activation alias */ + LinphoneAccountCreatorCbsStatusCb is_alias_used_response_cb; /**< Response of is_alias_used request */ + LinphoneAccountCreatorCbsStatusCb is_account_linked_response_cb; /**< Response of is_account_linked request */ - LinphoneAccountCreatorResponseFunc recover_account_response_cb; /**< Response of recover_account request */ - LinphoneAccountCreatorResponseFunc update_account_response_cb; /**< Response of update_account request */ + LinphoneAccountCreatorCbsStatusCb recover_account_response_cb; /**< Response of recover_account request */ + LinphoneAccountCreatorCbsStatusCb update_account_response_cb; /**< Response of update_account request */ }; -BELLE_SIP_DECLARE_VPTR(LinphoneAccountCreatorResponseCbs); +BELLE_SIP_DECLARE_VPTR(LinphoneAccountCreatorCbs); struct _LinphoneAccountCreator { belle_sip_object_t base; @@ -1465,8 +1465,8 @@ struct _LinphoneAccountCreator { LinphoneCore *core; /* AccountCreator */ - LinphoneAccountCreatorRequestCbs *requests_cbs; /**< Account creator requests cbs */ - LinphoneAccountCreatorResponseCbs *responses_cbs; /**< Account creator responses cbs */ + LinphoneAccountCreatorService *service; /**< Account creator service */ + LinphoneAccountCreatorCbs *cbs; /**< Account creator cbs */ LinphoneXmlRpcSession *xmlrpc_session; /**< XML-RPC session */ LinphoneProxyConfig *proxy_cfg; /**< Default proxy config */ @@ -1492,6 +1492,85 @@ struct _LinphoneAccountCreator { BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneAccountCreator); +/** + * Account creator custom to set Linphone default values + * @param[in] creator LinphoneAccountCreator object + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_constructor_linphone(LinphoneAccountCreator *creator); + +/** + * Send an XML-RPC request to test the existence of a Linphone account. + * @param[in] creator LinphoneAccountCreator object + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_exist_linphone(LinphoneAccountCreator *creator); + +/** + * Send an XML-RPC request to create a Linphone account. + * @param[in] creator LinphoneAccountCreator object + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_create_account_linphone(LinphoneAccountCreator *creator); + +/** + * Send an XML-RPC request to activate a Linphone account. + * @param[in] creator LinphoneAccountCreator object + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_account_linphone(LinphoneAccountCreator *creator); + +/** + * Send an XML-RPC request to test the validation of a Linphone account. + * @param[in] creator LinphoneAccountCreator object + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_activated_linphone(LinphoneAccountCreator *creator); + +/** + * Send an XML-RPC request to test the existence a phone number with a Linphone account. + * @param[in] creator LinphoneAccountCreator object + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_phone_number_used_linphone(LinphoneAccountCreator *creator); + +/** + * Send an XML-RPC request to link a phone number with a Linphone account. + * @param[in] creator LinphoneAccountCreator object + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_link_phone_number_with_account_linphone(LinphoneAccountCreator *creator); + +/** + * Send an XML-RPC request to activate the link of a phone number with a Linphone account. + * @param[in] creator LinphoneAccountCreator object + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_phone_number_link_linphone(LinphoneAccountCreator *creator); + +/** + * Send an XML-RPC request to a Linphone account with the phone number. + * @param[in] creator LinphoneAccountCreator object + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_recover_phone_account_linphone(LinphoneAccountCreator *creator); + +/** + * Send an XML-RPC request to ask if an account is linked with a phone number + * @param[in] creator LinphoneAccountCreator object + * @return if this account is linked with a phone number +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_linked_linphone(LinphoneAccountCreator *creator); + +/** + * Send an XML-RPC request to ask if an account is linked with a phone number + * @param[in] creator LinphoneAccountCreator object + * @param[in] new_pwd const char * : new password for the account creator + * @return LinphoneAccountCreatorStatusRequestOk if everything is OK, or a specific error otherwise. +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_update_password_linphone(LinphoneAccountCreator *creator); + + /***************************************************************************** * CardDAV interface * ****************************************************************************/ @@ -1638,8 +1717,8 @@ LINPHONE_PUBLIC LinphoneImEncryptionEngine *linphone_im_encryption_engine_new(Li BELLE_SIP_DECLARE_TYPES_BEGIN(linphone,10000) BELLE_SIP_TYPE_ID(LinphoneAccountCreator), -BELLE_SIP_TYPE_ID(LinphoneAccountCreatorRequestCbs), -BELLE_SIP_TYPE_ID(LinphoneAccountCreatorResponseCbs), +BELLE_SIP_TYPE_ID(LinphoneAccountCreatorCbs), +BELLE_SIP_TYPE_ID(LinphoneAccountCreatorService), BELLE_SIP_TYPE_ID(LinphoneBuffer), BELLE_SIP_TYPE_ID(LinphoneContactProvider), BELLE_SIP_TYPE_ID(LinphoneContactSearch), diff --git a/gtk/setupwizard.c b/gtk/setupwizard.c index 96d37776d..4ea81bac9 100644 --- a/gtk/setupwizard.c +++ b/gtk/setupwizard.c @@ -31,9 +31,9 @@ static LinphoneAccountCreator * linphone_gtk_assistant_get_creator(GtkWidget *w) return (LinphoneAccountCreator *)g_object_get_data(G_OBJECT(w), "creator"); } -static void linphone_gtk_create_account_cb(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char* resp) { +static void linphone_gtk_create_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp) { GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator); - if (status == LinphoneRequestAccountCreated) { + if (status == LinphoneAccountCreatorStatusAccountCreated) { // Go to page_6_linphone_account_validation_wait gtk_assistant_set_current_page(GTK_ASSISTANT(assistant), 6); } else { // Error when attempting to create the account @@ -48,9 +48,9 @@ static void create_account(GtkWidget *assistant) { linphone_account_creator_create_account(creator); } -static void linphone_gtk_test_account_validation_cb(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char* resp) { +static void linphone_gtk_test_account_validation_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp) { GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator); - if (status == LinphoneRequestAccountActivated) { + if (status == LinphoneAccountCreatorStatusAccountActivated) { // Go to page_9_finish gtk_assistant_set_current_page(GTK_ASSISTANT(assistant), 9); } else { @@ -215,11 +215,11 @@ static gboolean update_interface_with_username_availability(GtkWidget *page) { GtkLabel* usernameError = GTK_LABEL(linphone_gtk_get_widget(assistant, "p4_label_error")); int account_status = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(page), "is_username_used")); - if (account_status == LinphoneRequestAccountNotExist) { + if (account_status == LinphoneAccountCreatorStatusAccountNotExist) { g_object_set_data(G_OBJECT(page), "is_username_available", GINT_TO_POINTER(1)); gtk_image_set_from_stock(isUsernameOk, GTK_STOCK_OK, GTK_ICON_SIZE_LARGE_TOOLBAR); gtk_label_set_text(usernameError, ""); - } else if (account_status == LinphoneRequestAccountExist) { + } else if (account_status == LinphoneAccountCreatorStatusAccountExist) { gtk_label_set_text(usernameError, _("Username is already in use!")); g_object_set_data(G_OBJECT(page), "is_username_available", GINT_TO_POINTER(0)); gtk_image_set_from_stock(isUsernameOk, GTK_STOCK_NO, GTK_ICON_SIZE_LARGE_TOOLBAR); @@ -232,7 +232,7 @@ static gboolean update_interface_with_username_availability(GtkWidget *page) { return FALSE; } -static void linphone_gtk_test_account_existence_cb(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char* resp) { +static void linphone_gtk_test_account_existence_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp) { GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator); 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), "is_username_used", GINT_TO_POINTER(status)); @@ -324,11 +324,11 @@ void linphone_gtk_account_creation_password_changed(GtkEntry *entry) { static void linphone_gtk_assistant_init(GtkWidget *w) { LinphoneAccountCreator *creator = linphone_account_creator_new(linphone_gtk_get_core(), "https://subscribe.linphone.org:444/wizard.php"); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); linphone_account_creator_set_user_data(creator, w); - linphone_account_creator_responses_cbs_set_is_account_exist_cb(cbs, linphone_gtk_test_account_existence_cb); - linphone_account_creator_responses_cbs_set_is_account_activated_cb(cbs, linphone_gtk_test_account_validation_cb); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, linphone_gtk_create_account_cb); + linphone_account_creator_cbs_set_is_account_exist(cbs, linphone_gtk_test_account_existence_cb); + linphone_account_creator_cbs_set_is_account_activated(cbs, linphone_gtk_test_account_validation_cb); + linphone_account_creator_cbs_set_create_account(cbs, linphone_gtk_create_account_cb); g_object_set_data(G_OBJECT(w), "creator", creator); gtk_assistant_set_forward_page_func(GTK_ASSISTANT(w), linphone_gtk_assistant_forward, w, NULL); diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 3125601ee..0534b57b1 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -22,7 +22,7 @@ set(HEADER_FILES account_creator.h - account_creator_request_engine.h + account_creator_service.h address.h auth_info.h buffer.h diff --git a/include/linphone/Makefile.am b/include/linphone/Makefile.am index d8df9c528..2aaf58f40 100644 --- a/include/linphone/Makefile.am +++ b/include/linphone/Makefile.am @@ -2,7 +2,7 @@ linphone_includedir=$(includedir)/linphone linphone_include_HEADERS=\ account_creator.h \ - account_creator_request_engine.h \ + account_creator_service.h \ address.h \ auth_info.h \ buffer.h \ diff --git a/include/linphone/account_creator.h b/include/linphone/account_creator.h index 30f48556f..14f0f3ca9 100644 --- a/include/linphone/account_creator.h +++ b/include/linphone/account_creator.h @@ -36,7 +36,7 @@ extern "C" { * @param[in] creator LinphoneAccountCreator object * @param[in] status The status of the LinphoneAccountCreator test existence operation that has just finished **/ -typedef void (*LinphoneAccountCreatorResponseFunc)(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char* resp); +typedef void (*LinphoneAccountCreatorCbsStatusCb)(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp); /************************** Start Account Creator data **************************/ @@ -51,72 +51,72 @@ LINPHONE_PUBLIC LinphoneAccountCreator * linphone_account_creator_new(LinphoneCo /** * 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 + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise **/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_exist(LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_exist(LinphoneAccountCreator *creator); /** * Send a request to create an account on server. * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise **/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator); /** * 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 + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise **/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_activated(LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_activated(LinphoneAccountCreator *creator); /** * Send a request to activate an account on server. * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise **/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_activate_account(LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_account(LinphoneAccountCreator *creator); /** * 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 + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise **/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_link_account(LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_link_account(LinphoneAccountCreator *creator); /** * Send a request to activate an alias. * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise **/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_activate_alias(LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_alias(LinphoneAccountCreator *creator); /** * 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 + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise **/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_alias_used(LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_alias_used(LinphoneAccountCreator *creator); /** * 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 + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise **/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_linked(LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_linked(LinphoneAccountCreator *creator); /** * Send a request to recover an account. * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise **/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_recover_account(LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_recover_account(LinphoneAccountCreator *creator); /** * Send a request to update an account. * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise + * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise **/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_update_account(LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_update_account(LinphoneAccountCreator *creator); /** * Acquire a reference to the LinphoneAccountCreator. @@ -149,9 +149,9 @@ LINPHONE_PUBLIC void linphone_account_creator_set_user_data(LinphoneAccountCreat * Set the username. * @param[in] creator LinphoneAccountCreator object * @param[in] username The username to set - * @return LinphoneUsernameOk if everything is OK, or a specific error otherwise. + * @return LinphoneAccountCreatorUsernameStatusOk if everything is OK, or a specific error otherwise. **/ -LINPHONE_PUBLIC LinphoneUsernameCheck linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username); +LINPHONE_PUBLIC LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username); /** * Get the username. @@ -165,9 +165,9 @@ LINPHONE_PUBLIC const char * linphone_account_creator_get_username(const Linphon * @param[in] creator LinphoneAccountCreator object * @param[in] phone_number The phone number to set * @param[in] country_code Country code to associate phone number with - * @return LinphonePhoneNumberOk if everything is OK, or specific(s) error(s) otherwise. + * @return LinphoneAccountCreatorPhoneNumberStatusOk if everything is OK, or specific(s) error(s) otherwise. **/ -LINPHONE_PUBLIC LinphonePhoneNumberMask linphone_account_creator_set_phone_number(LinphoneAccountCreator *creator, const char *phone_number, const char *country_code); +LINPHONE_PUBLIC LinphoneAccountCreatorPhoneNumberStatusMask linphone_account_creator_set_phone_number(LinphoneAccountCreator *creator, const char *phone_number, const char *country_code); /** * Get the RFC 3966 normalized phone number. @@ -180,9 +180,9 @@ LINPHONE_PUBLIC const char * linphone_account_creator_get_phone_number(const Lin * Set the password. * @param[in] creator LinphoneAccountCreator object * @param[in] password The password to set - * @return LinphonePasswordOk if everything is OK, or specific(s) error(s) otherwise. + * @return LinphoneAccountCreatorPasswordStatusOk if everything is OK, or specific(s) error(s) otherwise. **/ -LINPHONE_PUBLIC LinphonePasswordCheck linphone_account_creator_set_password(LinphoneAccountCreator *creator, const char *password); +LINPHONE_PUBLIC LinphoneAccountCreatorPasswordStatus linphone_account_creator_set_password(LinphoneAccountCreator *creator, const char *password); /** * Get the password. @@ -195,9 +195,9 @@ LINPHONE_PUBLIC const char * linphone_account_creator_get_password(const Linphon * Set the ha1. * @param[in] creator LinphoneAccountCreator object * @param[in] ha1 The ha1 to set - * @return LinphonePasswordOk if everything is OK, or a specific error otherwise. + * @return LinphoneAccountCreatorPasswordStatusOk if everything is OK, or a specific error otherwise. **/ -LINPHONE_PUBLIC LinphonePasswordCheck linphone_account_creator_set_ha1(LinphoneAccountCreator *creator, const char *ha1); +LINPHONE_PUBLIC LinphoneAccountCreatorPasswordStatus linphone_account_creator_set_ha1(LinphoneAccountCreator *creator, const char *ha1); /** * Get the ha1. @@ -210,9 +210,9 @@ LINPHONE_PUBLIC const char * linphone_account_creator_get_ha1(const LinphoneAcco * Set the activation code. * @param[in] creator LinphoneAccountCreator object * @param[in] activation_code The activation code to set - * @return LinphoneActivationCodeOk if everything is OK, or a specific error otherwise. + * @return LinphoneAccountCreatorActivationCodeStatusOk if everything is OK, or a specific error otherwise. **/ -LINPHONE_PUBLIC LinphoneActivationCodeCheck linphone_account_creator_set_activation_code(LinphoneAccountCreator *creator, const char *activation_code); +LINPHONE_PUBLIC LinphoneAccountCreatorActivationCodeStatus linphone_account_creator_set_activation_code(LinphoneAccountCreator *creator, const char *activation_code); /** * Get the activation code. @@ -225,9 +225,9 @@ LINPHONE_PUBLIC const char * linphone_account_creator_get_activation_code(const * Set the language to use in email or SMS if supported. * @param[in] creator LinphoneAccountCreator object * @param[in] lang The language to use - * @return LinphoneLanguageOk if everything is OK, or a specific error otherwise. + * @return LinphoneAccountCreatorLanguageStatusOk if everything is OK, or a specific error otherwise. **/ -LINPHONE_PUBLIC LinphoneLanguageCheck linphone_account_creator_set_language(LinphoneAccountCreator *creator, const char *lang); +LINPHONE_PUBLIC LinphoneAccountCreatorLanguageStatus linphone_account_creator_set_language(LinphoneAccountCreator *creator, const char *lang); /** * Get the language use in email of SMS. @@ -240,9 +240,9 @@ LINPHONE_PUBLIC const char * linphone_account_creator_get_language(const Linphon * Set the display name. * @param[in] creator LinphoneAccountCreator object * @param[in] display_name The display name to set - * @return LinphoneUsernameOk if everything is OK, or a specific error otherwise. + * @return LinphoneAccountCreatorUsernameStatusOk if everything is OK, or a specific error otherwise. **/ -LINPHONE_PUBLIC LinphoneUsernameCheck linphone_account_creator_set_display_name(LinphoneAccountCreator *creator, const char *display_name); +LINPHONE_PUBLIC LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_display_name(LinphoneAccountCreator *creator, const char *display_name); /** * Get the display name. @@ -255,9 +255,9 @@ LINPHONE_PUBLIC const char * linphone_account_creator_get_display_name(const Lin * Set the email. * @param[in] creator LinphoneAccountCreator object * @param[in] email The email to set - * @return LinphoneEmailOk if everything is OK, or a specific error otherwise. + * @return LinphoneAccountCreatorEmailStatusOk if everything is OK, or a specific error otherwise. **/ -LINPHONE_PUBLIC LinphoneEmailCheck linphone_account_creator_set_email(LinphoneAccountCreator *creator, const char *email); +LINPHONE_PUBLIC LinphoneAccountCreatorEmailStatus linphone_account_creator_set_email(LinphoneAccountCreator *creator, const char *email); /** * Get the email. @@ -270,9 +270,9 @@ LINPHONE_PUBLIC const char * linphone_account_creator_get_email(const LinphoneAc * Set the domain. * @param[in] creator LinphoneAccountCreator object * @param[in] domain The domain to set - * @return LinphoneRequestOk if everything is OK, or a specific error otherwise. + * @return LinphoneAccountCreatorStatusRequestOk if everything is OK, or a specific error otherwise. **/ -LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_set_domain(LinphoneAccountCreator *creator, const char *domain); +LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_domain(LinphoneAccountCreator *creator, const char *domain); /** * Get the domain. @@ -285,9 +285,9 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC const char * linphone_account_creator_get_do * Set the route. * @param[in] creator LinphoneAccountCreator object * @param[in] route The route to set - * @return LinphoneRequestOk if everything is OK, or a specific error otherwise. + * @return LinphoneAccountCreatorStatusRequestOk if everything is OK, or a specific error otherwise. **/ -LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_set_route(LinphoneAccountCreator *creator, const char *route); +LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_route(LinphoneAccountCreator *creator, const char *route); /** * Get the route. @@ -297,297 +297,190 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creat LINPHONE_DEPRECATED LINPHONE_PUBLIC const char * linphone_account_creator_get_route(const LinphoneAccountCreator *creator); /** - * Get the LinphoneAccountCreatorResponseCbs object associated with a LinphoneAccountCreator. + * Get the LinphoneAccountCreatorCbs object associated with a LinphoneAccountCreator. * @param[in] creator LinphoneAccountCreator object - * @return The LinphoneAccountCreatorResponseCbs object associated with the LinphoneAccountCreator. - * @donotwrap + * @return The LinphoneAccountCreatorCbs object associated with the LinphoneAccountCreator. **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseCbs * linphone_account_creator_get_responses_cbs(const LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorCbs * linphone_account_creator_get_callbacks(const LinphoneAccountCreator *creator); /** - * Get the LinphoneAccountCreatorRequestCbs object associated with a LinphoneAccountCreator. + * Get the LinphoneAccountCreatorService object associated with a LinphoneAccountCreator. * @param[in] creator LinphoneAccountCreator object - * @return The LinphoneAccountCreatorRequestCbs object associated with the LinphoneAccountCreator. + * @return The LinphoneAccountCreatorService object associated with the LinphoneAccountCreator. * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorRequestCbs * linphone_account_creator_get_requests_cbs(const LinphoneAccountCreator *creator); +LINPHONE_PUBLIC LinphoneAccountCreatorService * linphone_account_creator_get_service(const LinphoneAccountCreator *creator); /************************** End Account Creator data **************************/ -/************************** Start Account Creator Linphone **************************/ - -/** - * Account creator custom to set Linphone default values - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_constructor_custom(LinphoneAccountCreator *creator); - -/** - * Send an XML-RPC request to test the existence of a Linphone account. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_exist_custom(LinphoneAccountCreator *creator); - -/** - * Send an XML-RPC request to create a Linphone account. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_create_account_custom(LinphoneAccountCreator *creator); - -/** - * Send an XML-RPC request to activate a Linphone account. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_activate_account_custom(LinphoneAccountCreator *creator); - -/** - * Send an XML-RPC request to test the validation of a Linphone account. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_activated_custom(LinphoneAccountCreator *creator); - -/** - * Send an XML-RPC request to test the existence a phone number with a Linphone account. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_phone_number_used_custom(LinphoneAccountCreator *creator); - -/** - * Send an XML-RPC request to link a phone number with a Linphone account. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_link_phone_number_with_account_custom(LinphoneAccountCreator *creator); - -/** - * Send an XML-RPC request to activate the link of a phone number with a Linphone account. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_activate_phone_number_link_custom(LinphoneAccountCreator *creator); - -/** - * Send an XML-RPC request to a Linphone account with the phone number. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_recover_phone_account_custom(LinphoneAccountCreator *creator); - -/** - * Send an XML-RPC request to ask if an account is linked with a phone number - * @param[in] creator LinphoneAccountCreator object - * @return if this account is linked with a phone number -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_linked_custom(LinphoneAccountCreator *creator); - -/** - * Send an XML-RPC request to ask if an account is linked with a phone number - * @param[in] creator LinphoneAccountCreator object - * @param[in] new_pwd const char * : new password for the account creator - * @return LinphoneRequestOk if everything is OK, or a specific error otherwise. -**/ -LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_update_password_custom(LinphoneAccountCreator *creator); - -/************************** End Account Creator Linphone **************************/ - /************************** Start Account Creator Cbs **************************/ /** - * Acquire a reference to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. - * @return The same LinphoneAccountCreatorResponseCbs object. - * @donotwrap + * Acquire a reference to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. + * @return The same LinphoneAccountCreatorCbs object. **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseCbs * linphone_account_creator_responses_cbs_ref(LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbs * linphone_account_creator_cbs_ref(LinphoneAccountCreatorCbs *cbs); /** - * Release a reference to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. - * @donotwrap + * Release a reference to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_unref(LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC void linphone_account_creator_cbs_unref(LinphoneAccountCreatorCbs *cbs); /** - * Retrieve the user pointer associated with a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. - * @return The user pointer associated with the LinphoneAccountCreatorResponseCbs object. - * @donotwrap + * Retrieve the user pointer associated with a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. + * @return The user pointer associated with the LinphoneAccountCreatorCbs object. **/ -LINPHONE_PUBLIC void *linphone_account_creator_responses_cbs_get_user_data(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC void *linphone_account_creator_cbs_get_user_data(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. - * @param[in] ud The user pointer to associate with the LinphoneAccountCreatorResponseCbs object. - * @donotwrap + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] ud The user pointer to associate with the LinphoneAccountCreatorCbs object. **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_user_data(LinphoneAccountCreatorResponseCbs *responses_cbs, void *ud); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_user_data(LinphoneAccountCreatorCbs *cbs, void *ud); /** * Get the create account request. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @return The current create account request. - * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_create_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_create_account(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @param[in] cb The create account request to be used. - * @donotwrap **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_create_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_create_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the is account exist request. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @return The current is account exist request. - * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_account_exist_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_exist(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @param[in] cb The is account exist request to be used. - * @donotwrap **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_is_account_exist_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_exist(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the activate account request. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @return The current activate account request. - * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_activate_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_activate_account(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @param[in] cb The activate account request to be used. - * @donotwrap **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_activate_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_activate_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the is account activated request. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @return The current is account activated request. - * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_account_activated_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_activated(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @param[in] cb The is account activated request to be used. - * @donotwrap **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_is_account_activated_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_activated(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the link account request. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @return The current link account request. - * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_link_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_link_account(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @param[in] cb The link account request to be used. - * @donotwrap **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_link_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_link_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the activate alias request. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @return The current link account request. - * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_activate_alias_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_activate_alias(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @param[in] cb The activate alias request to be used. - * @donotwrap **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_activate_alias_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_activate_alias(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the is alias used request. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @return The current is alias used request. - * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_alias_used_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_alias_used(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @param[in] cb The is alias used request to be used. - * @donotwrap **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_is_alias_used_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_alias_used(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the is account linked request. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @return The current is account linked request. - * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_account_linked_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_linked(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @param[in] cb The is account linked request to be used. - * @donotwrap **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_is_account_linked_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_linked(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the recover account request. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @return The current recover account request. - * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_recover_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_recover_account(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @param[in] cb The recover account request to be used. - * @donotwrap **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_recover_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_recover_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the update account request. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @return The current update account request. - * @donotwrap **/ -LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_update_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs); +LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_update_account(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorResponseCbs object. - * @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object. + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. * @param[in] cb The update account request to be used. - * @donotwrap **/ -LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_update_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb); +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_update_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /************************** End Account Creator Cbs **************************/ diff --git a/include/linphone/account_creator_request_engine.h b/include/linphone/account_creator_request_engine.h deleted file mode 100644 index 3094887d9..000000000 --- a/include/linphone/account_creator_request_engine.h +++ /dev/null @@ -1,282 +0,0 @@ -/* -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. - * @donotwrap -**/ -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. - * @donotwrap -**/ -LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_ref(LinphoneAccountCreatorRequestCbs *requests_cbs); - -/** - * Release a reference to a LinphoneAccountCreatorRequestCbs object. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @donotwrap -**/ -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. - * @donotwrap -**/ -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. - * @donotwrap -**/ -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] cb The constructor of account creator requests. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_constructor_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the constructor of account creator requests. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current constructor of create account request. - * @donotwrap -**/ -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] cb The destructor. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_destructor_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the destructor of create account request. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current destructor of create account request. - * @donotwrap -**/ -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. - * @donotwrap -**/ -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] cb The create account request to be used. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_create_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the is account exist request. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current is account exist request. - * @donotwrap -**/ -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] cb The is account exist request to be used. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_exist_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the activate account request. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current activate account request. - * @donotwrap -**/ -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] cb The activate account request to be used. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_activate_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the is account activated request. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current is account activated request. - * @donotwrap -**/ -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] cb The is account activated request to be used. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_activated_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the link account request. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current link account request. - * @donotwrap -**/ -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] cb The link account request to be used. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_link_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the activate alias request. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current link account request. - * @donotwrap -**/ -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] cb The activate alias request to be used. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_activate_alias_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the is alias used request. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current is alias used request. - * @donotwrap -**/ -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] cb The is alias used request to be used. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_alias_used_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the is account linked request. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current is account linked request. - * @donotwrap -**/ -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] cb The is account linked request to be used. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_linked_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the recover account request. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current recover account request. - * @donotwrap -**/ -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] cb The recover account request to be used. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_recover_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/** - * Get the update account request. - * @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object. - * @return The current update account request. - * @donotwrap -**/ -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] cb The update account request to be used. - * @donotwrap -**/ -LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_update_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb); - -/************************** End Account Creator Requests **************************/ - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* LINPHONE_ACCOUNT_CREATOR_REQUEST_ENGINE_H_ */ diff --git a/include/linphone/account_creator_service.h b/include/linphone/account_creator_service.h new file mode 100644 index 000000000..a7e2bac72 --- /dev/null +++ b/include/linphone/account_creator_service.h @@ -0,0 +1,282 @@ +/* +account_creator_service.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_SERVICE_H_ +#define LINPHONE_ACCOUNT_CREATOR_SERVICE_H_ + +#include "linphone/types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Function to set custom server request. + * @param[in] creator LinphoneAccountCreator object + */ +typedef LinphoneAccountCreatorStatus (*LinphoneAccountCreatorRequestFunc)(LinphoneAccountCreator *creator); + +/** + * @addtogroup account_creator_request + * @{ + */ + +/************************** Start Account Creator Requests **************************/ + +/** + * Create a new LinphoneAccountCreatorService object. + * @return a new LinphoneAccountCreatorService object. + * @donotwrap +**/ +LinphoneAccountCreatorService * linphone_account_creator_service_new(void); + +/** + * Acquire a reference to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @return The same LinphoneAccountCreatorService object. + * @donotwrap +**/ +LinphoneAccountCreatorService * linphone_account_creator_service_ref(LinphoneAccountCreatorService *service); + +/** + * Release a reference to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @donotwrap +**/ +void linphone_account_creator_service_unref(LinphoneAccountCreatorService *service); + +/** + * Retrieve the user pointer associated with a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @return The user pointer associated with the LinphoneAccountCreatorService object. + * @donotwrap +**/ +LINPHONE_PUBLIC void *linphone_account_creator_service_get_user_data(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] ud The user pointer to associate with the LinphoneAccountCreatorService object. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_user_data(LinphoneAccountCreatorService *service, void *ud); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The constructor of account creator requests. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_constructor_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the constructor of account creator requests. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current constructor of create account request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_constructor_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The destructor. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_destructor_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the destructor of create account request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current destructor of create account request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_destructor_cb(const LinphoneAccountCreatorService *service); + +/** + * Get the create account request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current create account request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_create_account_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The create account request to be used. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_create_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the is account exist request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current is account exist request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_exist_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The is account exist request to be used. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_is_account_exist_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the activate account request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current activate account request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_activate_account_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The activate account request to be used. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_activate_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the is account activated request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current is account activated request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_activated_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The is account activated request to be used. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_is_account_activated_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the link account request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current link account request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_link_account_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The link account request to be used. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_link_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the activate alias request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current link account request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_activate_alias_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The activate alias request to be used. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_activate_alias_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the is alias used request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current is alias used request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_alias_used_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The is alias used request to be used. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_is_alias_used_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the is account linked request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current is account linked request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_linked_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The is account linked request to be used. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_is_account_linked_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the recover account request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current recover account request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_recover_account_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The recover account request to be used. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_recover_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/** + * Get the update account request. + * @param[in] service LinphoneAccountCreatorService object. + * @return The current update account request. + * @donotwrap +**/ +LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_update_account_cb(const LinphoneAccountCreatorService *service); + +/** + * Assign a user pointer to a LinphoneAccountCreatorService object. + * @param[in] service LinphoneAccountCreatorService object. + * @param[in] cb The update account request to be used. + * @donotwrap +**/ +LINPHONE_PUBLIC void linphone_account_creator_service_set_update_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb); + +/************************** End Account Creator Requests **************************/ + +#ifdef __cplusplus +} +#endif + +/** + * @} + */ + +#endif /* LINPHONE_ACCOUNT_CREATOR_SERVICE_H_ */ diff --git a/include/linphone/core.h b/include/linphone/core.h index a4d39ec7e..b4aca8002 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -33,7 +33,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/account_creator_service.h" #include "linphone/address.h" #include "linphone/auth_info.h" #include "linphone/buffer.h" @@ -1909,18 +1909,18 @@ 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 + * Sets an default account creator service in the core * @param lc LinphoneCore object - * @param cbs LinphoneAccountCreatorRequestCbs object + * @param cbs LinphoneAccountCreatorService object **/ -LINPHONE_PUBLIC void linphone_core_set_account_creator_request_engine_cbs(LinphoneCore *lc, LinphoneAccountCreatorRequestCbs *cbs); +LINPHONE_PUBLIC void linphone_core_set_account_creator_service(LinphoneCore *lc, LinphoneAccountCreatorService *service); /** - * Get default account creator request cbs from the core + * Get default account creator service from the core * @param lc LinphoneCore object - * @return LinphoneAccountCreatorRequestCbs object + * @return LinphoneAccountCreatorService object **/ -LINPHONE_PUBLIC LinphoneAccountCreatorRequestCbs* linphone_core_get_account_creator_request_engine_cbs(LinphoneCore *lc); +LINPHONE_PUBLIC LinphoneAccountCreatorService * linphone_core_get_account_creator_service(LinphoneCore *lc); /** * Enable or disable the audio adaptive jitter compensation. diff --git a/include/linphone/types.h b/include/linphone/types.h index bb9e25ae3..0f7969d60 100644 --- a/include/linphone/types.h +++ b/include/linphone/types.h @@ -34,121 +34,122 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. typedef struct _LinphoneAccountCreator LinphoneAccountCreator; /** - * An object to handle the requests callbacks for handling the LinphoneAccountCreator server requests. + * An object to define a LinphoneAccountCreator service. * @ingroup account_creator + * @donotwrap **/ -typedef struct _LinphoneAccountCreatorRequestCbs LinphoneAccountCreatorRequestCbs; +typedef struct _LinphoneAccountCreatorService LinphoneAccountCreatorService; /** * An object to handle the responses callbacks for handling the LinphoneAccountCreator operations. * @ingroup account_creator **/ -typedef struct _LinphoneAccountCreatorResponseCbs LinphoneAccountCreatorResponseCbs; +typedef struct _LinphoneAccountCreatorCbs LinphoneAccountCreatorCbs; /** * Enum describing Phone number checking. - * @ingroup account_creator_checking + * @ingroup account_creator **/ -typedef enum _LinphonePhoneNumberCheck { - LinphonePhoneNumberOk = 0x1, /**< Phone number ok */ - LinphonePhoneNumberTooShort = 0x2, /**< Phone number too short */ - LinphonePhoneNumberTooLong = 0x4, /**< Phone number too long */ - LinphonePhoneNumberCountryCodeInvalid = 0x8, /**< Country code invalid */ - LinphonePhoneNumberInvalid = 0x10, /**< Phone number invalid */ -} LinphonePhoneNumberCheck; +typedef enum _LinphoneAccountCreatorPhoneNumberStatus { + LinphoneAccountCreatorPhoneNumberStatusOk = 0x1, /**< Phone number ok */ + LinphoneAccountCreatorPhoneNumberStatusTooShort = 0x2, /**< Phone number too short */ + LinphoneAccountCreatorPhoneNumberStatusTooLong = 0x4, /**< Phone number too long */ + LinphoneAccountCreatorPhoneNumberStatusInvalidCountryCode = 0x8, /**< Country code invalid */ + LinphoneAccountCreatorPhoneNumberStatusInvalid = 0x10 /**< Phone number invalid */ +} LinphoneAccountCreatorPhoneNumberStatus; /** - * A mask of #LinphonePhoneNumberCheck values - * @ingroup account_creator_checking + * A mask of #LinphoneAccountCreatorPhoneNumberStatus values + * @ingroup account_creator */ -typedef unsigned int LinphonePhoneNumberMask; +typedef unsigned int LinphoneAccountCreatorPhoneNumberStatusMask; /** * Enum describing Username checking. - * @ingroup account_creator_checking + * @ingroup account_creator **/ -typedef enum _LinphoneUsernameCheck { - LinphoneUsernameOk, /**< Username ok */ - LinphoneUsernameTooShort, /**< Username too short */ - LinphoneUsernameTooLong, /**< Username too long */ - LinphoneUsernameInvalidCharacters, /**< Contain invalid characters */ - LinphoneUsernameInvalid, /**< Invalid username */ -} LinphoneUsernameCheck; +typedef enum _LinphoneAccountCreatorUsernameStatus { + LinphoneAccountCreatorUsernameStatusOk, /**< Username ok */ + LinphoneAccountCreatorUsernameStatusTooShort, /**< Username too short */ + LinphoneAccountCreatorUsernameStatusTooLong, /**< Username too long */ + LinphoneAccountCreatorUsernameStatusInvalidCharacters, /**< Contain invalid characters */ + LinphoneAccountCreatorUsernameStatusInvalid /**< Invalid username */ +} LinphoneAccountCreatorUsernameStatus; /** * Enum describing Email checking. - * @ingroup account_creator_checking + * @ingroup account_creator **/ -typedef enum _LinphoneEmailCheck { - LinphoneEmailOk, /**< Email ok */ - LinphoneEmailMalformed, /**< Email malformed */ - LinphoneEmailInvalidCharacters, /**< Contain invalid characters */ -} LinphoneEmailCheck; +typedef enum _LinphoneAccountCreatorEmailStatus { + LinphoneAccountCreatorEmailStatusOk, /**< Email ok */ + LinphoneAccountCreatorEmailStatusMalformed, /**< Email malformed */ + LinphoneAccountCreatorEmailStatusInvalidCharacters /**< Contain invalid characters */ +} LinphoneAccountCreatorEmailStatus; /** * Enum describing Password checking. - * @ingroup account_creator_checking + * @ingroup account_creator **/ -typedef enum _LinphonePasswordCheck { - LinphonePasswordOk, /**< Password ok */ - LinphonePasswordTooShort, /**< Password too short */ - LinphonePasswordTooLong, /**< Password too long */ - LinphonePasswordInvalidCharacters, /**< Contain invalid characters */ - LinphonePasswordMissingCharacters, /**< Missing specific characters */ -} LinphonePasswordCheck; +typedef enum _LinphoneAccountCreatorPasswordStatus { + LinphoneAccountCreatorPasswordStatusOk, /**< Password ok */ + LinphoneAccountCreatorPasswordStatusTooShort, /**< Password too short */ + LinphoneAccountCreatorPasswordStatusTooLong, /**< Password too long */ + LinphoneAccountCreatorPasswordStatusInvalidCharacters, /**< Contain invalid characters */ + LinphoneAccountCreatorPasswordStatusMissingCharacters /**< Missing specific characters */ +} LinphoneAccountCreatorPasswordStatus; /** * Enum describing language checking. - * @ingroup account_creator_checking + * @ingroup account_creator **/ -typedef enum _LinphoneLanguageCheck { - LinphoneLanguageOk, /**< Language ok */ -} LinphoneLanguageCheck; +typedef enum _LinphoneAccountCreatorLanguageStatus { + LinphoneAccountCreatorLanguageStatusOk /**< Language ok */ +} LinphoneAccountCreatorLanguageStatus; /** * Enum describing Activation code checking. - * @ingroup account_creator_checking + * @ingroup account_creator **/ -typedef enum _LinphoneActivationCodeCheck { - LinphoneActivationCodeOk, /**< Activation code ok */ - LinphoneActivationCodeTooShort, /**< Activation code too short */ - LinphoneActivationCodeTooLong, /**< Activation code too long */ - LinphoneActivationCodeInvalidCharacters, /**< Contain invalid characters */ -} LinphoneActivationCodeCheck; +typedef enum _LinphoneAccountCreatorActivationCodeStatus { + LinphoneAccountCreatorActivationCodeStatusOk, /**< Activation code ok */ + LinphoneAccountCreatorActivationCodeStatusTooShort, /**< Activation code too short */ + LinphoneAccountCreatorActivationCodeStatusTooLong, /**< Activation code too long */ + LinphoneAccountCreatorActivationCodeStatusInvalidCharacters /**< Contain invalid characters */ +} LinphoneAccountCreatorActivationCodeStatus; /** * Enum describing the status of server request. * @ingroup account_creator_request **/ -typedef enum _LinphoneRequestStatus { +typedef enum _LinphoneAccountCreatorStatus { /** Request status **/ - LinphoneRequestOk, /**< Request passed */ - LinphoneRequestFailed, /**< Request failed */ - LinphoneRequestMissingArguments, /**< Request failed due to missing argument(s) */ - LinphoneRequestMissingCallbacks, /**< Request failed due to missing callback(s) */ + LinphoneAccountCreatorStatusRequestOk, /**< Request passed */ + LinphoneAccountCreatorStatusRequestFailed, /**< Request failed */ + LinphoneAccountCreatorStatusMissingArguments, /**< Request failed due to missing argument(s) */ + LinphoneAccountCreatorStatusMissingCallbacks, /**< Request failed due to missing callback(s) */ /** Account status **/ /* Creation */ - LinphoneRequestAccountCreated, /**< Account created */ - LinphoneRequestAccountNotCreated, /**< Account not created */ + LinphoneAccountCreatorStatusAccountCreated, /**< Account created */ + LinphoneAccountCreatorStatusAccountNotCreated, /**< Account not created */ /* Existence */ - LinphoneRequestAccountExist, /**< Account exist */ - LinphoneRequestAccountExistWithAlias, /**< Account exist with alias */ - LinphoneRequestAccountNotExist, /**< Account not exist */ - LinphoneRequestAliasIsAccount, /**< Account was created with Alias */ - LinphoneRequestAliasExist, /**< Alias exist */ - LinphoneRequestAliasNotExist, /**< Alias not exist */ + LinphoneAccountCreatorStatusAccountExist, /**< Account exist */ + LinphoneAccountCreatorStatusAccountExistWithAlias, /**< Account exist with alias */ + LinphoneAccountCreatorStatusAccountNotExist, /**< Account not exist */ + LinphoneAccountCreatorStatusAliasIsAccount, /**< Account was created with Alias */ + LinphoneAccountCreatorStatusAliasExist, /**< Alias exist */ + LinphoneAccountCreatorStatusAliasNotExist, /**< Alias not exist */ /* Activation */ - LinphoneRequestAccountActivated, /**< Account activated */ - LinphoneRequestAccountAlreadyActivated, /**< Account already activated */ - LinphoneRequestAccountNotActivated, /**< Account not activated */ + LinphoneAccountCreatorStatusAccountActivated, /**< Account activated */ + LinphoneAccountCreatorStatusAccountAlreadyActivated, /**< Account already activated */ + LinphoneAccountCreatorStatusAccountNotActivated, /**< Account not activated */ /* Linking */ - LinphoneRequestAccountLinked, /**< Account linked */ - LinphoneRequestAccountNotLinked, /**< Account not linked */ + LinphoneAccountCreatorStatusAccountLinked, /**< Account linked */ + LinphoneAccountCreatorStatusAccountNotLinked, /**< Account not linked */ /** Server **/ - LinphoneRequestErrorServer, /**< Error server */ -} LinphoneRequestStatus; + LinphoneAccountCreatorStatusServerError /**< Error server */ +} LinphoneAccountCreatorStatus; struct SalAddress; diff --git a/tester/account_creator_tester.c b/tester/account_creator_tester.c index 233258abc..108b10521 100644 --- a/tester/account_creator_tester.c +++ b/tester/account_creator_tester.c @@ -25,25 +25,25 @@ static const int TIMEOUT_REQUEST = 10000; /////////// INIT ////////////// -static void init_account_creator_request_cbs(LinphoneCore *lc) { - LinphoneAccountCreatorRequestCbs *cbs = linphone_account_creator_requests_cbs_new(); - linphone_account_creator_requests_cbs_set_constructor_cb(cbs, NULL); - linphone_account_creator_requests_cbs_set_destructor_cb(cbs, NULL); - linphone_account_creator_requests_cbs_set_create_account_cb(cbs, linphone_account_creator_create_account_custom); - linphone_account_creator_requests_cbs_set_is_account_exist_cb(cbs, linphone_account_creator_is_account_exist_custom); - linphone_account_creator_requests_cbs_set_activate_account_cb(cbs, linphone_account_creator_activate_account_custom); - linphone_account_creator_requests_cbs_set_is_account_activated_cb(cbs, linphone_account_creator_is_account_activated_custom); - linphone_account_creator_requests_cbs_set_link_account_cb(cbs, linphone_account_creator_link_phone_number_with_account_custom); - linphone_account_creator_requests_cbs_set_activate_alias_cb(cbs, linphone_account_creator_activate_phone_number_link_custom); - linphone_account_creator_requests_cbs_set_is_alias_used_cb(cbs, linphone_account_creator_is_phone_number_used_custom); - linphone_account_creator_requests_cbs_set_is_account_linked_cb(cbs, linphone_account_creator_is_account_linked_custom); - linphone_account_creator_requests_cbs_set_recover_account_cb(cbs, linphone_account_creator_recover_phone_account_custom); - linphone_account_creator_requests_cbs_set_update_account_cb(cbs, linphone_account_creator_update_password_custom); - linphone_core_set_account_creator_request_engine_cbs(lc, cbs); +static void init_linphone_account_creator_service(LinphoneCore *lc) { + LinphoneAccountCreatorService *service = linphone_account_creator_service_new(); + linphone_account_creator_service_set_constructor_cb(service, NULL); + linphone_account_creator_service_set_destructor_cb(service, NULL); + linphone_account_creator_service_set_create_account_cb(service, linphone_account_creator_create_account_linphone); + linphone_account_creator_service_set_is_account_exist_cb(service, linphone_account_creator_is_account_exist_linphone); + linphone_account_creator_service_set_activate_account_cb(service, linphone_account_creator_activate_account_linphone); + linphone_account_creator_service_set_is_account_activated_cb(service, linphone_account_creator_is_account_activated_linphone); + linphone_account_creator_service_set_link_account_cb(service, linphone_account_creator_link_phone_number_with_account_linphone); + linphone_account_creator_service_set_activate_alias_cb(service, linphone_account_creator_activate_phone_number_link_linphone); + linphone_account_creator_service_set_is_alias_used_cb(service, linphone_account_creator_is_phone_number_used_linphone); + linphone_account_creator_service_set_is_account_linked_cb(service, linphone_account_creator_is_account_linked_linphone); + linphone_account_creator_service_set_recover_account_cb(service, linphone_account_creator_recover_phone_account_linphone); + linphone_account_creator_service_set_update_account_cb(service, linphone_account_creator_update_password_linphone); + linphone_core_set_account_creator_service(lc, service); } static LinphoneAccountCreator * _linphone_account_creator_new(LinphoneCore *lc, const char * url) { - init_account_creator_request_cbs(lc); + init_linphone_account_creator_service(lc); LinphoneAccountCreator *creator = linphone_account_creator_new(lc, url); return creator; } @@ -57,8 +57,8 @@ static void local_username_too_short(void) { BC_ASSERT_EQUAL( linphone_account_creator_set_username(creator, ""), - LinphoneUsernameTooShort, - LinphoneUsernameCheck, + LinphoneAccountCreatorUsernameStatusTooShort, + LinphoneAccountCreatorUsernameStatus, "%i"); linphone_account_creator_unref(creator); @@ -71,8 +71,8 @@ static void local_username_too_long(void) { BC_ASSERT_EQUAL( linphone_account_creator_set_username(creator, "usernametoolongforyou"), - LinphoneUsernameTooLong, - LinphoneUsernameCheck, + LinphoneAccountCreatorUsernameStatusTooLong, + LinphoneAccountCreatorUsernameStatus, "%i"); linphone_account_creator_unref(creator); @@ -85,8 +85,8 @@ static void local_username_invalid_character(void) { BC_ASSERT_EQUAL( linphone_account_creator_set_username(creator, "use!"), - LinphoneUsernameInvalidCharacters, - LinphoneUsernameCheck, + LinphoneAccountCreatorUsernameStatusInvalidCharacters, + LinphoneAccountCreatorUsernameStatus, "%i"); linphone_account_creator_unref(creator); @@ -99,8 +99,8 @@ static void local_username_ok(void) { BC_ASSERT_EQUAL( linphone_account_creator_set_username(creator, "XXXTESTuser_1"), - LinphoneUsernameOk, - LinphoneUsernameCheck, + LinphoneAccountCreatorUsernameStatusOk, + LinphoneAccountCreatorUsernameStatus, "%i"); linphone_account_creator_unref(creator); @@ -115,8 +115,8 @@ static void local_password_too_short(void) { BC_ASSERT_EQUAL( linphone_account_creator_set_password(creator, ""), - LinphonePasswordTooShort, - LinphonePasswordCheck, + LinphoneAccountCreatorPasswordStatusTooShort, + LinphoneAccountCreatorPasswordStatus, "%i"); linphone_account_creator_unref(creator); @@ -129,8 +129,8 @@ static void local_password_too_long(void) { BC_ASSERT_EQUAL( linphone_account_creator_set_password(creator, "passwordtoolong"), - LinphonePasswordTooLong, - LinphonePasswordCheck, + LinphoneAccountCreatorPasswordStatusTooLong, + LinphoneAccountCreatorPasswordStatus, "%i"); linphone_account_creator_unref(creator); @@ -143,8 +143,8 @@ static void local_password_ok(void) { BC_ASSERT_EQUAL( linphone_account_creator_set_password(creator, "pass"), - LinphonePasswordOk, - LinphonePasswordCheck, + LinphoneAccountCreatorPasswordStatusOk, + LinphoneAccountCreatorPasswordStatus, "%i"); linphone_account_creator_unref(creator); @@ -159,32 +159,32 @@ static void local_email_malformed(void) { BC_ASSERT_EQUAL( linphone_account_creator_set_email(creator, "test.linphone.org"), - LinphoneEmailMalformed, - LinphoneEmailCheck, + LinphoneAccountCreatorEmailStatusMalformed, + LinphoneAccountCreatorEmailStatus, "%i"); BC_ASSERT_EQUAL( linphone_account_creator_set_email(creator, "test@linphone"), - LinphoneEmailMalformed, - LinphoneEmailCheck, + LinphoneAccountCreatorEmailStatusMalformed, + LinphoneAccountCreatorEmailStatus, "%i"); BC_ASSERT_EQUAL( linphone_account_creator_set_email(creator, "@linphone.org"), - LinphoneEmailMalformed, - LinphoneEmailCheck, + LinphoneAccountCreatorEmailStatusMalformed, + LinphoneAccountCreatorEmailStatus, "%i"); BC_ASSERT_EQUAL( linphone_account_creator_set_email(creator, "linphone@.org"), - LinphoneEmailMalformed, - LinphoneEmailCheck, + LinphoneAccountCreatorEmailStatusMalformed, + LinphoneAccountCreatorEmailStatus, "%i"); BC_ASSERT_EQUAL( linphone_account_creator_set_email(creator, ".linphone@.org"), - LinphoneEmailMalformed, - LinphoneEmailCheck, + LinphoneAccountCreatorEmailStatusMalformed, + LinphoneAccountCreatorEmailStatus, "%i"); linphone_account_creator_unref(creator); @@ -197,8 +197,8 @@ static void local_email_invalid_character(void) { BC_ASSERT_EQUAL( linphone_account_creator_set_email(creator, "test@linphone.org$"), - LinphoneEmailInvalidCharacters, - LinphoneEmailCheck, + LinphoneAccountCreatorEmailStatusInvalidCharacters, + LinphoneAccountCreatorEmailStatus, "%i"); linphone_account_creator_unref(creator); @@ -211,20 +211,20 @@ static void local_email_ok(void) { BC_ASSERT_EQUAL( linphone_account_creator_set_email(creator, "test@linphone.org"), - LinphoneEmailOk, - LinphoneEmailCheck, + LinphoneAccountCreatorEmailStatusOk, + LinphoneAccountCreatorEmailStatus, "%i"); BC_ASSERT_EQUAL( linphone_account_creator_set_email(creator, "test02@linphone5252.org"), - LinphoneEmailOk, - LinphoneEmailCheck, + LinphoneAccountCreatorEmailStatusOk, + LinphoneAccountCreatorEmailStatus, "%i"); BC_ASSERT_EQUAL( linphone_account_creator_set_email(creator, "9053test@50255linphone.org"), - LinphoneEmailOk, - LinphoneEmailCheck, + LinphoneAccountCreatorEmailStatusOk, + LinphoneAccountCreatorEmailStatus, "%i"); linphone_account_creator_unref(creator); @@ -238,9 +238,9 @@ static void local_phone_number_too_short(void) { LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, ""); BC_ASSERT_EQUAL( - linphone_account_creator_set_phone_number(creator, "0123", "33")&LinphonePhoneNumberTooShort, - LinphonePhoneNumberTooShort, - LinphonePhoneNumberCheck, + linphone_account_creator_set_phone_number(creator, "0123", "33")&LinphoneAccountCreatorPhoneNumberStatusTooShort, + LinphoneAccountCreatorPhoneNumberStatusTooShort, + LinphoneAccountCreatorPhoneNumberStatus, "%i"); linphone_account_creator_unref(creator); @@ -252,9 +252,9 @@ static void local_phone_number_too_long(void) { LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, ""); BC_ASSERT_EQUAL( - linphone_account_creator_set_phone_number(creator, "01234567891011", "33")&LinphonePhoneNumberTooLong, - LinphonePhoneNumberTooLong, - LinphonePhoneNumberCheck, + linphone_account_creator_set_phone_number(creator, "01234567891011", "33")&LinphoneAccountCreatorPhoneNumberStatusTooLong, + LinphoneAccountCreatorPhoneNumberStatusTooLong, + LinphoneAccountCreatorPhoneNumberStatus, "%i"); linphone_account_creator_unref(creator); @@ -266,9 +266,9 @@ static void local_phone_number_invalid(void) { LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, ""); BC_ASSERT_EQUAL( - linphone_account_creator_set_phone_number(creator, NULL, "33")&LinphonePhoneNumberInvalid, - LinphonePhoneNumberInvalid, - LinphonePhoneNumberCheck, + linphone_account_creator_set_phone_number(creator, NULL, "33")&LinphoneAccountCreatorPhoneNumberStatusInvalid, + LinphoneAccountCreatorPhoneNumberStatusInvalid, + LinphoneAccountCreatorPhoneNumberStatus, "%i"); linphone_account_creator_unref(creator); @@ -280,9 +280,9 @@ static void local_country_code_invalid(void) { LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, ""); BC_ASSERT_EQUAL( - linphone_account_creator_set_phone_number(creator, "0123", "")&LinphonePhoneNumberCountryCodeInvalid, - LinphonePhoneNumberCountryCodeInvalid, - LinphonePhoneNumberCheck, + linphone_account_creator_set_phone_number(creator, "0123", "")&LinphoneAccountCreatorPhoneNumberStatusInvalidCountryCode, + LinphoneAccountCreatorPhoneNumberStatusInvalidCountryCode, + LinphoneAccountCreatorPhoneNumberStatus, "%i"); linphone_account_creator_unref(creator); @@ -294,9 +294,9 @@ static void local_phone_number_ok(void) { LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, ""); BC_ASSERT_EQUAL( - linphone_account_creator_set_phone_number(creator, "000555455", "1")&LinphonePhoneNumberOk, - LinphonePhoneNumberOk, - LinphonePhoneNumberCheck, + linphone_account_creator_set_phone_number(creator, "000555455", "1")&LinphoneAccountCreatorPhoneNumberStatusOk, + LinphoneAccountCreatorPhoneNumberStatusOk, + LinphoneAccountCreatorPhoneNumberStatus, "%i"); linphone_account_creator_unref(creator); @@ -314,49 +314,49 @@ static LinphoneAccountCreatorStats* new_linphone_account_creator_stats(void) { return stats; } -static void account_creator_set_cb_done(LinphoneAccountCreatorResponseCbs *cbs) { - LinphoneAccountCreatorStats *stats = (LinphoneAccountCreatorStats*) linphone_account_creator_responses_cbs_get_user_data(cbs); +static void account_creator_set_cb_done(LinphoneAccountCreatorCbs *cbs) { + LinphoneAccountCreatorStats *stats = (LinphoneAccountCreatorStats*) linphone_account_creator_cbs_get_user_data(cbs); stats->cb_done++; BC_ASSERT_TRUE(stats->cb_done); } -static void account_creator_reset_cb_done(LinphoneAccountCreatorResponseCbs *cbs) { - LinphoneAccountCreatorStats *stats = (LinphoneAccountCreatorStats*) linphone_account_creator_responses_cbs_get_user_data(cbs); +static void account_creator_reset_cb_done(LinphoneAccountCreatorCbs *cbs) { + LinphoneAccountCreatorStats *stats = (LinphoneAccountCreatorStats*) linphone_account_creator_cbs_get_user_data(cbs); stats->cb_done = 0; BC_ASSERT_FALSE(stats->cb_done); } -static void account_creator_cb(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char* resp) { - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); - LinphoneRequestStatus expected_status = (LinphoneRequestStatus)linphone_account_creator_requests_cbs_get_user_data( - linphone_account_creator_get_requests_cbs(creator)); +static void account_creator_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp) { + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); + LinphoneAccountCreatorStatus expected_status = (LinphoneAccountCreatorStatus)linphone_account_creator_service_get_user_data( + linphone_account_creator_get_service(creator)); BC_ASSERT_EQUAL( status, expected_status, - LinphoneRequestStatus, + LinphoneAccountCreatorStatus, "%i"); account_creator_set_cb_done(cbs); } static void _get_activation_code_cb(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - LinphoneRequestStatus status = LinphoneRequestFailed; + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { if (strstr(resp, "ERROR_") == resp) { - status = LinphoneRequestFailed; + status = LinphoneAccountCreatorStatusRequestFailed; } else { - status = LinphoneRequestOk; + status = LinphoneAccountCreatorStatusRequestOk; set_string(&creator->activation_code, resp, FALSE); } } account_creator_cb(creator, status, resp); } -LinphoneRequestStatus get_activation_code_account_cb(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus get_activation_code_account_cb(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; if ((!creator->username && !creator->phone_number) || !creator->password) { - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "get_confirmation_key", @@ -370,31 +370,31 @@ LinphoneRequestStatus get_activation_code_account_cb(LinphoneAccountCreator *cre linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } static void _delete_account_cb(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - LinphoneRequestStatus status = LinphoneRequestFailed; + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { // We want to delete account from table but it's not an error if it doesn't exist or password doesn't match if (strstr(resp, "ERROR_ACCOUNT_DOESNT_EXIST") == resp || strstr(resp, "ERROR_PASSWORD_DOESNT_MATCH") == resp) { - status = LinphoneRequestOk; + status = LinphoneAccountCreatorStatusRequestOk; } else if (strstr(resp, "ERROR_") == resp) { - status = LinphoneRequestFailed; + status = LinphoneAccountCreatorStatusRequestFailed; } else { - status = LinphoneRequestOk; + status = LinphoneAccountCreatorStatusRequestOk; } } account_creator_cb(creator, status, resp); } -LinphoneRequestStatus delete_account_cb(LinphoneAccountCreator *creator) { +LinphoneAccountCreatorStatus delete_account_cb(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; if ((!creator->username && !creator->phone_number) || !creator->password) { - return LinphoneRequestMissingArguments; + return LinphoneAccountCreatorStatusMissingArguments; } request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "delete_account", @@ -408,18 +408,18 @@ LinphoneRequestStatus delete_account_cb(LinphoneAccountCreator *creator) { linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); - return LinphoneRequestOk; + return LinphoneAccountCreatorStatusRequestOk; } static void get_activation_code(LinphoneAccountCreator *creator, int *cb_done) { - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestOk); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusRequestOk); BC_ASSERT_EQUAL( get_activation_code_account_cb(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(creator->core, NULL, cb_done, 1, TIMEOUT_REQUEST); @@ -428,21 +428,21 @@ static void get_activation_code(LinphoneAccountCreator *creator, int *cb_done) { static void server_delete_account_test(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestOk); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusRequestOk); linphone_account_creator_set_email(creator, "user_2@linphone.org"); linphone_account_creator_set_password(creator, "password"); linphone_account_creator_set_phone_number(creator, "000555455","1"); BC_ASSERT_EQUAL( delete_account_cb(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -451,21 +451,21 @@ static void server_delete_account_test(void) { // First attempt with the first password creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - cbs = linphone_account_creator_get_responses_cbs(creator); + cbs = linphone_account_creator_get_callbacks(creator); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); + linphone_account_creator_cbs_set_user_data(cbs, stats); account_creator_reset_cb_done(cbs); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestOk); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusRequestOk); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); linphone_account_creator_set_password(creator, "password"); BC_ASSERT_EQUAL( delete_account_cb(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -474,21 +474,21 @@ static void server_delete_account_test(void) { // Second attempt with the second password creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - cbs = linphone_account_creator_get_responses_cbs(creator); + cbs = linphone_account_creator_get_callbacks(creator); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); + linphone_account_creator_cbs_set_user_data(cbs, stats); account_creator_reset_cb_done(cbs); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestOk); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusRequestOk); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); linphone_account_creator_set_password(creator, "newpassword"); BC_ASSERT_EQUAL( delete_account_cb(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -502,20 +502,20 @@ static void server_delete_account_test(void) { static void server_account_doesnt_exist(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountNotExist); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountNotExist); linphone_account_creator_set_username(creator, "user_not_exist"); - linphone_account_creator_responses_cbs_set_is_account_exist_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_is_account_exist(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_account_exist(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -528,20 +528,20 @@ static void server_account_doesnt_exist(void) { static void server_account_exist(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountExist); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountExist); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); - linphone_account_creator_responses_cbs_set_is_account_exist_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_is_account_exist(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_account_exist(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -559,8 +559,8 @@ static void server_is_account_exist_cb_missing(void) { BC_ASSERT_EQUAL( linphone_account_creator_is_account_exist(creator), - LinphoneRequestMissingCallbacks, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingCallbacks, + LinphoneAccountCreatorStatus, "%i"); linphone_account_creator_unref(creator); @@ -570,19 +570,19 @@ static void server_is_account_exist_cb_missing(void) { static void server_is_account_exist_arg_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_is_account_exist_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_is_account_exist(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_account_exist(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -595,22 +595,22 @@ static void server_is_account_exist_arg_missing(void) { static void server_account_created_with_email(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountCreated); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountCreated); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -623,22 +623,22 @@ static void server_account_created_with_email(void) { static void server_create_account_already_create_with_email(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountExist); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountExist); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -651,22 +651,22 @@ static void server_create_account_already_create_with_email(void) { static void server_account_created_with_phone_number(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountCreated); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountCreated); linphone_account_creator_set_email(creator, "user_2@linphone.org"); linphone_account_creator_set_password(creator, "password"); linphone_account_creator_set_phone_number(creator, "000555455","1"); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -679,22 +679,22 @@ static void server_account_created_with_phone_number(void) { static void server_create_account_already_create_as_account_with_phone_number(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountExist); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountExist); linphone_account_creator_set_email(creator, "user_2@linphone.org"); linphone_account_creator_set_password(creator, "password"); linphone_account_creator_set_phone_number(creator, "000555455","1"); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -707,23 +707,23 @@ static void server_create_account_already_create_as_account_with_phone_number(vo static void server_create_account_already_create_as_alias_with_phone_number(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountExistWithAlias); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountExistWithAlias); linphone_account_creator_set_username(creator, "XXXTESTuser_3"); linphone_account_creator_set_email(creator, "user_2@linphone.org"); linphone_account_creator_set_password(creator, "password"); linphone_account_creator_set_phone_number(creator, "000555456","1"); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -743,8 +743,8 @@ static void server_create_account_cb_missing(void) { BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestMissingCallbacks, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingCallbacks, + LinphoneAccountCreatorStatus, "%i"); linphone_account_creator_unref(creator); @@ -754,22 +754,22 @@ static void server_create_account_cb_missing(void) { static void server_create_account_with_email_arg_username_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_email(creator, "user_1@linphone.org"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -780,22 +780,22 @@ static void server_create_account_with_email_arg_username_missing(void) { static void server_create_account_with_email_arg_email_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -806,22 +806,22 @@ static void server_create_account_with_email_arg_email_missing(void) { static void server_create_account_with_email_arg_password_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -832,22 +832,22 @@ static void server_create_account_with_email_arg_password_missing(void) { static void server_create_account_with_phone_number_arg_username_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_phone_number(creator, "0123456", "33"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -858,22 +858,22 @@ static void server_create_account_with_phone_number_arg_username_missing(void) { static void server_create_account_with_phone_number_arg_phone_number_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_create_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -886,21 +886,21 @@ static void server_create_account_with_phone_number_arg_phone_number_missing(voi static void server_account_not_activated(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountNotActivated); - linphone_account_creator_responses_cbs_set_is_account_activated_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountNotActivated); + linphone_account_creator_cbs_set_is_account_activated(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_account_activated(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -913,21 +913,21 @@ static void server_account_not_activated(void) { static void server_account_already_activated(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountActivated); - linphone_account_creator_responses_cbs_set_is_account_activated_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountActivated); + linphone_account_creator_cbs_set_is_account_activated(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_account_activated(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -945,8 +945,8 @@ static void server_is_account_activated_cb_missing(void) { BC_ASSERT_EQUAL( linphone_account_creator_is_account_activated(creator), - LinphoneRequestMissingCallbacks, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingCallbacks, + LinphoneAccountCreatorStatus, "%i"); linphone_account_creator_unref(creator); @@ -956,19 +956,19 @@ static void server_is_account_activated_cb_missing(void) { static void server_is_account_activated_arg_username_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_is_account_activated_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_is_account_activated(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_account_activated(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -981,25 +981,25 @@ static void server_is_account_activated_arg_username_missing(void) { static void server_activate_account_not_activated(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); + linphone_account_creator_cbs_set_user_data(cbs, stats); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); linphone_account_creator_set_password(creator, "password"); get_activation_code(creator, &stats->cb_done); - account_creator_reset_cb_done(creator->responses_cbs); + account_creator_reset_cb_done(creator->cbs); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountActivated); - linphone_account_creator_responses_cbs_set_activate_account_cb(cbs, account_creator_cb); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountActivated); + linphone_account_creator_cbs_set_activate_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1012,25 +1012,25 @@ static void server_activate_account_not_activated(void) { static void server_activate_account_already_activated(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); + linphone_account_creator_cbs_set_user_data(cbs, stats); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); linphone_account_creator_set_password(creator, "password"); get_activation_code(creator, &stats->cb_done); - account_creator_reset_cb_done(creator->responses_cbs); + account_creator_reset_cb_done(creator->cbs); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountAlreadyActivated); - linphone_account_creator_responses_cbs_set_activate_account_cb(cbs, account_creator_cb); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountAlreadyActivated); + linphone_account_creator_cbs_set_activate_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1043,23 +1043,23 @@ static void server_activate_account_already_activated(void) { static void server_activate_non_existent_account(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "unknown_user"); linphone_account_creator_set_activation_code(creator, "58c9"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountNotActivated); - linphone_account_creator_responses_cbs_set_activate_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountNotActivated); + linphone_account_creator_cbs_set_activate_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1077,8 +1077,8 @@ static void server_activate_account_cb_missing(void) { BC_ASSERT_EQUAL( linphone_account_creator_activate_account(creator), - LinphoneRequestMissingCallbacks, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingCallbacks, + LinphoneAccountCreatorStatus, "%i"); linphone_account_creator_unref(creator); @@ -1088,22 +1088,22 @@ static void server_activate_account_cb_missing(void) { static void server_activate_account_with_email_activated_arg_username_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_activation_code(creator, "123456789"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_activate_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_activate_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1114,22 +1114,22 @@ static void server_activate_account_with_email_activated_arg_username_missing(vo static void server_activate_account_with_email_activated_arg_activation_code_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_activate_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_activate_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1140,22 +1140,22 @@ static void server_activate_account_with_email_activated_arg_activation_code_mis static void server_activate_account_with_phone_number_activated_arg_username_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_activation_code(creator, "123456789"); linphone_account_creator_set_phone_number(creator, "0123456", "33"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_activate_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_activate_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1166,22 +1166,22 @@ static void server_activate_account_with_phone_number_activated_arg_username_mis static void server_activate_account_with_phone_number_activated_arg_activation_code_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); linphone_account_creator_set_phone_number(creator, "0123456", "33"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_activate_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_activate_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1194,22 +1194,22 @@ static void server_activate_account_with_phone_number_activated_arg_activation_c static void server_link_account_with_phone_number(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); linphone_account_creator_set_phone_number(creator, "000555456", "1"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestOk); - linphone_account_creator_responses_cbs_set_link_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusRequestOk); + linphone_account_creator_cbs_set_link_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_link_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1222,22 +1222,22 @@ static void server_link_account_with_phone_number(void) { static void server_link_non_existent_account_with_phone_number(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "unknown_user"); linphone_account_creator_set_phone_number(creator, "012345678", "33"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountNotLinked); - linphone_account_creator_responses_cbs_set_link_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountNotLinked); + linphone_account_creator_cbs_set_link_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_link_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1256,8 +1256,8 @@ static void server_link_account_cb_missing(void) { BC_ASSERT_EQUAL( linphone_account_creator_link_account(creator), - LinphoneRequestMissingCallbacks, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingCallbacks, + LinphoneAccountCreatorStatus, "%i"); linphone_account_creator_unref(creator); @@ -1267,21 +1267,21 @@ static void server_link_account_cb_missing(void) { static void server_link_account_arg_username_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_phone_number(creator, "0123456", "33"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_link_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_link_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_link_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1292,21 +1292,21 @@ static void server_link_account_arg_username_missing(void) { static void server_link_account_arg_phone_number_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_link_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_link_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_link_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1319,7 +1319,7 @@ static void server_link_account_arg_phone_number_missing(void) { static void server_activate_phone_number_for_non_existent_account(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "unknown_user"); @@ -1327,16 +1327,16 @@ static void server_activate_phone_number_for_non_existent_account(void) { linphone_account_creator_set_activation_code(creator, "12345679"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountNotActivated); - linphone_account_creator_responses_cbs_set_activate_alias_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountNotActivated); + linphone_account_creator_cbs_set_activate_alias(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_alias(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1349,26 +1349,26 @@ static void server_activate_phone_number_for_non_existent_account(void) { static void server_activate_phone_number_for_account(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); + linphone_account_creator_cbs_set_user_data(cbs, stats); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); linphone_account_creator_set_phone_number(creator, "000555456", "1"); linphone_account_creator_set_password(creator, "password"); linphone_account_creator_set_email(creator, "user_1@linphone.org"); get_activation_code(creator, &stats->cb_done); - account_creator_reset_cb_done(creator->responses_cbs); + account_creator_reset_cb_done(creator->cbs); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountActivated); - linphone_account_creator_responses_cbs_set_activate_alias_cb(cbs, account_creator_cb); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountActivated); + linphone_account_creator_cbs_set_activate_alias(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_alias(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1389,8 +1389,8 @@ static void server_activate_alias_cb_missing(void) { BC_ASSERT_EQUAL( linphone_account_creator_activate_alias(creator), - LinphoneRequestMissingCallbacks, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingCallbacks, + LinphoneAccountCreatorStatus, "%i"); linphone_account_creator_unref(creator); @@ -1400,23 +1400,23 @@ static void server_activate_alias_cb_missing(void) { static void server_activate_alias_arg_username_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_phone_number(creator, "012345678", "33"); linphone_account_creator_set_activation_code(creator, "12345679"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_activate_alias_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_activate_alias(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_alias(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1427,23 +1427,23 @@ static void server_activate_alias_arg_username_missing(void) { static void server_activate_alias_arg_activation_code_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); linphone_account_creator_set_phone_number(creator, "012345678", "33"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_activate_alias_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_activate_alias(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_alias(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1454,23 +1454,23 @@ static void server_activate_alias_arg_activation_code_missing(void) { static void server_activate_alias_arg_password_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); linphone_account_creator_set_phone_number(creator, "012345678", "33"); linphone_account_creator_set_activation_code(creator, "12345679"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_activate_alias_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_activate_alias(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_alias(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1481,23 +1481,23 @@ static void server_activate_alias_arg_password_missing(void) { static void server_activate_alias_arg_phone_number_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); linphone_account_creator_set_activation_code(creator, "12345679"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_activate_alias_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_activate_alias(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_activate_alias(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1510,21 +1510,21 @@ static void server_activate_alias_arg_phone_number_missing(void) { static void server_phone_number_is_used_as_alias(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_phone_number(creator, "000555456", "1"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAliasExist); - linphone_account_creator_responses_cbs_set_is_alias_used_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAliasExist); + linphone_account_creator_cbs_set_is_alias_used(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_alias_used(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1537,21 +1537,21 @@ static void server_phone_number_is_used_as_alias(void) { static void server_phone_number_is_used_as_account(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_phone_number(creator, "000555455", "1"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAliasIsAccount); - linphone_account_creator_responses_cbs_set_is_alias_used_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAliasIsAccount); + linphone_account_creator_cbs_set_is_alias_used(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_alias_used(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1564,21 +1564,21 @@ static void server_phone_number_is_used_as_account(void) { static void server_phone_number_not_used(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_phone_number(creator, "012345678", "33"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAliasNotExist); - linphone_account_creator_responses_cbs_set_is_alias_used_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAliasNotExist); + linphone_account_creator_cbs_set_is_alias_used(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_alias_used(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1596,8 +1596,8 @@ static void server_is_alias_used_cb_missing(void) { BC_ASSERT_EQUAL( linphone_account_creator_is_alias_used(creator), - LinphoneRequestMissingCallbacks, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingCallbacks, + LinphoneAccountCreatorStatus, "%i"); linphone_account_creator_unref(creator); @@ -1607,19 +1607,19 @@ static void server_is_alias_used_cb_missing(void) { static void server_is_alias_used_arg_phone_number_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_is_alias_used_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_is_alias_used(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_alias_used(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1632,21 +1632,21 @@ static void server_is_alias_used_arg_phone_number_missing(void) { static void server_account_link_with_phone_number(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountLinked); - linphone_account_creator_responses_cbs_set_is_account_linked_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountLinked); + linphone_account_creator_cbs_set_is_account_linked(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_account_linked(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1659,21 +1659,21 @@ static void server_account_link_with_phone_number(void) { static void server_account_not_link_with_phone_number(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountNotLinked); - linphone_account_creator_responses_cbs_set_is_account_linked_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountNotLinked); + linphone_account_creator_cbs_set_is_account_linked(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_account_linked(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1691,8 +1691,8 @@ static void server_is_account_linked_cb_missing(void) { BC_ASSERT_EQUAL( linphone_account_creator_is_account_linked(creator), - LinphoneRequestMissingCallbacks, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingCallbacks, + LinphoneAccountCreatorStatus, "%i"); linphone_account_creator_unref(creator); @@ -1702,19 +1702,19 @@ static void server_is_account_linked_cb_missing(void) { static void server_is_account_linked_arg_username_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_is_account_linked_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_is_account_linked(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_is_account_linked(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1727,21 +1727,21 @@ static void server_is_account_linked_arg_username_missing(void) { static void server_recover_account_with_phone_number_used(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_phone_number(creator, "000555456", "1"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestOk); - linphone_account_creator_responses_cbs_set_recover_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusRequestOk); + linphone_account_creator_cbs_set_recover_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_recover_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1754,21 +1754,21 @@ static void server_recover_account_with_phone_number_used(void) { static void server_recover_account_with_phone_number_not_used(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_phone_number(creator, "012345678", "33"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountNotExist); - linphone_account_creator_responses_cbs_set_recover_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountNotExist); + linphone_account_creator_cbs_set_recover_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_recover_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1786,8 +1786,8 @@ static void server_recover_account_with_phone_number_cb_missing(void) { BC_ASSERT_EQUAL( linphone_account_creator_recover_account(creator), - LinphoneRequestMissingCallbacks, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingCallbacks, + LinphoneAccountCreatorStatus, "%i"); linphone_account_creator_unref(creator); @@ -1797,19 +1797,19 @@ static void server_recover_account_with_phone_number_cb_missing(void) { static void server_recover_account_with_phone_number_arg_phone_number_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); - linphone_account_creator_responses_cbs_set_recover_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); + linphone_account_creator_cbs_set_recover_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_recover_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1822,23 +1822,23 @@ static void server_recover_account_with_phone_number_arg_phone_number_missing(vo static void server_update_account_password_with_wrong_password(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); linphone_account_creator_set_password(creator, "pssword"); linphone_account_creator_set_user_data(creator, "newpassword"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestAccountNotExist); - linphone_account_creator_responses_cbs_set_update_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusAccountNotExist); + linphone_account_creator_cbs_set_update_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_update_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1851,23 +1851,23 @@ static void server_update_account_password_with_wrong_password(void) { static void server_update_account_password_with_correct_password(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "XXXTESTuser_1"); linphone_account_creator_set_password(creator, "password"); linphone_account_creator_set_user_data(creator, "newpassword"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestOk); - linphone_account_creator_responses_cbs_set_update_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusRequestOk); + linphone_account_creator_cbs_set_update_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_update_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1880,23 +1880,23 @@ static void server_update_account_password_with_correct_password(void) { static void server_update_account_password_for_non_existent_account(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "unknown_user"); linphone_account_creator_set_password(creator, "password"); linphone_account_creator_set_user_data(creator, "newpassword"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestErrorServer); - linphone_account_creator_responses_cbs_set_update_account_cb(cbs, account_creator_cb); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusServerError); + linphone_account_creator_cbs_set_update_account(cbs, account_creator_cb); BC_ASSERT_EQUAL( linphone_account_creator_update_account(creator), - LinphoneRequestOk, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusRequestOk, + LinphoneAccountCreatorStatus, "%i"); wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST); @@ -1917,8 +1917,8 @@ static void server_update_account_password_cb_missing(void) { BC_ASSERT_EQUAL( linphone_account_creator_update_account(creator), - LinphoneRequestMissingCallbacks, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingCallbacks, + LinphoneAccountCreatorStatus, "%i"); linphone_account_creator_unref(creator); @@ -1928,23 +1928,23 @@ static void server_update_account_password_cb_missing(void) { static void server_update_account_password_arg_username_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_phone_number(creator, "0123456", "33"); linphone_account_creator_set_password(creator, "password"); linphone_account_creator_set_user_data(creator, "newpassword"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_responses_cbs_set_update_account_cb(cbs, account_creator_cb); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_cbs_set_update_account(cbs, account_creator_cb); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); BC_ASSERT_EQUAL( linphone_account_creator_update_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1955,22 +1955,22 @@ static void server_update_account_password_arg_username_missing(void) { static void server_update_account_password_arg_phone_number_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_password(creator, "password"); linphone_account_creator_set_user_data(creator, "newpassword"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_responses_cbs_set_update_account_cb(cbs, account_creator_cb); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_cbs_set_update_account(cbs, account_creator_cb); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); BC_ASSERT_EQUAL( linphone_account_creator_update_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -1981,23 +1981,23 @@ static void server_update_account_password_arg_phone_number_missing(void) { static void server_update_account_password_arg_password_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); linphone_account_creator_set_phone_number(creator, "0123456", "33"); linphone_account_creator_set_user_data(creator, "newpassword"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_responses_cbs_set_update_account_cb(cbs, account_creator_cb); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_cbs_set_update_account(cbs, account_creator_cb); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); BC_ASSERT_EQUAL( linphone_account_creator_update_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); @@ -2008,23 +2008,23 @@ static void server_update_account_password_arg_password_missing(void) { static void server_update_account_password_arg_new_password_missing(void) { LinphoneCoreManager *marie = linphone_core_manager_new2("account_creator_rc", 0); LinphoneAccountCreator *creator = _linphone_account_creator_new(marie->lc, XMLRPC_URL); - LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator); + LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator); LinphoneAccountCreatorStats *stats = new_linphone_account_creator_stats(); linphone_account_creator_set_username(creator, "user_exist"); linphone_account_creator_set_phone_number(creator, "0123456", "33"); linphone_account_creator_set_password(creator, "password"); - linphone_account_creator_responses_cbs_set_user_data(cbs, stats); - linphone_account_creator_responses_cbs_set_update_account_cb(cbs, account_creator_cb); - linphone_account_creator_requests_cbs_set_user_data( - linphone_account_creator_get_requests_cbs(creator), - (void*)LinphoneRequestMissingArguments); + linphone_account_creator_cbs_set_user_data(cbs, stats); + linphone_account_creator_cbs_set_update_account(cbs, account_creator_cb); + linphone_account_creator_service_set_user_data( + linphone_account_creator_get_service(creator), + (void*)LinphoneAccountCreatorStatusMissingArguments); BC_ASSERT_EQUAL( linphone_account_creator_update_account(creator), - LinphoneRequestMissingArguments, - LinphoneRequestStatus, + LinphoneAccountCreatorStatusMissingArguments, + LinphoneAccountCreatorStatus, "%i"); ms_free(stats); diff --git a/tools/genapixml.py b/tools/genapixml.py index dc3a132b0..fc291bdd0 100755 --- a/tools/genapixml.py +++ b/tools/genapixml.py @@ -370,6 +370,8 @@ class Project: return ev def __parseCEnumMemberdef(self, node): + if not Project.__canBeWrapped(self, node): + return None e = CEnum(node.find('./name').text) deprecatedNode = node.find(".//xrefsect[xreftitle='Deprecated']") if deprecatedNode is not None: @@ -420,6 +422,8 @@ class Project: self.add(s) def __parseCTypedefMemberdef(self, node): + if not Project.__canBeWrapped(self, node): + return None name = node.find('./name').text definition = node.find('./definition').text if definition.startswith('typedef '): diff --git a/wrappers/cpp/genwrapper.py b/wrappers/cpp/genwrapper.py index 0fb8cd558..f363c3d0d 100755 --- a/wrappers/cpp/genwrapper.py +++ b/wrappers/cpp/genwrapper.py @@ -24,7 +24,6 @@ import os import sys import errno sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'tools')) -print(sys.path) import genapixml as CApi import abstractapi as AbsApi