Tweaks to the T.31 modem

This commit is contained in:
Steve Underwood 2012-12-09 13:59:26 +08:00
parent 8aecffef50
commit bfc3c17bcb
1 changed files with 30 additions and 23 deletions

View File

@ -216,6 +216,7 @@ switch_status_t modem_init(modem_t *modem, modem_control_handler_t control_handl
#ifdef WIN32 #ifdef WIN32
COMMTIMEOUTS timeouts = {0}; COMMTIMEOUTS timeouts = {0};
#endif #endif
logging_state_t *logging;
memset(modem, 0, sizeof(*modem)); memset(modem, 0, sizeof(*modem));
@ -239,7 +240,7 @@ switch_status_t modem_init(modem_t *modem, modem_control_handler_t control_handl
modem->stty = ttyname(modem->slave); modem->stty = ttyname(modem->slave);
} }
#else #else
#if WIN32 #ifdef WIN32
modem->slot = 4+globals.NEXT_ID++; /* need work here we start at COM4 for now*/ modem->slot = 4+globals.NEXT_ID++; /* need work here we start at COM4 for now*/
snprintf(modem->devlink, sizeof(modem->devlink), "COM%d", modem->slot); snprintf(modem->devlink, sizeof(modem->devlink), "COM%d", modem->slot);
@ -347,15 +348,21 @@ switch_status_t modem_init(modem_t *modem, modem_control_handler_t control_handl
} }
if (spandsp_globals.modem_verbose) { if (spandsp_globals.modem_verbose) {
span_log_set_message_handler(&modem->t31_state->logging, spanfax_log_message, NULL); logging = t31_get_logging_state(modem->t31_state);
span_log_set_message_handler(&modem->t31_state->audio.modems.fast_modems.v17_rx.logging, spanfax_log_message, NULL); span_log_set_message_handler(logging, spanfax_log_message, NULL);
span_log_set_message_handler(&modem->t31_state->audio.modems.fast_modems.v29_rx.logging, spanfax_log_message, NULL); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_message_handler(&modem->t31_state->audio.modems.fast_modems.v27ter_rx.logging, spanfax_log_message, NULL);
modem->t31_state->logging.level = SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW; logging = v17_rx_get_logging_state(&modem->t31_state->audio.modems.fast_modems.v17_rx);
modem->t31_state->audio.modems.fast_modems.v17_rx.logging.level = SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW; span_log_set_message_handler(logging, spanfax_log_message, NULL);
modem->t31_state->audio.modems.fast_modems.v29_rx.logging.level = SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW; span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
modem->t31_state->audio.modems.fast_modems.v27ter_rx.logging.level = SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW;
logging = v29_rx_get_logging_state(&modem->t31_state->audio.modems.fast_modems.v29_rx);
span_log_set_message_handler(logging, spanfax_log_message, NULL);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
logging = v27ter_rx_get_logging_state(&modem->t31_state->audio.modems.fast_modems.v27ter_rx);
span_log_set_message_handler(logging, spanfax_log_message, NULL);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
} }
modem->control_handler = control_handler; modem->control_handler = control_handler;