]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_spandsp] set fax_trace_file channel var if a trace file is opened
authorChris Rienzo <chris@signalwire.com>
Fri, 31 Jul 2020 14:06:06 +0000 (14:06 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:35 +0000 (22:00 +0300)
src/mod/applications/mod_spandsp/mod_spandsp_fax.c

index 4f5d825a36fc06f1e958b643537c1fee28ff69d7..7997c6752dd5780ddbc712c08231a3712e741e87 100644 (file)
@@ -1420,6 +1420,9 @@ static pvt_t *pvt_init(switch_core_session_t *session, mod_spandsp_fax_applicati
                const char *trace_filename = switch_core_session_sprintf(session, "%s"SWITCH_PATH_SEPARATOR"fax-%s.log", tmp, switch_core_session_get_uuid(session));
                switch_dir_make_recursive(tmp, SWITCH_DEFAULT_DIR_PERMS, switch_core_session_get_pool(session));
                pvt->trace_file = fopen(trace_filename, "w");
+               if (pvt->trace_file) {
+                       switch_channel_set_variable(channel, "fax_trace_file", trace_filename);
+               }
        }
 
        if ((tmp = switch_channel_get_variable(channel, "fax_force_caller"))) {