Skip to content

Commit

Permalink
Ignore superfluous T38_FIELD_HDLC_SIG_END sent by some implementations
Browse files Browse the repository at this point in the history
Ignore T38_FIELD_HDLC_SIG_END when received following a
T38_FIELD_HDLC_FCS_OK_SIG_END or T38_FIELD_HDLC_FCS_BAD_SIG_END
  • Loading branch information
pfournier committed Sep 24, 2024
1 parent 933d40d commit 6795176
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/t31.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,10 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
/*endif*/
/* Some T.38 implementations send multiple T38_FIELD_HDLC_SIG_END messages, in IFP packets with
incrementing sequence numbers, which are actually repeats. They get through to this point because
of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */
if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type)
of the incrementing sequence numbers. Some others send T38_FIELD_HDLC_SIG_END following a
T38_FIELD_HDLC_FCS_OK_SIG_END or T38_FIELD_HDLC_FCS_BAD_SIG_END. We need to filter them here
in a context sensitive manner. */
if (t->current_rx_data_type != data_type || (t->current_rx_field_type != field_type && t->current_rx_field_type != T38_FIELD_HDLC_FCS_OK_SIG_END && t->current_rx_field_type != T38_FIELD_HDLC_FCS_BAD_SIG_END))
{
/* WORKAROUND: At least some Mediatrix boxes have a bug, where they can send this message at the
end of non-ECM data. We need to tolerate this. We use the generic receive complete
Expand Down
6 changes: 4 additions & 2 deletions src/t38_gateway.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,8 +1308,10 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
/*endif*/
/* Some T.38 implementations send multiple T38_FIELD_HDLC_SIG_END messages, in IFP packets with
incrementing sequence numbers, which are actually repeats. They get through to this point because
of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */
if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type)
of the incrementing sequence numbers. Some others send T38_FIELD_HDLC_SIG_END following a
T38_FIELD_HDLC_FCS_OK_SIG_END or T38_FIELD_HDLC_FCS_BAD_SIG_END. We need to filter them here
in a context sensitive manner. */
if (t->current_rx_data_type != data_type || (t->current_rx_field_type != field_type && t->current_rx_field_type != T38_FIELD_HDLC_FCS_OK_SIG_END && t->current_rx_field_type != T38_FIELD_HDLC_FCS_BAD_SIG_END))
{
if (hdlc_buf->contents != (data_type | FLAG_DATA))
{
Expand Down
6 changes: 4 additions & 2 deletions src/t38_terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,10 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
/*endif*/
/* Some T.38 implementations send multiple T38_FIELD_HDLC_SIG_END messages, in IFP packets with
incrementing sequence numbers, which are actually repeats. They get through to this point because
of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */
if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type)
of the incrementing sequence numbers. Some others send T38_FIELD_HDLC_SIG_END following a
T38_FIELD_HDLC_FCS_OK_SIG_END or T38_FIELD_HDLC_FCS_BAD_SIG_END. We need to filter them here
in a context sensitive manner. */
if (t->current_rx_data_type != data_type || (t->current_rx_field_type != field_type && t->current_rx_field_type != T38_FIELD_HDLC_FCS_OK_SIG_END && t->current_rx_field_type != T38_FIELD_HDLC_FCS_BAD_SIG_END))
{
/* WORKAROUND: At least some Mediatrix boxes have a bug, where they can send this message at the
end of non-ECM data. We need to tolerate this. We use the generic receive complete
Expand Down

0 comments on commit 6795176

Please sign in to comment.