From 3b964e9a572e9bfb1e943ec03378448d75325f54 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 4 Sep 2008 09:59:55 +0000 Subject: [PATCH] improved phase_b_handler git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9436 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_fax/mod_fax.c | 31 +++++++++++--------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/mod/applications/mod_fax/mod_fax.c b/src/mod/applications/mod_fax/mod_fax.c index 50f747aa2b..6f4101059c 100644 --- a/src/mod/applications/mod_fax/mod_fax.c +++ b/src/mod/applications/mod_fax/mod_fax.c @@ -46,10 +46,12 @@ static void span_message(int level, const char *msg) { int fs_log_level; - // TODO: maybe is better to use switch_assert here? + /* TODO: maybe is better to use switch_assert here? if (msg==NULL) { return; } + */ + switch_assert(msg!=NULL); switch (level) { @@ -85,25 +87,18 @@ static void span_message(int level, const char *msg) static int phase_b_handler(t30_state_t *s, void *user_data, int result) { int session; + const char *u = NULL; switch_assert(user_data != NULL); session = (intptr_t) user_data; - /* TODO */ - #if TODO - if ((u = t30_get_rx_ident(s))) - printf("%d: Phase B: remote ident '%s'\n", i, u); - if ((u = t30_get_rx_sub_address(s))) - printf("%d: Phase B: remote sub-address '%s'\n", i, u); - if ((u = t30_get_rx_polled_sub_address(s))) - printf("%d: Phase B: remote polled sub-address '%s'\n", i, u); - if ((u = t30_get_rx_selective_polling_address(s))) - printf("%d: Phase B: remote selective polling address '%s'\n", i, u); - if ((u = t30_get_rx_sender_ident(s))) - printf("%d: Phase B: remote sender ident '%s'\n", i, u); - if ((u = t30_get_rx_password(s))) - printf("%d: Phase B: remote password '%s'\n", i, u); - printf("%d: Phase B handler on channel %d - (0x%X) %s\n", i, i, result, t30_frametype(result)); - #endif - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Phase B handler on session %d - (0x%X) %s\n", session, result, t30_frametype(result)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Phase B: handler on session %d - (0x%X) %s\n", session, result, t30_frametype(result)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "remote ident: %s\n", t30_get_rx_ident(s)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "remote sub-address: %s\n", t30_get_rx_sub_address(s)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "remote polled sub-address: %s\n", t30_get_rx_polled_sub_address(s)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "remote sel. polling addr.: %s\n", t30_get_rx_selective_polling_address(s)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "remote sender ident: %s\n", t30_get_rx_sender_ident(s)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "remote password: %s\n", t30_get_rx_password(s)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n"); return T30_ERR_OK; };