mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
Changed spandsp from using TRUE and FALSE to using C99 true and false. It seems
like the quirks we used to get using those with C++ have gone away.
This commit is contained in:
@@ -42,6 +42,11 @@
|
||||
#if defined(HAVE_MATH_H)
|
||||
#include <math.h>
|
||||
#endif
|
||||
#if defined(HAVE_STDBOOL_H)
|
||||
#include <stdbool.h>
|
||||
#else
|
||||
#include "spandsp/stdbool.h"
|
||||
#endif
|
||||
#include "floating_fudge.h"
|
||||
#include <assert.h>
|
||||
#if defined(LOG_FAX_AUDIO)
|
||||
@@ -95,6 +100,7 @@
|
||||
|
||||
#include "spandsp/private/logging.h"
|
||||
#include "spandsp/private/silence_gen.h"
|
||||
#include "spandsp/private/power_meter.h"
|
||||
#include "spandsp/private/fsk.h"
|
||||
#include "spandsp/private/v17tx.h"
|
||||
#include "spandsp/private/v17rx.h"
|
||||
@@ -271,22 +277,22 @@ static int set_next_tx_type(t38_gateway_state_t *s)
|
||||
||
|
||||
t->tx_handler == (span_tx_handler_t) &tone_gen)
|
||||
{
|
||||
fax_modems_set_rx_active(t, TRUE);
|
||||
fax_modems_set_rx_active(t, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
fax_modems_set_rx_active(t, FALSE);
|
||||
fax_modems_set_rx_active(t, false);
|
||||
}
|
||||
/*endif*/
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
/*endif*/
|
||||
u = &s->core.hdlc_to_modem;
|
||||
if (u->in == u->out)
|
||||
return FALSE;
|
||||
return false;
|
||||
/*endif*/
|
||||
if ((u->buf[u->out].contents & FLAG_INDICATOR) == 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
/*endif*/
|
||||
indicator = (u->buf[u->out].contents & 0xFF);
|
||||
u->buf[u->out].len = 0;
|
||||
@@ -299,15 +305,15 @@ static int set_next_tx_type(t38_gateway_state_t *s)
|
||||
if (s->core.image_data_mode && s->core.ecm_mode)
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "HDLC mode\n");
|
||||
hdlc_tx_init(&t->hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s);
|
||||
hdlc_tx_init(&t->hdlc_tx, false, 2, true, hdlc_underflow_handler, s);
|
||||
fax_modems_set_get_bit(t, (get_bit_func_t) hdlc_tx_get_bit, &t->hdlc_tx);
|
||||
use_hdlc = TRUE;
|
||||
use_hdlc = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "Non-ECM mode\n");
|
||||
fax_modems_set_get_bit(t, (get_bit_func_t) t38_non_ecm_buffer_get_bit, &s->core.non_ecm_to_modem);
|
||||
use_hdlc = FALSE;
|
||||
use_hdlc = false;
|
||||
}
|
||||
/*endif*/
|
||||
switch (indicator)
|
||||
@@ -318,31 +324,31 @@ static int set_next_tx_type(t38_gateway_state_t *s)
|
||||
//silence_gen_set(&t->silence_gen, ms_to_samples(75));
|
||||
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
|
||||
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
|
||||
fax_modems_set_rx_active(t, TRUE);
|
||||
fax_modems_set_rx_active(t, true);
|
||||
break;
|
||||
case T38_IND_CNG:
|
||||
t->tx_bit_rate = 0;
|
||||
fax_modems_start_slow_modem(t, FAX_MODEM_CNG_TONE_TX);
|
||||
silence_gen_set(&t->silence_gen, 0);
|
||||
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
|
||||
fax_modems_set_rx_active(t, TRUE);
|
||||
fax_modems_set_rx_active(t, true);
|
||||
break;
|
||||
case T38_IND_CED:
|
||||
t->tx_bit_rate = 0;
|
||||
fax_modems_start_slow_modem(t, FAX_MODEM_CED_TONE_TX);
|
||||
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
|
||||
fax_modems_set_rx_active(t, TRUE);
|
||||
fax_modems_set_rx_active(t, true);
|
||||
break;
|
||||
case T38_IND_V21_PREAMBLE:
|
||||
t->tx_bit_rate = 300;
|
||||
hdlc_tx_init(&t->hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s);
|
||||
hdlc_tx_init(&t->hdlc_tx, false, 2, true, hdlc_underflow_handler, s);
|
||||
hdlc_tx_flags(&t->hdlc_tx, 32);
|
||||
silence_gen_alter(&t->silence_gen, ms_to_samples(75));
|
||||
u->buf[u->in].len = 0;
|
||||
fax_modems_start_slow_modem(t, FAX_MODEM_V21_TX);
|
||||
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
|
||||
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &fsk_tx, &t->v21_tx);
|
||||
fax_modems_set_rx_active(t, TRUE);
|
||||
fax_modems_set_rx_active(t, true);
|
||||
break;
|
||||
case T38_IND_V27TER_2400_TRAINING:
|
||||
case T38_IND_V27TER_4800_TRAINING:
|
||||
@@ -352,7 +358,7 @@ static int set_next_tx_type(t38_gateway_state_t *s)
|
||||
fax_modems_start_fast_modem(t, FAX_MODEM_V27TER_TX, bit_rate, s->core.short_train, use_hdlc);
|
||||
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
|
||||
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v27ter_tx, &t->fast_modems.v27ter_tx);
|
||||
fax_modems_set_rx_active(t, TRUE);
|
||||
fax_modems_set_rx_active(t, true);
|
||||
break;
|
||||
case T38_IND_V29_7200_TRAINING:
|
||||
case T38_IND_V29_9600_TRAINING:
|
||||
@@ -362,7 +368,7 @@ static int set_next_tx_type(t38_gateway_state_t *s)
|
||||
fax_modems_start_fast_modem(t, FAX_MODEM_V29_TX, bit_rate, s->core.short_train, use_hdlc);
|
||||
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
|
||||
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v29_tx, &t->fast_modems.v29_tx);
|
||||
fax_modems_set_rx_active(t, TRUE);
|
||||
fax_modems_set_rx_active(t, true);
|
||||
break;
|
||||
case T38_IND_V17_7200_SHORT_TRAINING:
|
||||
case T38_IND_V17_7200_LONG_TRAINING:
|
||||
@@ -372,32 +378,32 @@ static int set_next_tx_type(t38_gateway_state_t *s)
|
||||
case T38_IND_V17_12000_LONG_TRAINING:
|
||||
case T38_IND_V17_14400_SHORT_TRAINING:
|
||||
case T38_IND_V17_14400_LONG_TRAINING:
|
||||
short_train = FALSE;
|
||||
short_train = false;
|
||||
switch (indicator)
|
||||
{
|
||||
case T38_IND_V17_7200_SHORT_TRAINING:
|
||||
short_train = TRUE;
|
||||
short_train = true;
|
||||
bit_rate = 7200;
|
||||
break;
|
||||
case T38_IND_V17_7200_LONG_TRAINING:
|
||||
bit_rate = 7200;
|
||||
break;
|
||||
case T38_IND_V17_9600_SHORT_TRAINING:
|
||||
short_train = TRUE;
|
||||
short_train = true;
|
||||
bit_rate = 9600;
|
||||
break;
|
||||
case T38_IND_V17_9600_LONG_TRAINING:
|
||||
bit_rate = 9600;
|
||||
break;
|
||||
case T38_IND_V17_12000_SHORT_TRAINING:
|
||||
short_train = TRUE;
|
||||
short_train = true;
|
||||
bit_rate = 12000;
|
||||
break;
|
||||
case T38_IND_V17_12000_LONG_TRAINING:
|
||||
bit_rate = 12000;
|
||||
break;
|
||||
case T38_IND_V17_14400_SHORT_TRAINING:
|
||||
short_train = TRUE;
|
||||
short_train = true;
|
||||
bit_rate = 14400;
|
||||
break;
|
||||
case T38_IND_V17_14400_LONG_TRAINING:
|
||||
@@ -410,7 +416,7 @@ static int set_next_tx_type(t38_gateway_state_t *s)
|
||||
fax_modems_start_fast_modem(t, FAX_MODEM_V17_TX, bit_rate, short_train, use_hdlc);
|
||||
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
|
||||
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v17_tx, &t->fast_modems.v17_tx);
|
||||
fax_modems_set_rx_active(t, TRUE);
|
||||
fax_modems_set_rx_active(t, true);
|
||||
break;
|
||||
case T38_IND_V8_ANSAM:
|
||||
t->tx_bit_rate = 300;
|
||||
@@ -442,7 +448,7 @@ static int set_next_tx_type(t38_gateway_state_t *s)
|
||||
hdlc_tx_flags(&t->hdlc_tx, t->tx_bit_rate/(8*5));
|
||||
/*endif*/
|
||||
s->t38x.in_progress_rx_indicator = indicator;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -510,7 +516,7 @@ static void edit_control_messages(t38_gateway_state_t *s, int from_modem, uint8_
|
||||
processed, 2 machines which recognise each other might do special things
|
||||
we cannot handle as a middle man. */
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "Corrupting %s message to prevent recognition\n", t30_frametype(buf[2]));
|
||||
s->t38x.corrupt_current_frame[from_modem] = TRUE;
|
||||
s->t38x.corrupt_current_frame[from_modem] = true;
|
||||
}
|
||||
/*endif*/
|
||||
break;
|
||||
@@ -645,8 +651,8 @@ static void monitor_control_messages(t38_gateway_state_t *s,
|
||||
case T30_CFR:
|
||||
/* We are changing from TCF exchange to image exchange */
|
||||
/* Successful training means we should change to short training */
|
||||
s->core.image_data_mode = TRUE;
|
||||
s->core.short_train = TRUE;
|
||||
s->core.image_data_mode = true;
|
||||
s->core.short_train = true;
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "CFR - short train = %d, ECM = %d\n", s->core.short_train, s->core.ecm_mode);
|
||||
if (!from_modem)
|
||||
restart_rx_modem(s);
|
||||
@@ -655,14 +661,14 @@ static void monitor_control_messages(t38_gateway_state_t *s,
|
||||
case T30_RTN:
|
||||
case T30_RTP:
|
||||
/* We are going back to the exchange of fresh TCF */
|
||||
s->core.image_data_mode = FALSE;
|
||||
s->core.short_train = FALSE;
|
||||
s->core.image_data_mode = false;
|
||||
s->core.short_train = false;
|
||||
break;
|
||||
case T30_CTR:
|
||||
/* T.30 says the first image data after this does full training, yet does not
|
||||
return to TCF. This seems to be the sole case of long training for image
|
||||
data. */
|
||||
s->core.short_train = FALSE;
|
||||
s->core.short_train = false;
|
||||
break;
|
||||
case T30_DTC:
|
||||
case T30_DCS:
|
||||
@@ -671,8 +677,8 @@ static void monitor_control_messages(t38_gateway_state_t *s,
|
||||
correct modem. */
|
||||
s->core.fast_bit_rate = 0;
|
||||
s->core.fast_rx_modem = FAX_MODEM_NONE;
|
||||
s->core.image_data_mode = FALSE;
|
||||
s->core.short_train = FALSE;
|
||||
s->core.image_data_mode = false;
|
||||
s->core.short_train = false;
|
||||
if (from_modem)
|
||||
s->core.timed_mode = TIMED_MODE_TCF_PREDICTABLE_MODEM_START_BEGIN;
|
||||
/*endif*/
|
||||
@@ -722,13 +728,13 @@ static void monitor_control_messages(t38_gateway_state_t *s,
|
||||
the fast modem again, so abandon our idea of it. */
|
||||
s->core.fast_bit_rate = 0;
|
||||
s->core.fast_rx_modem = FAX_MODEM_NONE;
|
||||
s->core.image_data_mode = FALSE;
|
||||
s->core.short_train = FALSE;
|
||||
s->core.image_data_mode = false;
|
||||
s->core.short_train = false;
|
||||
#endif
|
||||
/* Fall through */
|
||||
case T30_MPS:
|
||||
case T30_PRI_MPS:
|
||||
s->core.count_page_on_mcf = TRUE;
|
||||
s->core.count_page_on_mcf = true;
|
||||
break;
|
||||
}
|
||||
/*endswitch*/
|
||||
@@ -748,15 +754,15 @@ static void monitor_control_messages(t38_gateway_state_t *s,
|
||||
the fast modem again, so abandon our idea of it. */
|
||||
s->core.fast_bit_rate = 0;
|
||||
s->core.fast_rx_modem = FAX_MODEM_NONE;
|
||||
s->core.image_data_mode = FALSE;
|
||||
s->core.short_train = FALSE;
|
||||
s->core.image_data_mode = false;
|
||||
s->core.short_train = false;
|
||||
#endif
|
||||
/* Fall through */
|
||||
case T30_MPS:
|
||||
case T30_MPS | 1:
|
||||
case T30_PRI_MPS:
|
||||
case T30_PRI_MPS | 1:
|
||||
s->core.count_page_on_mcf = TRUE;
|
||||
s->core.count_page_on_mcf = true;
|
||||
break;
|
||||
case T30_MCF:
|
||||
case T30_MCF | 1:
|
||||
@@ -764,7 +770,7 @@ static void monitor_control_messages(t38_gateway_state_t *s,
|
||||
{
|
||||
s->core.pages_confirmed++;
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "Pages confirmed = %d\n", s->core.pages_confirmed);
|
||||
s->core.count_page_on_mcf = FALSE;
|
||||
s->core.count_page_on_mcf = false;
|
||||
}
|
||||
/*endif*/
|
||||
break;
|
||||
@@ -1094,9 +1100,9 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
{
|
||||
if ((hdlc_buf->flags & HDLC_FLAG_MISSING_DATA) == 0)
|
||||
{
|
||||
monitor_control_messages(s, FALSE, hdlc_buf->buf, hdlc_buf->len);
|
||||
monitor_control_messages(s, false, hdlc_buf->buf, hdlc_buf->len);
|
||||
if (s->core.real_time_frame_handler)
|
||||
s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, FALSE, hdlc_buf->buf, hdlc_buf->len);
|
||||
s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, false, hdlc_buf->buf, hdlc_buf->len);
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
@@ -1107,11 +1113,11 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
long training. There has to be more than one value HDLC frame in a
|
||||
chunk of image data, so just setting short training mode here should
|
||||
be enough. */
|
||||
s->core.short_train = TRUE;
|
||||
s->core.short_train = true;
|
||||
}
|
||||
/*endif*/
|
||||
hdlc_buf->contents = (data_type | FLAG_DATA);
|
||||
finalise_hdlc_frame(s, TRUE);
|
||||
finalise_hdlc_frame(s, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1119,7 +1125,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
hdlc_buf->contents = 0;
|
||||
}
|
||||
/*endif*/
|
||||
xx->corrupt_current_frame[0] = FALSE;
|
||||
xx->corrupt_current_frame[0] = false;
|
||||
break;
|
||||
case T38_FIELD_HDLC_FCS_BAD:
|
||||
xx->current_rx_field_class = T38_FIELD_CLASS_HDLC;
|
||||
@@ -1145,7 +1151,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
}
|
||||
/*endif*/
|
||||
hdlc_buf->contents = (data_type | FLAG_DATA);
|
||||
finalise_hdlc_frame(s, FALSE);
|
||||
finalise_hdlc_frame(s, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1153,7 +1159,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
hdlc_buf->contents = 0;
|
||||
}
|
||||
/*endif*/
|
||||
xx->corrupt_current_frame[0] = FALSE;
|
||||
xx->corrupt_current_frame[0] = false;
|
||||
break;
|
||||
case T38_FIELD_HDLC_FCS_OK_SIG_END:
|
||||
xx->current_rx_field_class = T38_FIELD_CLASS_HDLC;
|
||||
@@ -1182,9 +1188,9 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
{
|
||||
if ((hdlc_buf->flags & HDLC_FLAG_MISSING_DATA) == 0)
|
||||
{
|
||||
monitor_control_messages(s, FALSE, hdlc_buf->buf, hdlc_buf->len);
|
||||
monitor_control_messages(s, false, hdlc_buf->buf, hdlc_buf->len);
|
||||
if (s->core.real_time_frame_handler)
|
||||
s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, FALSE, hdlc_buf->buf, hdlc_buf->len);
|
||||
s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, false, hdlc_buf->buf, hdlc_buf->len);
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
@@ -1195,11 +1201,11 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
long training. There has to be more than one value HDLC frame in a
|
||||
chunk of image data, so just setting short training mode here should
|
||||
be enough. */
|
||||
s->core.short_train = TRUE;
|
||||
s->core.short_train = true;
|
||||
}
|
||||
/*endif*/
|
||||
hdlc_buf->contents = (data_type | FLAG_DATA);
|
||||
finalise_hdlc_frame(s, TRUE);
|
||||
finalise_hdlc_frame(s, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1213,7 +1219,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
|
||||
}
|
||||
/*endif*/
|
||||
xx->corrupt_current_frame[0] = FALSE;
|
||||
xx->corrupt_current_frame[0] = false;
|
||||
break;
|
||||
case T38_FIELD_HDLC_FCS_BAD_SIG_END:
|
||||
xx->current_rx_field_class = T38_FIELD_CLASS_HDLC;
|
||||
@@ -1239,7 +1245,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
}
|
||||
/*endif*/
|
||||
hdlc_buf->contents = (data_type | FLAG_DATA);
|
||||
finalise_hdlc_frame(s, FALSE);
|
||||
finalise_hdlc_frame(s, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1253,7 +1259,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
|
||||
}
|
||||
/*endif*/
|
||||
xx->corrupt_current_frame[0] = FALSE;
|
||||
xx->corrupt_current_frame[0] = false;
|
||||
break;
|
||||
case T38_FIELD_HDLC_SIG_END:
|
||||
hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in];
|
||||
@@ -1299,7 +1305,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
|
||||
}
|
||||
/*endif*/
|
||||
xx->corrupt_current_frame[0] = FALSE;
|
||||
xx->corrupt_current_frame[0] = false;
|
||||
break;
|
||||
case T38_FIELD_T4_NON_ECM_DATA:
|
||||
if (xx->current_rx_field_class == T38_FIELD_CLASS_NONE)
|
||||
@@ -1315,7 +1321,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
if (len > 0)
|
||||
t38_non_ecm_buffer_inject(&s->core.non_ecm_to_modem, buf, len);
|
||||
/*endif*/
|
||||
xx->corrupt_current_frame[0] = FALSE;
|
||||
xx->corrupt_current_frame[0] = false;
|
||||
break;
|
||||
case T38_FIELD_T4_NON_ECM_SIG_END:
|
||||
if (xx->current_rx_field_class == T38_FIELD_CLASS_NONE)
|
||||
@@ -1370,7 +1376,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
|
||||
xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
|
||||
}
|
||||
/*endif*/
|
||||
xx->corrupt_current_frame[0] = FALSE;
|
||||
xx->corrupt_current_frame[0] = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1521,11 +1527,11 @@ static void non_ecm_rx_status(void *user_data, int status)
|
||||
break;
|
||||
case SIG_STATUS_TRAINING_SUCCEEDED:
|
||||
/* The modem is now trained */
|
||||
s->audio.modems.rx_signal_present = TRUE;
|
||||
s->audio.modems.rx_trained = TRUE;
|
||||
s->audio.modems.rx_signal_present = true;
|
||||
s->audio.modems.rx_trained = true;
|
||||
s->core.timed_mode = TIMED_MODE_IDLE;
|
||||
s->core.samples_to_timeout = 0;
|
||||
s->core.short_train = TRUE;
|
||||
s->core.short_train = true;
|
||||
to_t38_buffer_init(&s->core.to_t38);
|
||||
break;
|
||||
case SIG_STATUS_CARRIER_UP:
|
||||
@@ -1701,11 +1707,11 @@ static void hdlc_rx_status(hdlc_rx_state_t *t, int status)
|
||||
break;
|
||||
case SIG_STATUS_TRAINING_SUCCEEDED:
|
||||
/* The modem is now trained. */
|
||||
s->audio.modems.rx_signal_present = TRUE;
|
||||
s->audio.modems.rx_trained = TRUE;
|
||||
s->core.short_train = TRUE;
|
||||
s->audio.modems.rx_signal_present = true;
|
||||
s->audio.modems.rx_trained = true;
|
||||
s->core.short_train = true;
|
||||
/* Behave like HDLC preamble has been announced. */
|
||||
t->framing_ok_announced = TRUE;
|
||||
t->framing_ok_announced = true;
|
||||
to_t38_buffer_init(&s->core.to_t38);
|
||||
break;
|
||||
case SIG_STATUS_CARRIER_UP:
|
||||
@@ -1714,7 +1720,7 @@ static void hdlc_rx_status(hdlc_rx_state_t *t, int status)
|
||||
t->len = 0;
|
||||
t->num_bits = 0;
|
||||
t->flags_seen = 0;
|
||||
t->framing_ok_announced = FALSE;
|
||||
t->framing_ok_announced = false;
|
||||
to_t38_buffer_init(&s->core.to_t38);
|
||||
break;
|
||||
case SIG_STATUS_CARRIER_DOWN:
|
||||
@@ -1723,7 +1729,7 @@ static void hdlc_rx_status(hdlc_rx_state_t *t, int status)
|
||||
category = (s->t38x.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA_END : T38_PACKET_CATEGORY_IMAGE_DATA_END;
|
||||
t38_core_send_data(&s->t38x.t38, s->t38x.current_tx_data_type, T38_FIELD_HDLC_SIG_END, NULL, 0, category);
|
||||
t38_core_send_indicator(&s->t38x.t38, T38_IND_NO_SIGNAL);
|
||||
t->framing_ok_announced = FALSE;
|
||||
t->framing_ok_announced = false;
|
||||
}
|
||||
/*endif*/
|
||||
restart_rx_modem(s);
|
||||
@@ -1809,9 +1815,9 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "HDLC frame type %s, CRC OK\n", t30_frametype(t->buffer[2]));
|
||||
if (s->t38x.current_tx_data_type == T38_DATA_V21)
|
||||
{
|
||||
monitor_control_messages(s, TRUE, t->buffer, t->len - 2);
|
||||
monitor_control_messages(s, true, t->buffer, t->len - 2);
|
||||
if (s->core.real_time_frame_handler)
|
||||
s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, TRUE, t->buffer, t->len - 2);
|
||||
s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, true, t->buffer, t->len - 2);
|
||||
/*endif*/
|
||||
}
|
||||
else
|
||||
@@ -1819,7 +1825,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
|
||||
/* Make sure we go back to short training if CTC/CTR has kicked us into
|
||||
long training. Any successful HDLC frame received at a rate other than
|
||||
V.21 is an adequate indication we should change. */
|
||||
s->core.short_train = TRUE;
|
||||
s->core.short_train = true;
|
||||
}
|
||||
/*endif*/
|
||||
/* It seems some boxes may not like us sending a _SIG_END here, and then another
|
||||
@@ -1850,13 +1856,13 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
|
||||
if (s->t38x.current_tx_data_type == T38_DATA_V21)
|
||||
{
|
||||
t38_core_send_indicator(&s->t38x.t38, set_slow_packetisation(s));
|
||||
s->audio.modems.rx_signal_present = TRUE;
|
||||
s->audio.modems.rx_signal_present = true;
|
||||
}
|
||||
/*endif*/
|
||||
if (s->t38x.in_progress_rx_indicator == T38_IND_CNG)
|
||||
set_next_tx_type(s);
|
||||
/*endif*/
|
||||
t->framing_ok_announced = TRUE;
|
||||
t->framing_ok_announced = true;
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
@@ -1867,7 +1873,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
|
||||
t->num_bits = 0;
|
||||
u->crc = 0xFFFF;
|
||||
u->data_ptr = 0;
|
||||
s->t38x.corrupt_current_frame[1] = FALSE;
|
||||
s->t38x.corrupt_current_frame[1] = false;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -1962,9 +1968,9 @@ static int restart_rx_modem(t38_gateway_state_t *s)
|
||||
s->core.ecm_mode);
|
||||
|
||||
t = &s->audio.modems;
|
||||
hdlc_rx_init(&t->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, NULL, s);
|
||||
t->rx_signal_present = FALSE;
|
||||
t->rx_trained = FALSE;
|
||||
hdlc_rx_init(&t->hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, NULL, s);
|
||||
t->rx_signal_present = false;
|
||||
t->rx_trained = false;
|
||||
/* Default to the transmit data being V.21, unless a faster modem pops up trained. */
|
||||
s->t38x.current_tx_data_type = T38_DATA_V21;
|
||||
//fax_modems_start_slow_modem(t, FAX_MODEM_V21_RX);
|
||||
@@ -1987,13 +1993,13 @@ static int restart_rx_modem(t38_gateway_state_t *s)
|
||||
/*endif*/
|
||||
to_t38_buffer_init(&s->core.to_t38);
|
||||
s->core.to_t38.octets_per_data_packet = 1;
|
||||
t->deferred_rx_handler_updates = TRUE;
|
||||
t->deferred_rx_handler_updates = true;
|
||||
switch (s->core.fast_rx_modem)
|
||||
{
|
||||
case FAX_MODEM_V27TER_RX:
|
||||
case FAX_MODEM_V29_RX:
|
||||
case FAX_MODEM_V17_RX:
|
||||
fax_modems_start_fast_modem(t, s->core.fast_rx_modem, s->core.fast_bit_rate, s->core.short_train, FALSE);
|
||||
fax_modems_start_fast_modem(t, s->core.fast_rx_modem, s->core.fast_bit_rate, s->core.short_train, false);
|
||||
s->core.fast_rx_active = s->core.fast_rx_modem;
|
||||
break;
|
||||
case FAX_MODEM_V21_RX:
|
||||
@@ -2158,13 +2164,13 @@ SPAN_DECLARE(logging_state_t *) t38_gateway_get_logging_state(t38_gateway_state_
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, int ecm_allowed)
|
||||
SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, bool ecm_allowed)
|
||||
{
|
||||
s->core.ecm_allowed = ecm_allowed;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, int transmit_on_idle)
|
||||
SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, bool transmit_on_idle)
|
||||
{
|
||||
s->audio.modems.transmit_on_idle = transmit_on_idle;
|
||||
}
|
||||
@@ -2194,13 +2200,13 @@ SPAN_DECLARE(void) t38_gateway_set_nsx_suppression(t38_gateway_state_t *s,
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, int use_tep)
|
||||
SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, bool use_tep)
|
||||
{
|
||||
fax_modems_set_tep_mode(&s->audio.modems, use_tep);
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, int remove)
|
||||
SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, bool remove)
|
||||
{
|
||||
s->core.to_t38.fill_bit_removal = remove;
|
||||
}
|
||||
@@ -2218,7 +2224,7 @@ SPAN_DECLARE(void) t38_gateway_set_real_time_frame_handler(t38_gateway_state_t *
|
||||
static int t38_gateway_audio_init(t38_gateway_state_t *s)
|
||||
{
|
||||
fax_modems_init(&s->audio.modems,
|
||||
FALSE,
|
||||
false,
|
||||
NULL,
|
||||
hdlc_underflow_handler,
|
||||
non_ecm_put_bit,
|
||||
@@ -2227,7 +2233,7 @@ static int t38_gateway_audio_init(t38_gateway_state_t *s)
|
||||
s);
|
||||
/* We need to use progressive HDLC transmit, and a special HDLC receiver, which is different
|
||||
from the other uses of FAX modems. */
|
||||
hdlc_tx_init(&s->audio.modems.hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s);
|
||||
hdlc_tx_init(&s->audio.modems.hdlc_tx, false, 2, true, hdlc_underflow_handler, s);
|
||||
fsk_rx_set_put_bit(&s->audio.modems.v21_rx, (put_bit_func_t) t38_hdlc_rx_put_bit, &s->audio.modems.hdlc_rx);
|
||||
/* TODO: Don't use the very low cutoff levels we would like to. We get some quirks if we do.
|
||||
We need to sort this out. */
|
||||
@@ -2280,14 +2286,14 @@ SPAN_DECLARE(t38_gateway_state_t *) t38_gateway_init(t38_gateway_state_t *s,
|
||||
t38_gateway_audio_init(s);
|
||||
t38_gateway_t38_init(s, tx_packet_handler, tx_packet_user_data);
|
||||
|
||||
fax_modems_set_rx_active(&s->audio.modems, TRUE);
|
||||
fax_modems_set_rx_active(&s->audio.modems, true);
|
||||
t38_gateway_set_supported_modems(s, T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17);
|
||||
t38_gateway_set_nsx_suppression(s, (const uint8_t *) "\x00\x00\x00", 3, (const uint8_t *) "\x00\x00\x00", 3);
|
||||
|
||||
s->core.to_t38.octets_per_data_packet = 1;
|
||||
s->core.ecm_allowed = TRUE;
|
||||
s->core.ecm_allowed = true;
|
||||
s->core.ms_per_tx_chunk = DEFAULT_MS_PER_TX_CHUNK;
|
||||
t38_non_ecm_buffer_init(&s->core.non_ecm_to_modem, FALSE, 0);
|
||||
t38_non_ecm_buffer_init(&s->core.non_ecm_to_modem, false, 0);
|
||||
restart_rx_modem(s);
|
||||
s->core.timed_mode = TIMED_MODE_STARTUP;
|
||||
s->core.samples_to_timeout = 1;
|
||||
|
Reference in New Issue
Block a user