mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 03:58:08 +00:00
Load user DNS hosts file for tests.
This commit is contained in:
parent
169cbaac09
commit
0408a776e4
4 changed files with 21 additions and 3 deletions
|
|
@ -683,6 +683,14 @@ int sal_get_dns_timeout(const Sal* sal) {
|
|||
return belle_sip_stack_get_dns_timeout(sal->stack);
|
||||
}
|
||||
|
||||
void sal_set_dns_user_hosts_file(Sal *sal, const char *hosts_file) {
|
||||
belle_sip_stack_set_dns_user_hosts_file(sal->stack, hosts_file);
|
||||
}
|
||||
|
||||
const char * sal_get_dns_user_hosts_file(const Sal *sal) {
|
||||
return belle_sip_stack_get_dns_user_hosts_file(sal->stack);
|
||||
}
|
||||
|
||||
SalAuthInfo* sal_auth_info_create(belle_sip_auth_event_t* event) {
|
||||
SalAuthInfo* auth_info = sal_auth_info_new();
|
||||
auth_info->realm = ms_strdup(belle_sip_auth_event_get_realm(event)) ;
|
||||
|
|
|
|||
|
|
@ -569,5 +569,7 @@ void sal_nat_helper_enable(Sal *sal,bool_t enable);
|
|||
bool_t sal_nat_helper_enabled(Sal *sal);
|
||||
|
||||
LINPHONE_PUBLIC void sal_set_dns_timeout(Sal* sal,int timeout);
|
||||
int sal_get_dns_timeout(const Sal* sal);
|
||||
LINPHONE_PUBLIC int sal_get_dns_timeout(const Sal* sal);
|
||||
LINPHONE_PUBLIC void sal_set_dns_user_hosts_file(Sal *sal, const char *hosts_file);
|
||||
LINPHONE_PUBLIC const char *sal_get_dns_user_hosts_file(const Sal *sal);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ const char *liblinphone_tester_file_prefix="Assets";
|
|||
const char *liblinphone_tester_file_prefix="./tester";
|
||||
#endif
|
||||
|
||||
const char *userhostsfile = "tester_hosts";
|
||||
|
||||
#ifdef ANDROID
|
||||
extern void AndroidPrintf(FILE *stream, const char *fmt, ...);
|
||||
#define fprintf(file, fmt, ...) AndroidPrintf(file, fmt, ##__VA_ARGS__)
|
||||
|
|
@ -109,16 +111,21 @@ LinphoneCore* configure_lc_from(LinphoneCoreVTable* v_table, const char* path, c
|
|||
char ringpath[256];
|
||||
char ringbackpath[256];
|
||||
char rootcapath[256];
|
||||
char dnsuserhostspath[256];
|
||||
|
||||
sprintf(filepath, "%s/%s", path, file);
|
||||
lc = linphone_core_new(v_table,NULL,filepath,NULL);
|
||||
linphone_core_set_user_data(lc,&global_stat);
|
||||
counters = (stats*)linphone_core_get_user_data(lc);
|
||||
|
||||
|
||||
/* until we have good certificates on our test server...
|
||||
linphone_core_verify_server_certificates(lc,FALSE);*/
|
||||
sprintf(rootcapath, "%s/certificates/cacert.pem", path);
|
||||
linphone_core_set_root_ca(lc,rootcapath);
|
||||
|
||||
|
||||
sprintf(dnsuserhostspath, "%s/%s", path, userhostsfile);
|
||||
sal_set_dns_user_hosts_file(lc->sal, dnsuserhostspath);
|
||||
|
||||
sprintf(ringpath, "%s/%s", path, "oldphone.wav");
|
||||
sprintf(ringbackpath, "%s/%s", path, "ringback.wav");
|
||||
linphone_core_set_ring(lc, ringpath);
|
||||
|
|
|
|||
1
tester/tester_hosts
Normal file
1
tester/tester_hosts
Normal file
|
|
@ -0,0 +1 @@
|
|||
127.0.0.1 sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org
|
||||
Loading…
Add table
Reference in a new issue