mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
Add test for tunnel without SIP case
This commit is contained in:
parent
d76cb1342b
commit
0332ac71fa
1 changed files with 9 additions and 3 deletions
|
|
@ -59,7 +59,7 @@ static char* get_public_contact_ip(LinphoneCore* lc) {
|
|||
ms_free(contact);
|
||||
return ms_strdup(contact_host_ip);
|
||||
}
|
||||
static void call_with_transport_base(bool_t use_tunnel, LinphoneMediaEncryption encryption) {
|
||||
static void call_with_transport_base(bool_t use_tunnel, bool_t with_sip, LinphoneMediaEncryption encryption) {
|
||||
if (linphone_core_tunnel_available()){
|
||||
char *tmp_char;
|
||||
LinphoneCoreManager *pauline = linphone_core_manager_new( "pauline_rc");
|
||||
|
|
@ -92,6 +92,7 @@ static void call_with_transport_base(bool_t use_tunnel, LinphoneMediaEncryption
|
|||
linphone_proxy_config_set_route(proxy, tmp_char);
|
||||
ms_free(tmp_char);
|
||||
linphone_tunnel_set_mode(tunnel, LinphoneTunnelModeEnable);
|
||||
if(with_sip) linphone_tunnel_enable_sip(tunnel, with_sip);
|
||||
linphone_tunnel_config_set_host(config, "tunnel.linphone.org");
|
||||
linphone_tunnel_config_set_port(config, 443);
|
||||
linphone_tunnel_add_server(tunnel, config);
|
||||
|
|
@ -130,16 +131,21 @@ static void call_with_transport_base(bool_t use_tunnel, LinphoneMediaEncryption
|
|||
}
|
||||
|
||||
static void call_with_tunnel(void) {
|
||||
call_with_transport_base(TRUE,LinphoneMediaEncryptionNone);
|
||||
call_with_transport_base(TRUE, TRUE, LinphoneMediaEncryptionNone);
|
||||
}
|
||||
|
||||
static void call_with_tunnel_srtp(void) {
|
||||
call_with_transport_base(TRUE,LinphoneMediaEncryptionSRTP);
|
||||
call_with_transport_base(TRUE, TRUE, LinphoneMediaEncryptionSRTP);
|
||||
}
|
||||
|
||||
static void call_with_tunnel_without_sip(void) {
|
||||
call_with_transport_base(TRUE, FALSE, LinphoneMediaEncryptionNone);
|
||||
}
|
||||
|
||||
test_t transport_tests[] = {
|
||||
{ "Tunnel only", call_with_tunnel },
|
||||
{ "Tunnel with SRTP", call_with_tunnel_srtp },
|
||||
{ "Tunnel without SIP", call_with_tunnel_without_sip }
|
||||
};
|
||||
|
||||
test_suite_t transport_test_suite = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue