mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-06 21:33:08 +00:00
remote_provisioning.c: modify linphone_core_set_provisioning_uri to return -1 if URI cannot be parsed, 0 otherwise
This commit is contained in:
parent
f0b9d0fffe
commit
1d85405c45
2 changed files with 12 additions and 4 deletions
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue