Commit 0408a776 authored by Ghislain MARY's avatar Ghislain MARY

Load user DNS hosts file for tests.

parent 169cbaac
......@@ -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);
......
127.0.0.1 sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org
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