Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
24ead1f2
Commit
24ead1f2
authored
Feb 28, 2014
by
Sylvain Berfini
Browse files
Added option to remove provisioning uri once it has been successfully applied
parent
9915ab66
Changes
5
Hide whitespace changes
Inline
Side-by-side
coreapi/linphonecore.c
View file @
24ead1f2
...
...
@@ -1270,6 +1270,11 @@ void linphone_configuring_terminated(LinphoneCore *lc, LinphoneConfiguringState
if
(
lc
->
vtable
.
configuring_status
)
lc
->
vtable
.
configuring_status
(
lc
,
state
,
message
);
if
(
state
==
LinphoneConfiguringSuccessful
)
{
if
(
linphone_core_is_provisioning_transient
(
lc
)
==
TRUE
)
linphone_core_set_provisioning_uri
(
lc
,
NULL
);
}
linphone_core_start
(
lc
);
}
...
...
coreapi/linphonecore.h
View file @
24ead1f2
...
...
@@ -2309,6 +2309,12 @@ LINPHONE_PUBLIC void linphone_core_set_provisioning_uri(LinphoneCore *lc, const
**/
LINPHONE_PUBLIC
const
char
*
linphone_core_get_provisioning_uri
(
const
LinphoneCore
*
lc
);
/**
* Gets if the provisioning URI should be removed after it's been applied successfully
* @param lc the linphone core
* @return TRUE if the provisioning URI should be removed, FALSE otherwise
*/
LINPHONE_PUBLIC
bool_t
linphone_core_is_provisioning_transient
(
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
int
linphone_core_migrate_to_multi_transport
(
LinphoneCore
*
lc
);
#ifdef __cplusplus
...
...
coreapi/remote_provisioning.c
View file @
24ead1f2
...
...
@@ -99,12 +99,14 @@ int linphone_remote_provisioning_download_and_apply(LinphoneCore *lc, const char
return
0
;
}
void
linphone_core_set_provisioning_uri
(
LinphoneCore
*
lc
,
const
char
*
uri
){
if
(
linphone_core_ready
(
lc
)){
lp_config_set_string
(
lc
->
config
,
"misc"
,
"config-uri"
,
uri
);
}
void
linphone_core_set_provisioning_uri
(
LinphoneCore
*
lc
,
const
char
*
uri
)
{
lp_config_set_string
(
lc
->
config
,
"misc"
,
"config-uri"
,
uri
);
}
const
char
*
linphone_core_get_provisioning_uri
(
const
LinphoneCore
*
lc
){
return
lp_config_get_string
(
lc
->
config
,
"misc"
,
"config-uri"
,
NULL
);
}
bool_t
linphone_core_is_provisioning_transient
(
LinphoneCore
*
lc
)
{
return
lp_config_get_int
(
lc
->
config
,
"misc"
,
"transient_provisioning"
,
0
)
==
1
;
}
tester/rcfiles/marie_transient_remote_rc
0 → 100644
View file @
24ead1f2
[misc]
config-uri=http://smtp.linphone.org/marie_transient_xml
tester/remote_provisioning_tester.c
View file @
24ead1f2
...
...
@@ -48,6 +48,15 @@ static void remote_provisioning_http(void) {
linphone_core_manager_destroy
(
marie
);
}
static
void
remote_provisioning_transient
(
void
)
{
LinphoneCoreManager
*
marie
=
linphone_core_manager_new2
(
"marie_transient_remote_rc"
,
FALSE
);
CU_ASSERT_TRUE
(
wait_for
(
marie
->
lc
,
NULL
,
&
marie
->
stat
.
number_of_LinphoneConfiguringSuccessful
,
1
));
CU_ASSERT_TRUE
(
wait_for
(
marie
->
lc
,
NULL
,
&
marie
->
stat
.
number_of_LinphoneRegistrationOk
,
1
));
CU_ASSERT_TRUE
(
linphone_core_is_provisioning_transient
(
marie
->
lc
)
==
TRUE
);
CU_ASSERT_TRUE
(
linphone_core_get_provisioning_uri
(
marie
->
lc
)
==
NULL
);
linphone_core_manager_destroy
(
marie
);
}
static
void
remote_provisioning_https
(
void
)
{
LinphoneCoreManager
*
marie
=
linphone_core_manager_new2
(
"marie_remote_https_rc"
,
FALSE
);
CU_ASSERT_TRUE
(
wait_for
(
marie
->
lc
,
NULL
,
&
marie
->
stat
.
number_of_LinphoneConfiguringSuccessful
,
1
));
...
...
@@ -72,7 +81,8 @@ test_t remote_provisioning_tests[] = {
{
"Remote provisioning successful behind http"
,
remote_provisioning_http
},
{
"Remote provisioning successful behind https"
,
remote_provisioning_https
},
{
"Remote provisioning 404 not found"
,
remote_provisioning_not_found
},
{
"Remote provisioning invalid"
,
remote_provisioning_invalid
}
{
"Remote provisioning invalid"
,
remote_provisioning_invalid
},
{
"Remote provisioning transient successful"
,
remote_provisioning_transient
}
};
test_suite_t
remote_provisioning_test_suite
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment