]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3757 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 13 Dec 2011 14:43:49 +0000 (08:43 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 13 Dec 2011 14:43:49 +0000 (08:43 -0600)
src/mod/applications/mod_spandsp/mod_spandsp.c
src/mod/applications/mod_spandsp/mod_spandsp.h
src/mod/applications/mod_spandsp/mod_spandsp_fax.c

index aa9d434868070ec1d63363f99ca22b532630dba1..8c64d78ddca69e7ba98285b5cf94aa87b34b0b07 100644 (file)
@@ -334,6 +334,7 @@ switch_status_t load_configuration(switch_bool_t reload)
        spandsp_globals.spool = switch_core_strdup(spandsp_globals.config_pool, "/tmp");
     spandsp_globals.ident = "SpanDSP Fax Ident";
     spandsp_globals.header = "SpanDSP Fax Header";
+    spandsp_globals.timezone = "";
 
        /* TODO make configuration param */
        spandsp_globals.tonedebug = 1;
index 8c907c75ac827ae4b2baa664354a1d34cdf5d213..4acef0796cde701e041e0cb26dd2ec9353194569 100644 (file)
@@ -62,6 +62,7 @@ struct spandsp_globals {
     short int enable_t38_insist;
        char *ident;
        char *header;
+       char *timezone;
        char *prepend_string;
        char *spool;
        switch_thread_cond_t *cond;
index 821b2c265e61b92688ff3e6a2c6b899881222387..a9ccbbf071ad8324487020896a0b6b88a3a89c56 100644 (file)
@@ -83,6 +83,7 @@ struct pvt_s {
        char *filename;
        char *ident;
        char *header;
+       char *timezone;
 
        int use_ecm;
        int disable_v17;
@@ -830,6 +831,8 @@ 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);
 
        t30_set_phase_e_handler(t30, phase_e_handler, pvt);
        t30_set_phase_d_handler(t30, phase_d_handler, pvt);
@@ -1206,6 +1209,18 @@ static pvt_t *pvt_init(switch_core_session_t *session, mod_spandsp_fax_applicati
                pvt->header = switch_core_session_strdup(session, spandsp_globals.header);
        }
 
+       if ((tmp = switch_channel_get_variable(channel, "fax_timezone"))) {
+        char *data = NULL;
+
+        data = strdup(tmp);
+        switch_url_decode(data);
+        pvt->timezone = switch_core_session_strdup(session, data);
+
+        switch_safe_free(data);
+       } else {
+               pvt->timezone = switch_core_session_strdup(session, spandsp_globals.timezone);
+       }
+
        if (pvt->app_mode == FUNCTION_TX) {
                if ((tmp = switch_channel_get_variable(channel, "fax_start_page"))) {
                        pvt->tx_page_start = atoi(tmp);