mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 20:48:07 +00:00
Add error server status for xmlrpc
This commit is contained in:
parent
f9fe0fa968
commit
788f6cc4fc
3 changed files with 12 additions and 3 deletions
|
|
@ -559,7 +559,11 @@ static void _create_account_cb(LinphoneXmlRpcRequest *request) {
|
|||
LinphoneAccountCreatorStatus status = LinphoneAccountCreatorReqFailed;
|
||||
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) ? LinphoneAccountCreatorAccountCreated : LinphoneAccountCreatorAccountNotCreated;
|
||||
status = (strcmp(resp, "OK") == 0) ? LinphoneAccountCreatorAccountCreated
|
||||
: (strcmp(resp, "ERROR_CANNOT_SEND_SMS") == 0) ? LinphoneAccountCreatorErrorServer
|
||||
: (strcmp(resp, "ERROR_ACCOUNT_ALREADY_IN_USE") == 0) ? LinphoneAccountCreatorAccountExist
|
||||
: (strcmp(resp, "ERROR_ALIAS_ALREADY_IN_USE") == 0) ? LinphoneAccountCreatorAccountExistWithAlias
|
||||
:LinphoneAccountCreatorAccountNotCreated;
|
||||
}
|
||||
creator->callbacks->create_account(creator, status, resp);
|
||||
}
|
||||
|
|
@ -853,7 +857,9 @@ static void _recover_phone_account_cb(LinphoneXmlRpcRequest *request) {
|
|||
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 = LinphoneAccountCreatorReqFailed;
|
||||
status = (strstr(resp, "ERROR_CANNOT_SEND_SMS") == resp) ? LinphoneAccountCreatorErrorServer
|
||||
: (strstr(resp, "ERROR_ACCOUNT_DOESNT_EXIST") == resp) ? LinphoneAccountCreatorAccountNotExist
|
||||
: LinphoneAccountCreatorReqFailed;
|
||||
} else {
|
||||
status = LinphoneAccountCreatorOK;
|
||||
set_string(&creator->username, resp, FALSE);
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ typedef enum _LinphoneAccountCreatorStatus {
|
|||
LinphoneAccountCreatorDisplayNameInvalid,
|
||||
LinphoneAccountCreatorTransportNotSupported,
|
||||
LinphoneAccountCreatorCountryCodeInvalid,
|
||||
|
||||
LinphoneAccountCreatorErrorServer,
|
||||
} LinphoneAccountCreatorStatus;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ public interface LinphoneAccountCreator {
|
|||
public final static Status DisplayNameInvalid = new Status(27, "DisplayNameInvalid");
|
||||
public final static Status TransportNotSupported = new Status(28, "TransportNotSupported");
|
||||
public final static Status CountryCodeInvalid = new Status(29, "CountryCodeInvalid");
|
||||
public final static Status ErrorServeur = new Status(30, "ErrorServer");
|
||||
|
||||
private Status(int value, String stringValue) {
|
||||
mValue = value;
|
||||
|
|
@ -113,7 +114,7 @@ public interface LinphoneAccountCreator {
|
|||
String getHa1();
|
||||
|
||||
Status setActivationCode(String activationCode);
|
||||
|
||||
|
||||
Status setLanguage(String lang);
|
||||
|
||||
Status setTransport(TransportType transport);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue