diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index 91c004962..960a50254 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -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)) ; diff --git a/include/sal/sal.h b/include/sal/sal.h index 38610ac35..051f06482 100644 --- a/include/sal/sal.h +++ b/include/sal/sal.h @@ -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 diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index 185ce9587..1bd9e0ff7 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -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); diff --git a/tester/tester_hosts b/tester/tester_hosts new file mode 100644 index 000000000..9cd7f20f4 --- /dev/null +++ b/tester/tester_hosts @@ -0,0 +1 @@ +127.0.0.1 sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org