From ea58df8456e08751d534c05a974992ed8a4bfad8 Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Wed, 22 Aug 2012 22:25:54 +0800 Subject: [PATCH] Fixed Cairo's entry in the timezone files Changed mod_spandsp so it tries to resolve timezone names like Asia/HongKong to a POSIX timezone descriptor string, like other parts of FreeSwitch do. --- conf/curl/autoload_configs/timezones.conf.xml | 2 +- conf/insideout/autoload_configs/timezones.conf.xml | 2 +- conf/sbc/autoload_configs/timezones.conf.xml | 2 +- conf/vanilla/autoload_configs/timezones.conf.xml | 2 +- src/include/switch_core.h | 1 + src/mod/applications/mod_spandsp/mod_spandsp_fax.c | 9 +++++++-- src/switch_time.c | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/conf/curl/autoload_configs/timezones.conf.xml b/conf/curl/autoload_configs/timezones.conf.xml index 85c805ff25..397e9a979f 100644 --- a/conf/curl/autoload_configs/timezones.conf.xml +++ b/conf/curl/autoload_configs/timezones.conf.xml @@ -13,7 +13,7 @@ - + diff --git a/conf/insideout/autoload_configs/timezones.conf.xml b/conf/insideout/autoload_configs/timezones.conf.xml index 85c805ff25..397e9a979f 100644 --- a/conf/insideout/autoload_configs/timezones.conf.xml +++ b/conf/insideout/autoload_configs/timezones.conf.xml @@ -13,7 +13,7 @@ - + diff --git a/conf/sbc/autoload_configs/timezones.conf.xml b/conf/sbc/autoload_configs/timezones.conf.xml index 85c805ff25..397e9a979f 100644 --- a/conf/sbc/autoload_configs/timezones.conf.xml +++ b/conf/sbc/autoload_configs/timezones.conf.xml @@ -13,7 +13,7 @@ - + diff --git a/conf/vanilla/autoload_configs/timezones.conf.xml b/conf/vanilla/autoload_configs/timezones.conf.xml index 85c805ff25..397e9a979f 100644 --- a/conf/vanilla/autoload_configs/timezones.conf.xml +++ b/conf/vanilla/autoload_configs/timezones.conf.xml @@ -13,7 +13,7 @@ - + diff --git a/src/include/switch_core.h b/src/include/switch_core.h index 1fda42588c..67ae2727aa 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -2131,6 +2131,7 @@ SWITCH_DECLARE(void) switch_time_sync(void); \return The current epoch time */ SWITCH_DECLARE(time_t) switch_epoch_time_now(time_t *t); +SWITCH_DECLARE(const char *) switch_lookup_timezone(const char *tz_name); SWITCH_DECLARE(switch_status_t) switch_strftime_tz(const char *tz, const char *format, char *date, size_t len, switch_time_t thetime); SWITCH_DECLARE(switch_status_t) switch_time_exp_tz_name(const char *tz, switch_time_exp_t *tm, switch_time_t thetime); SWITCH_DECLARE(void) switch_load_network_lists(switch_bool_t reload); diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c index 0b8f5d4f61..c15f9afe67 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c @@ -674,6 +674,7 @@ static switch_status_t spanfax_init(pvt_t *pvt, transport_mode_t trans_mode) t38_terminal_state_t *t38; t30_state_t *t30; const char *tmp; + const char *tz; int fec_entries = DEFAULT_FEC_ENTRIES; int fec_span = DEFAULT_FEC_SPAN; @@ -844,8 +845,12 @@ static switch_status_t spanfax_init(pvt_t *pvt, transport_mode_t trans_mode) /* All the things which are common to audio and T.38 FAX setup */ t30_set_tx_ident(t30, pvt->ident); t30_set_tx_page_header_info(t30, pvt->header); - if (pvt->timezone && pvt->timezone[0]) - t30_set_tx_page_header_tz(t30, pvt->timezone); + if (pvt->timezone && pvt->timezone[0]) { + if ((tz = switch_lookup_timezone(pvt->timezone))) + t30_set_tx_page_header_tz(t30, tz); + else + t30_set_tx_page_header_tz(t30, pvt->timezone); + } t30_set_phase_e_handler(t30, phase_e_handler, pvt); t30_set_phase_d_handler(t30, phase_d_handler, pvt); diff --git a/src/switch_time.c b/src/switch_time.c index 96e4ec9937..fb9fea1de0 100644 --- a/src/switch_time.c +++ b/src/switch_time.c @@ -1110,7 +1110,7 @@ typedef struct { static switch_timezones_list_t TIMEZONES_LIST = { 0 }; static switch_event_node_t *NODE = NULL; -const char *switch_lookup_timezone(const char *tz_name) +SWITCH_DECLARE(const char *) switch_lookup_timezone(const char *tz_name) { char *value = NULL;