提交 f117151d authored 作者: Brian West's avatar Brian West

tweaks from agx

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9423 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 04855d3c
...@@ -40,14 +40,20 @@ SWITCH_MODULE_DEFINITION(mod_fax, mod_fax_load, NULL, NULL); ...@@ -40,14 +40,20 @@ SWITCH_MODULE_DEFINITION(mod_fax, mod_fax_load, NULL, NULL);
static void phase_e_handler(t30_state_t *s, void *user_data, int result) static void phase_e_handler(t30_state_t *s, void *user_data, int result)
{ {
t30_stats_t t; t30_stats_t t;
char local_ident[21]; const char *local_ident = NULL;
char far_ident[21]; const char *far_ident = NULL;
if (result == T30_ERR_OK) if (result == T30_ERR_OK)
{ {
t30_get_transfer_statistics(s, &t); t30_get_transfer_statistics(s, &t);
t30_get_far_ident(s, far_ident); far_ident = t30_get_tx_ident(s);
t30_get_local_ident(s, local_ident); if (!switch_strlen_zero(far_ident)) {
far_ident = "";
}
local_ident = t30_get_rx_ident(s);
if (!switch_strlen_zero(local_ident)) {
local_ident = "";
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fax successfully received.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fax successfully received.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Remote station id: %s\n", far_ident); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Remote station id: %s\n", far_ident);
...@@ -65,7 +71,7 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result) ...@@ -65,7 +71,7 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)
} }
} }
static void phase_d_handler(t30_state_t *s, void *user_data, int result) static int phase_d_handler(t30_state_t *s, void *user_data, int result)
{ {
t30_stats_t t; t30_stats_t t;
...@@ -83,6 +89,7 @@ static void phase_d_handler(t30_state_t *s, void *user_data, int result) ...@@ -83,6 +89,7 @@ static void phase_d_handler(t30_state_t *s, void *user_data, int result)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Image size (bytes) %i\n", t.image_size); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Image size (bytes) %i\n", t.image_size);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
} }
return T30_ERR_OK;
} }
SWITCH_STANDARD_APP(rxfax_function) SWITCH_STANDARD_APP(rxfax_function)
...@@ -140,8 +147,8 @@ SWITCH_STANDARD_APP(rxfax_function) ...@@ -140,8 +147,8 @@ SWITCH_STANDARD_APP(rxfax_function)
} }
fax_init(&fax, calling_party); fax_init(&fax, calling_party);
t30_set_local_ident(&fax.t30_state, "test"); t30_set_tx_ident(&fax.t30_state, "test");
t30_set_header_info(&fax.t30_state, "test"); t30_set_tx_page_header_info(&fax.t30_state, "test");
t30_set_rx_file(&fax.t30_state, file_name, -1); t30_set_rx_file(&fax.t30_state, file_name, -1);
t30_set_phase_d_handler(&fax.t30_state, phase_d_handler, NULL); t30_set_phase_d_handler(&fax.t30_state, phase_d_handler, NULL);
...@@ -202,7 +209,6 @@ SWITCH_STANDARD_APP(rxfax_function) ...@@ -202,7 +209,6 @@ SWITCH_STANDARD_APP(rxfax_function)
} }
SWITCH_MODULE_LOAD_FUNCTION(mod_fax_load) SWITCH_MODULE_LOAD_FUNCTION(mod_fax_load)
{ {
switch_application_interface_t *app_interface; switch_application_interface_t *app_interface;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论