[Freeswitch-svn] [commit] r9442 - freeswitch/trunk/src/mod/applications/mod_fax
Freeswitch SVN
agx at freeswitch.org
Thu Sep 4 08:07:55 EDT 2008
Author: agx
Date: Thu Sep 4 08:07:55 2008
New Revision: 9442
Modified:
freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c
Log:
both rxfax and txfax now answer the channell correctly
Modified: freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c Thu Sep 4 08:07:55 2008
@@ -152,17 +152,9 @@
if (result == T30_ERR_OK) {
t30_get_transfer_statistics(s, &t);
- far_ident = t30_get_tx_ident(s);
-
- if (!switch_strlen_zero(far_ident)) {
- far_ident = "";
- }
-
- local_ident = t30_get_rx_ident(s);
-
- if (!switch_strlen_zero(local_ident)) {
- local_ident = "";
- }
+
+ far_ident = switch_str_nil( t30_get_tx_ident(s) );
+ local_ident = switch_str_nil( t30_get_rx_ident(s) );
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
//TODO: add received/transmitted ?
@@ -243,6 +235,10 @@
const char *fax_local_ecm = NULL;
const char *fax_local_v17 = NULL;
+ /* make sure we have a valid channel when starting the FAX application */
+ channel = switch_core_session_get_channel(session);
+ switch_assert(channel != NULL);
+
/* set output varialbles to a reasonable result */
switch_channel_set_variable(channel, "FAX_REMOTESTATIONID", "unknown");
switch_channel_set_variable(channel, "FAX_PAGES", "0");
@@ -270,7 +266,7 @@
/* file_name - Sets the TIFF filename where do you want to save the fax */
file_name = switch_core_session_strdup(session, data);
/* it is important that file_name is not NULL or an empty string */
- if (!switch_strlen_zero(file_name)) {
+ if (switch_strlen_zero(file_name)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "fax filename is NULL or empty string\n");
return;
}
@@ -339,10 +335,6 @@
/* We're now ready to answer the channel and process the audio of the call */
- /* make sure we have a valid channel when starting the FAX application */
- channel = switch_core_session_get_channel(session);
- switch_assert(channel != NULL);
-
/* Answer the call, otherwise we're not getting incoming audio */
switch_channel_answer(channel);
More information about the Freeswitch-svn
mailing list