Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void _is_account_exist_response_cb(LinphoneXmlRpcRequest *request) {
- LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request);
- if (creator->cbs->is_account_exist_response_cb != NULL) {
- LinphoneAccountCreatorStatus status = LinphoneAccountCreatorStatusRequestFailed;
- const char* resp = linphone_xml_rpc_request_get_string_response(request);
- const char* pwd = "supersecretqaz";
- if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) {
- 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);
- }
- int c = 0;
- char **arr = NULL;
- c = split(resp, ',', &arr);
- set_string(&creator->username, arr[0], TRUE);
- set_string(&creator->role, arr[1], TRUE);
- set_string(&creator->password, pwd, TRUE);
- set_string(&creator->phone_country_code, "", TRUE);
- //set_string(&creator->display_name, resp, TRUE);
- ms_message("Account creator: is_account_exist_response (username=%s, role=%s, display_name=%s, password=%s, prefix=%s, domain=%s)",
- creator->username,
- creator->role,
- creator->display_name,
- creator->password,
- creator->phone_country_code,
- linphone_proxy_config_get_domain(creator->proxy_cfg));
- }
- creator->cbs->is_account_exist_response_cb(creator, status, resp);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement