remote_provisioning.c: modify linphone_core_set_provisioning_uri to return -1...

remote_provisioning.c: modify linphone_core_set_provisioning_uri to return -1 if URI cannot be parsed, 0 otherwise
parent f0b9d0ff
......@@ -3926,10 +3926,11 @@ typedef void (*ContactSearchCallback)( LinphoneContactSearch* id, MSList* friend
* Calling this function does not load the configuration. It will write the value into configuration so that configuration
* from remote URI will take place at next LinphoneCore start.
* @param lc the linphone core
* @param uri the http or https uri to use in order to download the configuration.
* @param uri the http or https uri to use in order to download the configuration. Passing NULL will disable remote provisionning.
* @return -1 if uri could not be parsed, 0 otherwise. Note that this does not check validity of URI endpoint nor scheme and download may still fail.
* @ingroup initializing
**/
LINPHONE_PUBLIC void linphone_core_set_provisioning_uri(LinphoneCore *lc, const char*uri);
LINPHONE_PUBLIC int linphone_core_set_provisioning_uri(LinphoneCore *lc, const char*uri);
/**
* Get provisioning URI.
......
......@@ -129,8 +129,15 @@ int linphone_remote_provisioning_download_and_apply(LinphoneCore *lc, const char
}
}
void linphone_core_set_provisioning_uri(LinphoneCore *lc, const char *uri) {
lp_config_set_string(lc->config,"misc","config-uri",uri);
int linphone_core_set_provisioning_uri(LinphoneCore *lc, const char *remote_provisioning_uri) {
belle_generic_uri_t *uri=remote_provisioning_uri?belle_generic_uri_parse(remote_provisioning_uri):NULL;
if (!remote_provisioning_uri||uri) {
lp_config_set_string(lc->config,"misc","config-uri",remote_provisioning_uri);
return 0;
}
ms_error("Invalid provisioning URI [%s] (could not be parsed)",remote_provisioning_uri);
return -1;
}
const char*linphone_core_get_provisioning_uri(const LinphoneCore *lc){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment