Refactoring of account creator + tester of account creator

This commit is contained in:
Erwan Croze 2017-03-15 17:25:51 +01:00
parent 54a0a0ff2f
commit b41b920426
7 changed files with 2555 additions and 1058 deletions

File diff suppressed because it is too large Load diff

View file

@ -1389,43 +1389,73 @@ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneXmlRpcSession);
* Account creator interface *
****************************************************************************/
struct _LinphoneAccountCreatorCbs {
struct _LinphoneAccountCreatorRequestCbs {
belle_sip_object_t base;
void *user_data;
LinphoneAccountCreatorCbsStatusCb is_account_used;
LinphoneAccountCreatorCbsStatusCb create_account;
LinphoneAccountCreatorCbsStatusCb activate_account;
LinphoneAccountCreatorCbsStatusCb is_account_activated;
LinphoneAccountCreatorCbsStatusCb is_phone_number_used;
LinphoneAccountCreatorCbsStatusCb link_phone_number_with_account;
LinphoneAccountCreatorCbsStatusCb activate_phone_number_link;
LinphoneAccountCreatorCbsStatusCb recover_phone_account;
LinphoneAccountCreatorCbsStatusCb is_account_linked;
LinphoneAccountCreatorCbsStatusCb update_hash;
LinphoneAccountCreatorRequestFunc create_account_request_cb; /**< Request to create account */
LinphoneAccountCreatorRequestFunc is_account_exist_request_cb; /**< Request to know if account exist */
LinphoneAccountCreatorRequestFunc activate_account_request_cb; /**< Request to activate account */
LinphoneAccountCreatorRequestFunc is_account_activated_request_cb; /**< Request to know if account is activated */
LinphoneAccountCreatorRequestFunc link_account_request_cb; /**< Request to link account with an alias */
LinphoneAccountCreatorRequestFunc activate_alias_request_cb; /**< Request to activate the link of alias */
LinphoneAccountCreatorRequestFunc is_alias_used_request_cb; /**< Request to know if alias is used */
LinphoneAccountCreatorRequestFunc is_account_linked_request_cb; /**< Request to know if account is linked with an alias */
LinphoneAccountCreatorRequestFunc recover_account_request_cb; /**< Request to recover account */
LinphoneAccountCreatorRequestFunc update_account_request_cb; /**< Request to update account */
};
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneAccountCreatorCbs);
BELLE_SIP_DECLARE_VPTR(LinphoneAccountCreatorRequestCbs);
struct _LinphoneAccountCreatorResponseCbs {
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 */
LinphoneAccountCreatorResponseFunc activate_account_response_cb; /**< Response of activate_account request */
LinphoneAccountCreatorResponseFunc 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 */
LinphoneAccountCreatorResponseFunc recover_account_response_cb; /**< Response of recover_account request */
LinphoneAccountCreatorResponseFunc update_account_response_cb; /**< Response of update_account request */
};
BELLE_SIP_DECLARE_VPTR(LinphoneAccountCreatorResponseCbs);
struct _LinphoneAccountCreator {
belle_sip_object_t base;
void *user_data;
LinphoneAccountCreatorCbs *callbacks;
LinphoneXmlRpcSession *xmlrpc_session;
LinphoneCore *core;
char *xmlrpc_url;
char *username;
char *phone_number;
char *password;
char *domain;
char *route;
char *email;
bool_t subscribe_to_newsletter;
char *display_name;
LinphoneTransportType transport;
char *activation_code;
char *ha1;
char *phone_country_code;
char *language;
/* AccountCreator */
LinphoneAccountCreatorRequestCbs *requests_cbs; /**< Account creator requests cbs */
LinphoneAccountCreatorResponseCbs *responses_cbs; /**< Account creator responses cbs */
LinphoneXmlRpcSession *xmlrpc_session; /**< XML-RPC session */
LinphoneProxyConfig *proxy_cfg; /**< Default proxy config */
/* User */
char *username; /**< Username */
char *display_name; /**< Display name */
/* Password */
char *password; /**< Plain text password */
char *ha1; /**< Hash password */
/* Phone Number(Alias) */
char *phone_number; /**< User phone number*/
char *phone_country_code; /**< User phone number country code */
/* Email(Alias) */
char *email; /**< User email */
/* Misc */
char *language; /**< User language */
char *activation_code; /**< Account validation code */
};
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneAccountCreator);
@ -1576,7 +1606,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(LinphoneAccountCreatorCbs),
BELLE_SIP_TYPE_ID(LinphoneAccountCreatorRequestCbs),
BELLE_SIP_TYPE_ID(LinphoneAccountCreatorResponseCbs),
BELLE_SIP_TYPE_ID(LinphoneBuffer),
BELLE_SIP_TYPE_ID(LinphoneContactProvider),
BELLE_SIP_TYPE_ID(LinphoneContactSearch),

View file

@ -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, LinphoneAccountCreatorStatus status, const char* resp) {
static void linphone_gtk_create_account_cb(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char* resp) {
GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator);
if (status == LinphoneAccountCreatorAccountCreated) {
if (status == LinphoneRequestAccountCreated) {
// 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, LinphoneAccountCreatorStatus status, const char* resp) {
static void linphone_gtk_test_account_validation_cb(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char* resp) {
GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator);
if (status == LinphoneAccountCreatorAccountActivated) {
if (status == LinphoneRequestAccountActivated) {
// Go to page_9_finish
gtk_assistant_set_current_page(GTK_ASSISTANT(assistant), 9);
} else {
@ -61,7 +61,9 @@ static void linphone_gtk_test_account_validation_cb(LinphoneAccountCreator *crea
static void check_account_validation(GtkWidget *assistant) {
LinphoneAccountCreator *creator = linphone_gtk_assistant_get_creator(assistant);
linphone_account_creator_is_account_activated(creator);
(linphone_account_creator_requests_cbs_get_is_account_activated_cb(
linphone_account_creator_get_requests_cbs(creator))
)(creator);
}
void linphone_gtk_assistant_closed(GtkWidget *w) {
@ -79,9 +81,7 @@ void linphone_gtk_assistant_prepare(GtkWidget *assistant) {
check_account_validation(assistant);
break;
case 9:
if (linphone_account_creator_configure(linphone_gtk_assistant_get_creator(assistant)) != NULL) {
linphone_gtk_load_identities();
}
linphone_gtk_load_identities();
gtk_assistant_commit(GTK_ASSISTANT(assistant));
break;
default:
@ -128,12 +128,8 @@ static int linphone_gtk_assistant_forward(int curpage, gpointer data) {
case 2:
{
GtkEntry *username_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p2_entry_username"));
GtkEntry *domain_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p2_entry_domain"));
GtkEntry *proxy_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p2_entry_proxy"));
GtkEntry *password_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p2_entry_password"));
linphone_account_creator_set_username(creator, gtk_entry_get_text(username_entry));
linphone_account_creator_set_domain(creator, gtk_entry_get_text(domain_entry));
linphone_account_creator_set_route(creator, gtk_entry_get_text(proxy_entry));
linphone_account_creator_set_password(creator, gtk_entry_get_text(password_entry));
curpage = 9; // Go to page_9_finish
break;
@ -143,8 +139,6 @@ static int linphone_gtk_assistant_forward(int curpage, gpointer data) {
GtkEntry *username_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p3_entry_username"));
GtkEntry *password_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p3_entry_password"));
linphone_account_creator_set_username(creator, gtk_entry_get_text(username_entry));
linphone_account_creator_set_domain(creator, "sip.linphone.org");
linphone_account_creator_set_route(creator, "sip.linphone.org");
linphone_account_creator_set_password(creator, gtk_entry_get_text(password_entry));
curpage = 9; // Go to page_9_finish
break;
@ -215,11 +209,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 == LinphoneAccountCreatorAccountNotExist) {
if (account_status == LinphoneRequestAccountNotExist) {
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 == LinphoneAccountCreatorAccountExist) {
} else if (account_status == LinphoneRequestAccountExist) {
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 +226,7 @@ static gboolean update_interface_with_username_availability(GtkWidget *page) {
return FALSE;
}
static void linphone_gtk_test_account_existence_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp) {
static void linphone_gtk_test_account_existence_cb(LinphoneAccountCreator *creator, LinphoneRequestStatus 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));
@ -243,7 +237,9 @@ static gboolean check_username_availability(GtkWidget *assistant) {
LinphoneAccountCreator *creator = linphone_gtk_assistant_get_creator(assistant);
GtkWidget *page = gtk_assistant_get_nth_page(GTK_ASSISTANT(assistant), gtk_assistant_get_current_page(GTK_ASSISTANT(assistant)));
g_object_set_data(G_OBJECT(page), "usernameAvailabilityTimerID", GUINT_TO_POINTER(0));
linphone_account_creator_is_account_used(creator);
(linphone_account_creator_requests_cbs_get_is_account_exist_cb(
linphone_account_creator_get_requests_cbs(creator))
)(creator);
return FALSE;
}
@ -257,8 +253,6 @@ void linphone_gtk_account_creation_username_changed(GtkEntry *entry) {
LinphoneAccountCreator *creator = linphone_gtk_assistant_get_creator(assistant);
linphone_account_creator_set_username(creator, gtk_entry_get_text(username));
linphone_account_creator_set_domain(creator, "sip.linphone.org");
linphone_account_creator_set_route(creator, "sip.linphone.org");
if (check_username_validity(gtk_entry_get_text(username))) {
guint timerID = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(page), "usernameAvailabilityTimerID"));
@ -324,11 +318,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");
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
linphone_account_creator_set_user_data(creator, w);
linphone_account_creator_cbs_set_is_account_used(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);
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);
g_object_set_data(G_OBJECT(w), "creator", creator);
gtk_assistant_set_forward_page_func(GTK_ASSISTANT(w), linphone_gtk_assistant_forward, w, NULL);

View file

@ -1,6 +1,6 @@
/*
account_creator.h
Copyright (C) 2010-2015 Belledonne Communications SARL
Copyright (C) 2010-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
@ -27,25 +27,109 @@ extern "C" {
#endif
/**
* @addtogroup misc
* @addtogroup account_creator
* @{
*/
/**
* Function to set custom server request.
* @param[in] creator LinphoneAccountCreator object
*/
typedef LinphoneRequestStatus (*LinphoneAccountCreatorRequestFunc)(LinphoneAccountCreator *creator);
/**
* Callback to notify a status change of the account creator.
* Callback to notify a response of server.
* @param[in] creator LinphoneAccountCreator object
* @param[in] status The status of the LinphoneAccountCreator test existence operation that has just finished
**/
typedef void (*LinphoneAccountCreatorCbsStatusCb)(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp);
typedef void (*LinphoneAccountCreatorResponseFunc)(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char* resp);
/************************** Start Account Creator data **************************/
/**
* Create a LinphoneAccountCreator.
* Create a LinphoneAccountCreator and set Linphone Request callbacks.
* @param[in] core The LinphoneCore used for the XML-RPC communication
* @param[in] xmlrpc_url The URL to the XML-RPC server. Must be NON NULL.
* @return The new LinphoneAccountCreator object
* @return The new LinphoneAccountCreator object.
**/
LINPHONE_PUBLIC LinphoneAccountCreator * linphone_account_creator_new(LinphoneCore *core, const char *xmlrpc_url);
/**
* Set Linphone functions to LinphoneAccountCreator.
* @param[in] creator LinphoneAccountCreator object
**/
LINPHONE_PUBLIC void linphone_account_creator_set_linphone_impl(LinphoneAccountCreator *creator);
/**
* Send a XML-RPC request to know the existence of account on server.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_exist(LinphoneAccountCreator *creator);
/**
* Send a XML-RPC request to create an account on server.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator);
/**
* Send a XML-RPC request to know if an account is activated on server.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_activated(LinphoneAccountCreator *creator);
/**
* Send a XML-RPC request to activate an account on server.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_activate_account(LinphoneAccountCreator *creator);
/**
* Send a XML-RPC request to link an account to an alias.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_link_account(LinphoneAccountCreator *creator);
/**
* Send a XML-RPC request to activate an alias.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_activate_alias(LinphoneAccountCreator *creator);
/**
* Send a XML-RPC request to know if an alias is used.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_alias_used(LinphoneAccountCreator *creator);
/**
* Send a XML-RPC request to know if an account is linked.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_is_account_linked(LinphoneAccountCreator *creator);
/**
* Send a XML-RPC request to recover an account.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_recover_account(LinphoneAccountCreator *creator);
/**
* Send a XML-RPC request to update an account.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_update_account(LinphoneAccountCreator *creator);
/**
* Acquire a reference to the LinphoneAccountCreator.
* @param[in] creator LinphoneAccountCreator object.
@ -77,9 +161,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 LinphoneAccountCreatorOk if everything is OK, or a specific error otherwise.
* @return LinphoneUsernameOk if everything is OK, or a specific error otherwise.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username);
LINPHONE_PUBLIC LinphoneUsernameCheck linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username);
/**
* Get the username.
@ -88,22 +172,14 @@ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_userna
**/
LINPHONE_PUBLIC const char * linphone_account_creator_get_username(const LinphoneAccountCreator *creator);
/**
* Update the password.
* @param[in] creator LinphoneAccountCreator object
* @param[in] new_pwd const char * : new password for the account creator
* @return LinphoneAccountCreatorOk if everything is OK, or a specific error otherwise.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_update_password(LinphoneAccountCreator *creator, const char *new_pwd);
/**
* Set the phone number normalized.
* @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 LinphoneAccountCreatorOk if everything is OK, or a specific error otherwise.
* @return LinphonePhoneNumberOk if everything is OK, or specific(s) error(s) otherwise.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_phone_number(LinphoneAccountCreator *creator, const char *phone_number, const char *country_code);
LINPHONE_PUBLIC LinphonePhoneNumberMask linphone_account_creator_set_phone_number(LinphoneAccountCreator *creator, const char *phone_number, const char *country_code);
/**
* Get the RFC 3966 normalized phone number.
@ -116,9 +192,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 LinphoneAccountCreatorOk if everything is OK, or a specific error otherwise.
* @return LinphonePasswordOk if everything is OK, or specific(s) error(s) otherwise.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_password(LinphoneAccountCreator *creator, const char *password);
LINPHONE_PUBLIC LinphonePasswordCheck linphone_account_creator_set_password(LinphoneAccountCreator *creator, const char *password);
/**
* Get the password.
@ -131,9 +207,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 LinphoneAccountCreatorOk if everything is OK, or a specific error otherwise.
* @return LinphonePasswordOk if everything is OK, or a specific error otherwise.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_ha1(LinphoneAccountCreator *creator, const char *ha1);
LINPHONE_PUBLIC LinphonePasswordCheck linphone_account_creator_set_ha1(LinphoneAccountCreator *creator, const char *ha1);
/**
* Get the ha1.
@ -146,71 +222,42 @@ 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.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_activation_code(LinphoneAccountCreator *creator, const char *activation_code);
LINPHONE_PUBLIC LinphoneActivationCodeCheck linphone_account_creator_set_activation_code(LinphoneAccountCreator *creator, const char *activation_code);
/**
* Get the activation code.
* @param[in] creator LinphoneAccountCreator object
* @return The activation code of the LinphoneAccountCreator
**/
LINPHONE_PUBLIC const char * linphone_account_creator_get_activation_code(const LinphoneAccountCreator *creator);
/**
* 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.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_language(LinphoneAccountCreator *creator, const char *lang);
LINPHONE_PUBLIC LinphoneLanguageCheck linphone_account_creator_set_language(LinphoneAccountCreator *creator, const char *lang);
/**
* Set the transport.
* Get the language use in email of SMS.
* @param[in] creator LinphoneAccountCreator object
* @param[in] transport The transport to set
* @return LinphoneAccountCreatorOk if everything is OK, or a specific error if given transport is not supported by linphone core.
* @return The language of the LinphoneAccountCreator
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_transport(LinphoneAccountCreator *creator, LinphoneTransportType transport);
LINPHONE_PUBLIC const char * linphone_account_creator_get_language(const LinphoneAccountCreator *creator);
/**
* Get the transport.
* @param[in] creator LinphoneAccountCreator object
* @return The transport of the LinphoneAccountCreator
**/
LINPHONE_PUBLIC LinphoneTransportType linphone_account_creator_get_transport(const LinphoneAccountCreator *creator);
/**
* Set the domain.
* @param[in] creator LinphoneAccountCreator object
* @param[in] domain The domain to set
* @return LinphoneAccountCreatorOk if everything is OK, or a specific error otherwise.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_domain(LinphoneAccountCreator *creator, const char *domain);
/**
* Get the domain.
* @param[in] creator LinphoneAccountCreator object
* @return The domain of the LinphoneAccountCreator
**/
LINPHONE_PUBLIC const char * linphone_account_creator_get_domain(const LinphoneAccountCreator *creator);
/**
* Set the route.
* @param[in] creator LinphoneAccountCreator object
* @param[in] route The route to set
* @return LinphoneAccountCreatorOk if everything is OK, or a specific error otherwise.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_route(LinphoneAccountCreator *creator, const char *route);
/**
* Get the route.
* @param[in] creator LinphoneAccountCreator object
* @return The route of the LinphoneAccountCreator
**/
LINPHONE_PUBLIC const char * linphone_account_creator_get_route(const LinphoneAccountCreator *creator);
/**
* Set the email.
* Set the display name.
* @param[in] creator LinphoneAccountCreator object
* @param[in] display_name The display name to set
* @return LinphoneAccountCreatorOk if everything is OK, or a specific error otherwise.
* @return LinphoneUsernameOk if everything is OK, or a specific error otherwise.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_display_name(LinphoneAccountCreator *creator, const char *display_name);
LINPHONE_PUBLIC LinphoneUsernameCheck linphone_account_creator_set_display_name(LinphoneAccountCreator *creator, const char *display_name);
/**
* Get the email.
* Get the display name.
* @param[in] creator LinphoneAccountCreator object
* @return The display name of the LinphoneAccountCreator
**/
@ -220,9 +267,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 LinphoneAccountCreatorOk if everything is OK, or a specific error otherwise.
* @return LinphoneEmailOk if everything is OK, or a specific error otherwise.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_email(LinphoneAccountCreator *creator, const char *email);
LINPHONE_PUBLIC LinphoneEmailCheck linphone_account_creator_set_email(LinphoneAccountCreator *creator, const char *email);
/**
* Get the email.
@ -232,234 +279,446 @@ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_email(
LINPHONE_PUBLIC const char * linphone_account_creator_get_email(const LinphoneAccountCreator *creator);
/**
* Get the LinphoneAccountCreatorCbs object associated with a LinphoneAccountCreator.
* Get the LinphoneAccountCreatorResponseCbs object associated with a LinphoneAccountCreator.
* @param[in] creator LinphoneAccountCreator object
* @return The LinphoneAccountCreatorCbs object associated with the LinphoneAccountCreator.
* @return The LinphoneAccountCreatorResponseCbs object associated with the LinphoneAccountCreator.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbs * linphone_account_creator_get_callbacks(const LinphoneAccountCreator *creator);
LINPHONE_PUBLIC LinphoneAccountCreatorResponseCbs * linphone_account_creator_get_responses_cbs(const LinphoneAccountCreator *creator);
/**
* Get the LinphoneAccountCreatorRequestCbs object associated with a LinphoneAccountCreator.
* @param[in] creator LinphoneAccountCreator object
* @return The LinphoneAccountCreatorRequestCbs object associated with the LinphoneAccountCreator.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestCbs * linphone_account_creator_get_requests_cbs(const LinphoneAccountCreator *creator);
/************************** End Account Creator data **************************/
/************************** Start Account Creator Linphone **************************/
/**
* Send an XML-RPC request to test the existence of a Linphone account.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorReqFailed otherwise
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_used(LinphoneAccountCreator *creator);
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 LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorReqFailed otherwise
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator);
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 LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorReqFailed otherwise
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_account(LinphoneAccountCreator *creator);
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 LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorReqFailed otherwise
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_activated(LinphoneAccountCreator *creator);
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 LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorReqFailed otherwise
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_phone_number_used(LinphoneAccountCreator *creator);
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 LinphoneAccountCreatorOK if the request has been sent, LinphoneAccountCreatorReqFailed otherwise
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_link_phone_number_with_account(LinphoneAccountCreator *creator);
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 LinphoneAccountCreatorOK if the request has been sent, LinphoneAccountCreatorReqFailed otherwise
* @return LinphoneRequestOk if the request has been sent, LinphoneRequestFailed otherwise
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_phone_number_link(LinphoneAccountCreator *creator);
LINPHONE_PUBLIC LinphoneRequestStatus linphone_account_creator_activate_phone_number_link_custom(LinphoneAccountCreator *creator);
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_recover_phone_account(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 LinphoneAccountCreatorStatus linphone_account_creator_is_account_linked(LinphoneAccountCreator *creator);
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.
**/
// TODO viré new_pwd qui sera remplacé par le get_user_data de creator
LINPHONE_PUBLIC /*TODO*/ LinphoneRequestStatus linphone_account_creator_update_password_custom(LinphoneAccountCreator *creator);
/************************** End Account Creator Linphone **************************/
/************************** Start Account Creator Requests **************************/
/**
* Acquire a reference to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The same LinphoneAccountCreatorRequestCbs object.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_ref(LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Release a reference to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_unref(LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Retrieve the user pointer associated with a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The user pointer associated with the LinphoneAccountCreatorRequestCbs object.
**/
LINPHONE_PUBLIC void *linphone_account_creator_requests_cbs_get_user_data(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] ud The user pointer to associate with the LinphoneAccountCreatorRequestCbs object.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_user_data(LinphoneAccountCreatorRequestCbs *requests_cbs, void *ud);
/**
* Get the create account request.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The current create account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_create_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] func The create account request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_create_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
/**
* Get the is account exist request.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The current is account exist request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_exist_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] func The is account exist request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_exist_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
/**
* Get the activate account request.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The current activate account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_activate_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] func The activate account request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_activate_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
/**
* Get the is account activated request.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The current is account activated request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_activated_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] func The is account activated request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_activated_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
/**
* Get the link account request.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The current link account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_link_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] func The link account request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_link_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
/**
* Get the activate alias request.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The current link account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_activate_alias_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] func The activate alias request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_activate_alias_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
/**
* Get the is alias used request.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The current is alias used request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_alias_used_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] func The is alias used request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_alias_used_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
/**
* Get the is account linked request.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The current is account linked request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_linked_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] func The is account linked request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_is_account_linked_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
/**
* Get the recover account request.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The current recover account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_recover_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] func The recover account request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_recover_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
/**
* Get the update account request.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @return The current update account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_update_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorRequestCbs object.
* @param[in] requests_cbs LinphoneAccountCreatorRequestCbs object.
* @param[in] func The update account request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_requests_cbs_set_update_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc func);
/************************** End Account Creator Requests **************************/
/************************** Start Account Creator Cbs **************************/
/**
* Acquire a reference to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The same LinphoneAccountCreatorResponseCbs object.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseCbs * linphone_account_creator_responses_cbs_ref(LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Release a reference to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_unref(LinphoneAccountCreatorResponseCbs *responses_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.
**/
LINPHONE_PUBLIC void *linphone_account_creator_responses_cbs_get_user_data(const LinphoneAccountCreatorResponseCbs *responses_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.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_user_data(LinphoneAccountCreatorResponseCbs *responses_cbs, void *ud);
/**
* Get the create account request.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The current create account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_create_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @param[in] cb The create account request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_create_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb);
/**
* Get the is account exist request.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The current is account exist request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_account_exist_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @param[in] cb The is account exist request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_is_account_exist_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb);
/**
* Get the activate account request.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The current activate account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_activate_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @param[in] cb The activate account request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_activate_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb);
/**
* Get the is account activated request.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The current is account activated request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_account_activated_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @param[in] cb The is account activated request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_is_account_activated_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb);
/**
* Get the link account request.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The current link account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_link_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @param[in] cb The link account request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_link_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb);
/**
* Get the activate alias request.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The current link account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_activate_alias_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @param[in] cb The activate alias request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_activate_alias_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb);
/**
* Get the is alias used request.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The current is alias used request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_alias_used_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @param[in] cb The is alias used request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_is_alias_used_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb);
/**
* Get the is account linked request.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The current is account linked request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_is_account_linked_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @param[in] cb The is account linked request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_is_account_linked_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb);
/**
* Get the recover account request.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The current recover account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_recover_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @param[in] cb The recover account request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_recover_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb);
/**
* Get the update account request.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @return The current update account request.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorResponseFunc linphone_account_creator_responses_cbs_get_update_account_cb(const LinphoneAccountCreatorResponseCbs *responses_cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorResponseCbs object.
* @param[in] responses_cbs LinphoneAccountCreatorResponseCbs object.
* @param[in] cb The update account request to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_responses_cbs_set_update_account_cb(LinphoneAccountCreatorResponseCbs *responses_cbs, LinphoneAccountCreatorResponseFunc cb);
/************************** End Account Creator Cbs **************************/
/**
* Configure an account (create a proxy config and authentication info for it).
* @param[in] creator LinphoneAccountCreator object
* @return A LinphoneProxyConfig object if successful, NULL otherwise
**/
**/
LINPHONE_PUBLIC LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCreator *creator);
/**
* Acquire a reference to a LinphoneAccountCreatorCbs object.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The same LinphoneAccountCreatorCbs object.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbs * linphone_account_creator_cbs_ref(LinphoneAccountCreatorCbs *cbs);
/**
* Release a reference to a LinphoneAccountCreatorCbs object.
* @param[in] cbs LinphoneAccountCreatorCbs object.
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_unref(LinphoneAccountCreatorCbs *cbs);
/**
* 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_cbs_get_user_data(const LinphoneAccountCreatorCbs *cbs);
/**
* 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_cbs_set_user_data(LinphoneAccountCreatorCbs *cbs, void *ud);
/**
* 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 LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_update_hash(const LinphoneAccountCreatorCbs *cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The update hash callback to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_update_hash(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the current linked tested callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current linked tested callback.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_linked(const LinphoneAccountCreatorCbs *cbs);
/**
* Set the linked tested callback
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The existence tested callback to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_linked(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the existence tested callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current existence tested callback.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_used(const LinphoneAccountCreatorCbs *cbs);
/**
* Set the existence tested callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The existence tested callback to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_used(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the create account callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current create account callback.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_create_account(const LinphoneAccountCreatorCbs *cbs);
/**
* Set the create account callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The create account callback to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_create_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the activate account callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current activate account callback.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_activate_account(const LinphoneAccountCreatorCbs *cbs);
/**
* Set the activate account callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The activate account callback to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_activate_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the link phone number with account callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current link phone number with account callback.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_link_phone_number_with_account(const LinphoneAccountCreatorCbs *cbs);
/**
* Set the link phone number with account callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The link phone number with account callback to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_link_phone_number_with_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the activate phone number link callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current activate phone number link callback.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_activate_phone_number_link(const LinphoneAccountCreatorCbs *cbs);
/**
* Set the activate phone number link callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The activate phone number link callback to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_activate_phone_number_link(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the validation tested callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current validation tested callback.
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_activated(const LinphoneAccountCreatorCbs *cbs);
/**
* Set the validation tested callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The validation tested callback to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_activated(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the is phone number used callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current is phone number used callback
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_phone_number_used(const LinphoneAccountCreatorCbs *cbs);
/**
* Set the is phone number used callback.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb is phone number to be used.
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_phone_number_used(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_recover_phone_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_recover_phone_account(const LinphoneAccountCreatorCbs *cbs);
/**
* @}
*/

View file

@ -28,64 +28,127 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/**
* The LinphoneAccountCreator object used to create an account on a server via XML-RPC.
* @ingroup misc
* The LinphoneAccountCreator object used to configure an account on a server via XML-RPC.
* @ingroup account_creator
**/
typedef struct _LinphoneAccountCreator LinphoneAccountCreator;
/**
* An object to handle the callbacks for handling the LinphoneAccountCreator operations.
* @ingroup misc
* An object to handle the requests callbacks for handling the LinphoneAccountCreator server requests.
* @ingroup account_creator
**/
typedef struct _LinphoneAccountCreatorCbs LinphoneAccountCreatorCbs;
typedef struct _LinphoneAccountCreatorRequestCbs LinphoneAccountCreatorRequestCbs;
/**
* Enum describing the status of a LinphoneAccountCreator operation.
* @ingroup misc
* An object to handle the responses callbacks for handling the LinphoneAccountCreator operations.
* @ingroup account_creator
**/
typedef enum _LinphoneAccountCreatorStatus {
LinphoneAccountCreatorOK,
LinphoneAccountCreatorReqFailed,
typedef struct _LinphoneAccountCreatorResponseCbs LinphoneAccountCreatorResponseCbs;
LinphoneAccountCreatorAccountCreated,
LinphoneAccountCreatorAccountNotCreated,
/**
* Enum describing Phone number checking.
* @ingroup account_creator_checking
**/
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;
LinphoneAccountCreatorAccountExist,
LinphoneAccountCreatorAccountExistWithAlias,
LinphoneAccountCreatorAccountNotExist,
/**
* A mask of #LinphonePhoneNumberCheck values
* @ingroup account_creator_checking
*/
typedef unsigned int LinphonePhoneNumberMask;
LinphoneAccountCreatorAccountActivated,
LinphoneAccountCreatorAccountAlreadyActivated,
LinphoneAccountCreatorAccountNotActivated,
/**
* Enum describing Username checking.
* @ingroup account_creator_checking
**/
typedef enum _LinphoneUsernameCheck {
LinphoneUsernameOk, /**< Username ok */
LinphoneUsernameTooShort, /**< Username too short */
LinphoneUsernameTooLong, /**< Username too long */
LinphoneUsernameInvalidCharacters, /**< Contain invalid characters */
LinphoneUsernameInvalid, /**< Invalid username */
} LinphoneUsernameCheck;
LinphoneAccountCreatorAccountLinked,
LinphoneAccountCreatorAccountNotLinked,
/**
* Enum describing Email checking.
* @ingroup account_creator_checking
**/
typedef enum _LinphoneEmailCheck {
LinphoneEmailOk, /**< Email ok */
LinphoneEmailMalformed, /**< Email malformed */
LinphoneEmailInvalidCharacters, /**< Contain invalid characters */
} LinphoneEmailCheck;
LinphoneAccountCreatorEmailInvalid,
/**
* Enum describing Password checking.
* @ingroup account_creator_checking
**/
typedef enum _LinphonePasswordCheck {
LinphonePasswordOk, /**< Password ok */
LinphonePasswordTooShort, /**< Password too short */
LinphonePasswordTooLong, /**< Password too long */
LinphonePasswordInvalidCharacters, /**< Contain invalid characters */
LinphonePasswordMissingCharacters, /**< Missing specific characters */
} LinphonePasswordCheck;
LinphoneAccountCreatorUsernameInvalid,
LinphoneAccountCreatorUsernameTooShort,
LinphoneAccountCreatorUsernameTooLong,
LinphoneAccountCreatorUsernameInvalidSize,
/**
* Enum describing language checking.
* @ingroup account_creator_checking
**/
typedef enum _LinphoneLanguageCheck {
LinphoneLanguageOk, /**< Language ok */
} LinphoneLanguageCheck;
LinphoneAccountCreatorPhoneNumberInvalid,
LinphoneAccountCreatorPhoneNumberTooShort,
LinphoneAccountCreatorPhoneNumberTooLong,
LinphoneAccountCreatorPhoneNumberUsedAccount,
LinphoneAccountCreatorPhoneNumberUsedAlias,
LinphoneAccountCreatorPhoneNumberNotUsed,
/**
* Enum describing Activation code checking.
* @ingroup account_creator_checking
**/
typedef enum _LinphoneActivationCodeCheck {
LinphoneActivationCodeOk, /**< Activation code ok */
LinphoneActivationCodeTooShort, /**< Activation code too short */
LinphoneActivationCodeTooLong, /**< Activation code too long */
LinphoneActivationCodeInvalidCharacters, /**< Contain invalid characters */
} LinphoneActivationCodeCheck;
LinphoneAccountCreatorPasswordTooShort,
LinphoneAccountCreatorPasswordTooLong,
/**
* Enum describing the status of server request.
* @ingroup account_creator_request
**/
typedef enum _LinphoneRequestStatus {
/** Request status **/
LinphoneRequestOk, /**< Request passed */
LinphoneRequestFailed, /**< Request failed */
LinphoneRequestMissingArguments, /**< Request failed due to missing argument(s) */
LinphoneRequestMissingCallbacks, /**< Request failed due to missing callback(s) */
LinphoneAccountCreatorDomainInvalid,
LinphoneAccountCreatorRouteInvalid,
LinphoneAccountCreatorDisplayNameInvalid,
LinphoneAccountCreatorTransportNotSupported,
LinphoneAccountCreatorCountryCodeInvalid,
/** Account status **/
/* Creation */
LinphoneRequestAccountCreated, /**< Account created */
LinphoneRequestAccountNotCreated, /**< 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 */
/* Activation */
LinphoneRequestAccountActivated, /**< Account activated */
LinphoneRequestAccountAlreadyActivated, /**< Account already activated */
LinphoneRequestAccountNotActivated, /**< Account not activated */
/* Linking */
LinphoneRequestAccountLinked, /**< Account linked */
LinphoneRequestAccountNotLinked, /**< Account not linked */
LinphoneAccountCreatorErrorServer,
} LinphoneAccountCreatorStatus;
/** Server **/
LinphoneRequestErrorServer, /**< Error server */
} LinphoneRequestStatus;
struct SalAddress;

File diff suppressed because it is too large Load diff

View file

@ -3,11 +3,12 @@ domain=sip.accounttest.org
password_max_length=8
password_min_length=3
username_length=4
username_max_length=8
username_max_length=14
username_min_length=3
username_regex=^[a-z0-9_.\-]*$
xmlrpc_url=https://sip2.linphone.org:445/wizard.php
[proxy]
[proxy_default_values]
reg_proxy=<sip:sip2.linphone.org:5072>
realm=sip.accounttest.org
reg_identity=sip:user@sip.accounttest.org