spandsp: t30.h File Reference

spandsp 0.0.6

t30.h File Reference

Go to the source code of this file.

## Classes
struct | t30_exchanged_info_t
struct | t30_stats_t

## Macros
#define | T30_MAX_DIS_DTC_DCS_LEN 22
#define | T30_MAX_IDENT_LEN 20
#define | T30_MAX_PAGE_HEADER_INFO 50

## Typedefs
typedef struct t30_state_s | t30_state_t
typedef int | t30_phase_b_handler_t(t30_state_t *s, void *user_data, int result)
| T.30 phase B callback handler.
typedef int | t30_phase_d_handler_t(t30_state_t *s, void *user_data, int result)
| T.30 phase D callback handler.
typedef void | t30_phase_e_handler_t(t30_state_t *s, void *user_data, int completion_code)
| T.30 phase E callback handler.
typedef void | t30_real_time_frame_handler_t(t30_state_t *s, void *user_data, int direction, const uint8_t msg[], int len)
| T.30 real time frame handler.
typedef int | t30_document_handler_t(t30_state_t *s, void *user_data, int status)
| T.30 document handler.
typedef void | t30_set_handler_t(void *user_data, int type, int bit_rate, int short_train, int use_hdlc)
| T.30 set a receive or transmit type handler.
typedef void | t30_send_hdlc_handler_t(void *user_data, const uint8_t msg[], int len)
| T.30 send HDLC handler.

## Enumerations
enum | { T30_ERR_OK = 0 , T30_ERR_CEDTONE , T30_ERR_T0_EXPIRED , T30_ERR_T1_EXPIRED , T30_ERR_T3_EXPIRED , T30_ERR_HDLC_CARRIER , T30_ERR_CANNOT_TRAIN , T30_ERR_OPER_INT_FAIL , T30_ERR_INCOMPATIBLE , T30_ERR_RX_INCAPABLE , T30_ERR_TX_INCAPABLE , T30_ERR_NORESSUPPORT , T30_ERR_NOSIZESUPPORT , T30_ERR_UNEXPECTED , T30_ERR_TX_BADDCS , T30_ERR_TX_BADPG , T30_ERR_TX_ECMPHD , T30_ERR_TX_GOTDCN , T30_ERR_TX_INVALRSP , T30_ERR_TX_NODIS , T30_ERR_TX_PHBDEAD , T30_ERR_TX_PHDDEAD , T30_ERR_TX_T5EXP , T30_ERR_RX_ECMPHD , T30_ERR_RX_GOTDCS , T30_ERR_RX_INVALCMD , T30_ERR_RX_NOCARRIER , T30_ERR_RX_NOEOL , T30_ERR_RX_NOFAX , T30_ERR_RX_T2EXPDCN , T30_ERR_RX_T2EXPD , T30_ERR_RX_T2EXPFAX , T30_ERR_RX_T2EXPMPS , T30_ERR_RX_T2EXPRR , T30_ERR_RX_T2EXP , T30_ERR_RX_DCNWHY , T30_ERR_RX_DCNDATA , T30_ERR_RX_DCNFAX , T30_ERR_RX_DCNPHD , T30_ERR_RX_DCNRRD , T30_ERR_RX_DCNNORTN , T30_ERR_FILEERROR , T30_ERR_NOPAGE , T30_ERR_BADTIFF , T30_ERR_BADPAGE , T30_ERR_BADTAG , T30_ERR_BADTIFFHDR , T30_ERR_NOMEM , T30_ERR_RETRYDCN , T30_ERR_CALLDROPPED , T30_ERR_NOPOLL , T30_ERR_IDENT_UNACCEPTABLE , T30_ERR_SUB_UNACCEPTABLE , T30_ERR_SEP_UNACCEPTABLE , T30_ERR_PSA_UNACCEPTABLE , T30_ERR_SID_UNACCEPTABLE , T30_ERR_PWD_UNACCEPTABLE , T30_ERR_TSA_UNACCEPTABLE , T30_ERR_IRA_UNACCEPTABLE , T30_ERR_CIA_UNACCEPTABLE , T30_ERR_ISP_UNACCEPTABLE , T30_ERR_CSA_UNACCEPTABLE }
enum | { T30_MODEM_NONE = 0 , T30_MODEM_PAUSE , T30_MODEM_CED , T30_MODEM_CNG , T30_MODEM_V21 , T30_MODEM_V27TER , T30_MODEM_V29 , T30_MODEM_V17 , T30_MODEM_V34HDX , T30_MODEM_DONE }
enum | { T30_FRONT_END_SEND_STEP_COMPLETE = 0 , T30_FRONT_END_RECEIVE_COMPLETE , T30_FRONT_END_SIGNAL_PRESENT , T30_FRONT_END_SIGNAL_ABSENT , T30_FRONT_END_CED_PRESENT , T30_FRONT_END_CNG_PRESENT }
enum | { T30_SUPPORT_V27TER = 0x01 , T30_SUPPORT_V29 = 0x02 , T30_SUPPORT_V17 = 0x04 , T30_SUPPORT_V34HDX = 0x08 , T30_SUPPORT_IAF = 0x10 }
enum | { T30_SUPPORT_NO_COMPRESSION = 0x01 , T30_SUPPORT_T4_1D_COMPRESSION = 0x02 , T30_SUPPORT_T4_2D_COMPRESSION = 0x04 , T30_SUPPORT_T6_COMPRESSION = 0x08 , T30_SUPPORT_T85_COMPRESSION = 0x10 , T30_SUPPORT_T85_L0_COMPRESSION = 0x20 , T30_SUPPORT_T43_COMPRESSION = 0x40 , T30_SUPPORT_T45_COMPRESSION = 0x80 , T30_SUPPORT_T81_COMPRESSION = 0x100 , T30_SUPPORT_SYCC_T81_COMPRESSION = 0x200 , T30_SUPPORT_T88_COMPRESSION = 0x400 }
enum | { T30_SUPPORT_STANDARD_RESOLUTION = 0x01 , T30_SUPPORT_FINE_RESOLUTION = 0x02 , T30_SUPPORT_SUPERFINE_RESOLUTION = 0x04 , T30_SUPPORT_R4_RESOLUTION = 0x10000 , T30_SUPPORT_R8_RESOLUTION = 0x20000 , T30_SUPPORT_R16_RESOLUTION = 0x40000 , T30_SUPPORT_300_300_RESOLUTION = 0x100000 , T30_SUPPORT_400_400_RESOLUTION = 0x200000 , T30_SUPPORT_600_600_RESOLUTION = 0x400000 , T30_SUPPORT_1200_1200_RESOLUTION = 0x800000 , T30_SUPPORT_300_600_RESOLUTION = 0x1000000 , T30_SUPPORT_400_800_RESOLUTION = 0x2000000 , T30_SUPPORT_600_1200_RESOLUTION = 0x4000000 }
enum | { T30_SUPPORT_215MM_WIDTH = 0x01 , T30_SUPPORT_255MM_WIDTH = 0x02 , T30_SUPPORT_303MM_WIDTH = 0x04 , T30_SUPPORT_UNLIMITED_LENGTH = 0x10000 , T30_SUPPORT_A4_LENGTH = 0x20000 , T30_SUPPORT_B4_LENGTH = 0x40000 , T30_SUPPORT_US_LETTER_LENGTH = 0x80000 , T30_SUPPORT_US_LEGAL_LENGTH = 0x100000 }
enum | { T30_SUPPORT_IDENTIFICATION = 0x01 , T30_SUPPORT_SELECTIVE_POLLING = 0x02 , T30_SUPPORT_POLLED_SUB_ADDRESSING = 0x04 , T30_SUPPORT_MULTIPLE_SELECTIVE_POLLING = 0x08 , T30_SUPPORT_SUB_ADDRESSING = 0x10 , T30_SUPPORT_TRANSMITTING_SUBSCRIBER_INTERNET_ADDRESS = 0x20 , T30_SUPPORT_INTERNET_ROUTING_ADDRESS = 0x40 , T30_SUPPORT_CALLING_SUBSCRIBER_INTERNET_ADDRESS = 0x80 , T30_SUPPORT_INTERNET_SELECTIVE_POLLING_ADDRESS = 0x100 , T30_SUPPORT_CALLED_SUBSCRIBER_INTERNET_ADDRESS = 0x200 , T30_SUPPORT_FIELD_NOT_VALID = 0x400 , T30_SUPPORT_COMMAND_REPEAT = 0x800 }
enum | { T30_IAF_MODE_T37 = 0x01 , T30_IAF_MODE_T38 = 0x02 , T30_IAF_MODE_FLOW_CONTROL = 0x04 , T30_IAF_MODE_CONTINUOUS_FLOW = 0x08 , T30_IAF_MODE_NO_TCF = 0x10 , T30_IAF_MODE_NO_FILL_BITS = 0x20 , T30_IAF_MODE_NO_INDICATORS = 0x40 , T30_IAF_MODE_RELAXED_TIMERS = 0x80 }

## Functions
t30_state_t * | t30_init (t30_state_t *s, int calling_party, t30_set_handler_t *set_rx_type_handler, void *set_rx_type_user_data, t30_set_handler_t *set_tx_type_handler, void *set_tx_type_user_data, t30_send_hdlc_handler_t *send_hdlc_handler, void *send_hdlc_user_data)
| Initialise a T.30 context.
int | t30_release (t30_state_t *s)
| Release a T.30 context.
int | t30_free (t30_state_t *s)
| Free a T.30 context.
int | t30_restart (t30_state_t *s)
| Restart a T.30 context.
int | t30_call_active (t30_state_t *s)
| Check if a T.30 call is still active.
void | t30_terminate (t30_state_t *s)
| Cleanup a T.30 context if the call terminates.
void | t30_front_end_status (void *user_data, int status)
| Inform the T.30 engine of a status change in the front end (end of tx, rx signal change, etc.).
| SPAN_DECLARE_NONSTD (int) t30_non_ecm_get_bit(void *user_data)
| Get a bit of received non-ECM image data.
int | t30_non_ecm_get_byte (void *user_data)
| Get a byte of received non-ECM image data.
int | t30_non_ecm_get_chunk (void *user_data, uint8_t buf[], int max_len)
| Get a bit of received non-ECM image data.
| SPAN_DECLARE_NONSTD (void) t30_non_ecm_put_bit(void *user_data
| Process a bit of received non-ECM image data.
void | t30_non_ecm_put_byte (void *user_data, int byte)
| Process a byte of received non-ECM image data.
void | t30_non_ecm_put_chunk (void *user_data, const uint8_t buf[], int len)
| Process a chunk of received non-ECM image data.
void | t30_timer_update (t30_state_t *s, int samples)
| Report the passage of time to the T.30 engine.
void | t30_get_transfer_statistics (t30_state_t *s, t30_stats_t *t)
| Get the current transfer statistics.
void | t30_local_interrupt_request (t30_state_t *s, int state)
| Request a local interrupt of FAX exchange.
void | t30_remote_interrupts_allowed (t30_state_t *s, int state)
| Allow remote interrupts of FAX exchange.

## Variables
int | bit
const uint8_t | msg []
const uint8_t int | len
const uint8_t int int | ok

## Macro Definition Documentation

## ◆ T30_MAX_DIS_DTC_DCS_LEN

#define T30_MAX_DIS_DTC_DCS_LEN 22

The maximum length of a DIS, DTC or DCS frame

## ◆ T30_MAX_IDENT_LEN

#define T30_MAX_IDENT_LEN 20

The maximum length of the body of an ident string

Referenced by t30_set_tx_ident(), t30_set_tx_password(), t30_set_tx_polled_sub_address(), t30_set_tx_selective_polling_address(), t30_set_tx_sender_ident(), and t30_set_tx_sub_address().

## ◆ T30_MAX_PAGE_HEADER_INFO

#define T30_MAX_PAGE_HEADER_INFO 50

The maximum length of the user string to insert in page headers

Referenced by t30_set_tx_page_header_info().

## Typedef Documentation

## ◆ t30_document_handler_t

typedef int t30_document_handler_t(t30_state_t *s, void *user_data, int status)

T.30 document handler.

T.30 document handler.

Parameters

  s | The T.30 context.
  user_data | An opaque pointer.
  result | The document event code.

## ◆ t30_phase_b_handler_t

typedef int t30_phase_b_handler_t(t30_state_t *s, void *user_data, int result)

T.30 phase B callback handler.

T.30 phase B callback handler. This handler can be used to process addition information available in some FAX calls, such as passwords. The callback handler can access whatever additional information might have been received, using t30_get_received_info().

Parameters

  s | The T.30 context.
  user_data | An opaque pointer.
  result | The phase B event code.

Returns
  The new status. Normally, T30_ERR_OK is returned.

## ◆ t30_phase_d_handler_t

typedef int t30_phase_d_handler_t(t30_state_t *s, void *user_data, int result)

T.30 phase D callback handler.

T.30 phase D callback handler.

Parameters

  s | The T.30 context.
  user_data | An opaque pointer.
  result | The phase D event code.

Returns
  The new status. Normally, T30_ERR_OK is returned.

## ◆ t30_phase_e_handler_t

typedef void t30_phase_e_handler_t(t30_state_t *s, void *user_data, int completion_code)

T.30 phase E callback handler.

T.30 phase E callback handler.

Parameters

  s | The T.30 context.
  user_data | An opaque pointer.
  completion_code | The phase E completion code.

## ◆ t30_real_time_frame_handler_t

typedef void t30_real_time_frame_handler_t(t30_state_t *s, void *user_data, int direction, const uint8_t msg[], int len)

T.30 real time frame handler.

T.30 real time frame handler.

Parameters

  s | The T.30 context.
  user_data | An opaque pointer.
  direction | TRUE for incoming, FALSE for outgoing.
  msg | The HDLC message.
  len | The length of the message.

## ◆ t30_send_hdlc_handler_t

typedef void t30_send_hdlc_handler_t(void *user_data, const uint8_t msg[], int len)

T.30 send HDLC handler.

T.30 send HDLC handler.

Parameters

  user_data | An opaque pointer.
  msg | The HDLC message.
  len | The length of the message.

## ◆ t30_set_handler_t

typedef void t30_set_handler_t(void *user_data, int type, int bit_rate, int short_train, int use_hdlc)

T.30 set a receive or transmit type handler.

T.30 set a receive or transmit type handler.

Parameters

  user_data | An opaque pointer.
  type | The modem, tone or silence to be sent or received.
  bit_rate | The bit rate of the modem to be sent or received.
  short_train | TRUE if the short training sequence should be used (where one exists).
  use_hdlc | FALSE for bit stream, TRUE for HDLC framing.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
T30_SUPPORT_V27TER | Support the V.27ter modem (2400, and 4800bps) for image transfer.
T30_SUPPORT_V29 | Support the V.29 modem (9600, and 7200bps) for image transfer.
T30_SUPPORT_V17 | Support the V.17 modem (14400, 12000, 9600 and 7200bps) for image transfer.
T30_SUPPORT_V34HDX | Support the V.34 modem (up to 33,600bps) for image transfer.
T30_SUPPORT_IAF | Support the Internet aware FAX mode (no bit rate limit) for image transfer.

## ◆ anonymous enum

anonymous enum

Enumerator
T30_IAF_MODE_CONTINUOUS_FLOW | Continuous flow mode means data is sent as fast as possible, usually across the Internet, where speed is not constrained by a PSTN modem.
T30_IAF_MODE_NO_TCF | No TCF means TCF is not exchanged. The end points must sort out usable speed issues locally.
T30_IAF_MODE_NO_FILL_BITS | No fill bits means do not insert fill bits, even if the T.30 messages request them.
T30_IAF_MODE_NO_INDICATORS | No indicators means do not send indicator messages when using T.38.
T30_IAF_MODE_RELAXED_TIMERS | Use relaxed timers for T.38. This is appropriate when using TCP/TPKT for T.38, as there is no point in anything but a long backstop timeout in such a mode.

## ◆ anonymous enum

anonymous enum

Enumerator
T30_SUPPORT_STANDARD_RESOLUTION | Support standard FAX Y-resolution 98/100dpi
T30_SUPPORT_FINE_RESOLUTION | Support fine FAX Y-resolution 196/200dpi
T30_SUPPORT_SUPERFINE_RESOLUTION | Support super-fine FAX Y-resolution 392/400dpi
T30_SUPPORT_R4_RESOLUTION | Support half FAX X-resolution 100/102dpi
T30_SUPPORT_R8_RESOLUTION | Support standard FAX X-resolution 200/204dpi
T30_SUPPORT_R16_RESOLUTION | Support double FAX X-resolution 400dpi
T30_SUPPORT_300_300_RESOLUTION | Support 300dpi x 300 dpi
T30_SUPPORT_400_400_RESOLUTION | Support 400dpi x 400 dpi
T30_SUPPORT_600_600_RESOLUTION | Support 600dpi x 600 dpi
T30_SUPPORT_1200_1200_RESOLUTION | Support 1200dpi x 1200 dpi
T30_SUPPORT_300_600_RESOLUTION | Support 300dpi x 600 dpi
T30_SUPPORT_400_800_RESOLUTION | Support 400dpi x 800 dpi
T30_SUPPORT_600_1200_RESOLUTION | Support 600dpi x 1200 dpi

## ◆ anonymous enum

anonymous enum

T.30 protocol completion codes, at phase E.

Enumerator
T30_ERR_CEDTONE | OK
T30_ERR_T0_EXPIRED | The CED tone exceeded 5s
T30_ERR_T1_EXPIRED | Timed out waiting for initial communication
T30_ERR_T3_EXPIRED | Timed out waiting for the first message
T30_ERR_HDLC_CARRIER | Timed out waiting for procedural interrupt
T30_ERR_CANNOT_TRAIN | The HDLC carrier did not stop in a timely manner
T30_ERR_OPER_INT_FAIL | Failed to train with any of the compatible modems
T30_ERR_INCOMPATIBLE | Operator intervention failed
T30_ERR_RX_INCAPABLE | Far end is not compatible
T30_ERR_TX_INCAPABLE | Far end is not able to receive
T30_ERR_NORESSUPPORT | Far end is not able to transmit
T30_ERR_NOSIZESUPPORT | Far end cannot receive at the resolution of the image
T30_ERR_UNEXPECTED | Far end cannot receive at the size of image
T30_ERR_TX_BADDCS | Unexpected message received
T30_ERR_TX_BADPG | Received bad response to DCS or training
T30_ERR_TX_ECMPHD | Received a DCN from remote after sending a page
T30_ERR_TX_GOTDCN | Invalid ECM response received from receiver
T30_ERR_TX_INVALRSP | Received a DCN while waiting for a DIS
T30_ERR_TX_NODIS | Invalid response after sending a page
T30_ERR_TX_PHBDEAD | Received other than DIS while waiting for DIS
T30_ERR_TX_PHDDEAD | Received no response to DCS, training or TCF
T30_ERR_TX_T5EXP | No response after sending a page
T30_ERR_RX_ECMPHD | Timed out waiting for receiver ready (ECM mode)
T30_ERR_RX_GOTDCS | Invalid ECM response received from transmitter
T30_ERR_RX_INVALCMD | DCS received while waiting for DTC
T30_ERR_RX_NOCARRIER | Unexpected command after page received
T30_ERR_RX_NOEOL | Carrier lost during fax receive
T30_ERR_RX_NOFAX | Timed out while waiting for EOL (end of line)
T30_ERR_RX_T2EXPDCN | Timed out while waiting for first line
T30_ERR_RX_T2EXPD | Timer T2 expired while waiting for DCN
T30_ERR_RX_T2EXPFAX | Timer T2 expired while waiting for phase D
T30_ERR_RX_T2EXPMPS | Timer T2 expired while waiting for fax page
T30_ERR_RX_T2EXPRR | Timer T2 expired while waiting for next fax page
T30_ERR_RX_T2EXP | Timer T2 expired while waiting for RR command
T30_ERR_RX_DCNWHY | Timer T2 expired while waiting for NSS, DCS or MCF
T30_ERR_RX_DCNDATA | Unexpected DCN while waiting for DCS or DIS
T30_ERR_RX_DCNFAX | Unexpected DCN while waiting for image data
T30_ERR_RX_DCNPHD | Unexpected DCN while waiting for EOM, EOP or MPS
T30_ERR_RX_DCNRRD | Unexpected DCN after EOM or MPS sequence
T30_ERR_RX_DCNNORTN | Unexpected DCN after RR/RNR sequence
T30_ERR_FILEERROR | Unexpected DCN after requested retransmission
T30_ERR_NOPAGE | TIFF/F file cannot be opened
T30_ERR_BADTIFF | TIFF/F page not found
T30_ERR_BADPAGE | TIFF/F format is not compatible
T30_ERR_BADTAG | TIFF/F page number tag missing
T30_ERR_BADTIFFHDR | Incorrect values for TIFF/F tags
T30_ERR_NOMEM | Bad TIFF/F header - incorrect values in fields
T30_ERR_RETRYDCN | Cannot allocate memory for more pages
T30_ERR_CALLDROPPED | Disconnected after permitted retries
T30_ERR_NOPOLL | The call dropped prematurely
T30_ERR_IDENT_UNACCEPTABLE | Poll not accepted
T30_ERR_SUB_UNACCEPTABLE | Far end's ident is not acceptable
T30_ERR_SEP_UNACCEPTABLE | Far end's sub-address is not acceptable
T30_ERR_PSA_UNACCEPTABLE | Far end's selective polling address is not acceptable
T30_ERR_SID_UNACCEPTABLE | Far end's polled sub-address is not acceptable
T30_ERR_PWD_UNACCEPTABLE | Far end's sender identification is not acceptable
T30_ERR_TSA_UNACCEPTABLE | Far end's password is not acceptable
T30_ERR_IRA_UNACCEPTABLE | Far end's transmitting subscriber internet address is not acceptable
T30_ERR_CIA_UNACCEPTABLE | Far end's internet routing address is not acceptable
T30_ERR_ISP_UNACCEPTABLE | Far end's calling subscriber internet address is not acceptable
T30_ERR_CSA_UNACCEPTABLE | Far end's internet selective polling address is not acceptable Far end's called subscriber internet address is not acceptable

## ◆ anonymous enum

anonymous enum

Enumerator
T30_FRONT_END_RECEIVE_COMPLETE | The current receive has completed. This is only needed to report an unexpected end of the receive operation, as might happen with T.38 dying.

## ◆ anonymous enum

anonymous enum

Enumerator
T30_SUPPORT_NO_COMPRESSION | No compression
T30_SUPPORT_T4_1D_COMPRESSION | T.1 1D compression
T30_SUPPORT_T4_2D_COMPRESSION | T.4 2D compression
T30_SUPPORT_T6_COMPRESSION | T.6 2D compression
T30_SUPPORT_T85_COMPRESSION | T.85 monochrome JBIG compression, with fixed L0
T30_SUPPORT_T85_L0_COMPRESSION | T.85 monochrome JBIG compression, with variable L0
T30_SUPPORT_T43_COMPRESSION | T.43 colour JBIG compression
T30_SUPPORT_T45_COMPRESSION | T.45 run length colour compression
T30_SUPPORT_T81_COMPRESSION | T.81 + T.30 Annex E colour JPEG compression
T30_SUPPORT_SYCC_T81_COMPRESSION | T.81 + T.30 Annex K colour sYCC-JPEG compression
T30_SUPPORT_T88_COMPRESSION | T.88 monochrome JBIG2 compression

## ◆ anonymous enum

anonymous enum

Enumerator
T30_SUPPORT_IDENTIFICATION | Enable support of identification, through the SID and/or PWD frames.
T30_SUPPORT_SELECTIVE_POLLING | Enable support of selective polling, through the SEP frame.
T30_SUPPORT_POLLED_SUB_ADDRESSING | Enable support of polling sub-addressing, through the PSA frame.
T30_SUPPORT_MULTIPLE_SELECTIVE_POLLING | Enable support of multiple selective polling, through repeated used of the SEP and PSA frames.
T30_SUPPORT_SUB_ADDRESSING | Enable support of sub-addressing, through the SUB frame.
T30_SUPPORT_TRANSMITTING_SUBSCRIBER_INTERNET_ADDRESS | Enable support of transmitting subscriber internet address, through the TSA frame.
T30_SUPPORT_INTERNET_ROUTING_ADDRESS | Enable support of internet routing address, through the IRA frame.
T30_SUPPORT_CALLING_SUBSCRIBER_INTERNET_ADDRESS | Enable support of calling subscriber internet address, through the CIA frame.
T30_SUPPORT_INTERNET_SELECTIVE_POLLING_ADDRESS | Enable support of internet selective polling address, through the ISP frame.
T30_SUPPORT_CALLED_SUBSCRIBER_INTERNET_ADDRESS | Enable support of called subscriber internet address, through the CSA frame.
T30_SUPPORT_FIELD_NOT_VALID | Enable support of the field not valid (FNV) frame.
T30_SUPPORT_COMMAND_REPEAT | Enable support of the command repeat (CRP) frame.

## ◆ anonymous enum

anonymous enum

I/O modes for the T.30 protocol. These are allocated such that the lower 4 bits represents the variant of the modem - e.g. the particular bit rate selected.

## Function Documentation

## ◆ SPAN_DECLARE_NONSTD() [1/2]

SPAN_DECLARE_NONSTD | ( | int |  | ) |

Get a bit of received non-ECM image data.

Get a bit of received non-ECM image data.

Parameters

  user_data | An opaque pointer, which must point to the T.30 context.

Returns
  The next bit to transmit.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Apply T.30 transmit processing to generate a block of audio samples.

Apply fake T.30 receive processing.

Apply T.30 receive processing to a block of audio samples.

Parameters

  s | The FAX context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).

Parameters

  s | The FAX context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply T.30 transmit processing to generate a block of audio samples.

Parameters

  s | The FAX context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated. This will be zero when there is nothing to send.

Get a bit of received non-ECM image data.

Process a block of received V.8 audio samples.

Fake processing of a missing block of received V.29 modem audio samples.

Fake processing of a missing block of received V.27ter modem audio samples.

Generate a block of V.22bis modem audio samples.

Fake processing of a missing block of received V.22bis modem audio samples.

Process a block of received V.18 audio samples.

Fake processing of a missing block of received V.17 modem audio samples.

Generate a block of FAX audio samples.

Apply fake received audio processing.

Process a received T.38 IFP packet from a reliable stream (e.g. TCP).

Generate a block of T.31 modem audio samples.

Fake processing of a missing block of received T.31 modem audio samples.

Dummy receive fillin callback.

Dummy receive callback.

Process a block of samples through an instance of the modem connect tones detector.

Get the next sequence of bytes for transmission.

Get the next byte for transmission.

Fake processing of a missing block of received FSK modem audio samples.

Process a block of received FSK modem audio samples.

Apply T.30 transmit processing to generate a block of audio samples.

Apply fake T.30 receive processing.

Get the next bit of a transmitted serial bit stream.

Parameters

  user_data | An opaque point which must point to a transmitter context.

Returns
  the next bit, or PUTBIT_END_OF_DATA to indicate the data stream has ended.

Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).

Parameters

  s | The FAX context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply T.30 transmit processing to generate a block of audio samples.

Parameters

  s | The FAX context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated. This will be zero when there is nothing to send.

Process a block of received FSK modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Parameters

  s | A pointer to an HDLC transmitter context.

Returns
  The next byte for transmission.

Parameters

  s | A pointer to an HDLC transmitter context.
  buf | The buffer for the data.
  max_len | The number of bytes to get.

Returns
  The number of bytes actually got.

Parameters

  s | The context.
  amp | An array of signal samples.
  len | The number of samples in the array.

Returns
  The number of unprocessed samples.

A dummy routine to use as a receive callback, when we aren't really trying to process what is received. It just absorbs and ignores the data.

Parameters

  user_data | The context.
  amp | The signal.buffer
  len | The length of the signal buffer

Returns
  0.

A dummy routine to use as a receive fillin callback, when we aren't really trying to process what is received. It just absorbs and ignores the request.

Parameters

  user_data | The context.
  len | The length of the signal buffer

Returns
  0.

Fake processing of a missing block of received T.31 modem audio samples (e.g due to packet loss).

Parameters

  s | The T.31 modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Generate a block of T.31 modem audio samples.

Parameters

  s | The T.31 modem context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Parameters

  s | The T.38 context.
  buf | The packet contents.
  len | The length of the packet contents.
  seq_no | The packet sequence number, used for logging purposes.

Returns
  The length of the packet processed, or -1 if there is an error in the packet, or too few bytes of data to complete it.

Apply fake processing when a block of audio samples is missing (e.g due to packet loss).

Parameters

  s | The T.38 context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Generate a block of FAX audio samples.

Parameters

  s | The T.38 context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Fake processing of a missing block of received V.17 modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Process a block of received V.18 audio samples.

Parameters

  s | The V.18 context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Fake processing of a missing block of received V.22bis modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Generate a block of V.22bis modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Fake processing of a missing block of received V.27ter modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received V.29 modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Process a block of received V.8 audio samples.

Parameters

  s | The V.8 context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Get the next bit of a transmitted serial bit stream.

Apply T.30 transmit processing to generate a block of audio samples.

Apply fake T.30 receive processing.

Apply T.30 receive processing to a block of audio samples.

Parameters

  s | The FAX context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).

Parameters

  s | The FAX context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply T.30 transmit processing to generate a block of audio samples.

Parameters

  s | The FAX context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated. This will be zero when there is nothing to send.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Fake processing of a missing block of received FSK modem audio samples.

Process a block of received FSK modem audio samples.

Generate a block of FSK modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Process a block of received FSK modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Get the next sequence of bytes for transmission.

Get the next byte for transmission.

Parameters

  s | A pointer to an HDLC transmitter context.

Returns
  The next bit for transmission.

Parameters

  s | A pointer to an HDLC transmitter context.

Returns
  The next byte for transmission.

Parameters

  s | A pointer to an HDLC transmitter context.
  buf | The buffer for the data.
  max_len | The number of bytes to get.

Returns
  The number of bytes actually got.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Process a block of samples through an instance of the modem connect tones detector.

Parameters

  s | The context.
  amp | An array of signal samples.
  len | The number of samples to generate.

Returns
  The number of samples generated.

Parameters

  s | The context.
  amp | An array of signal samples.
  len | The number of samples in the array.

Returns
  The number of unprocessed samples.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Dummy receive fillin callback.

Dummy receive callback.

Generate a block of silent audio samples.

Parameters

  s | The silence generator context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated. This will be zero when there is nothing to send.

A dummy routine to use as a receive callback, when we aren't really trying to process what is received. It just absorbs and ignores the data.

Parameters

  user_data | The context.
  amp | The signal.buffer
  len | The length of the signal buffer

Returns
  0.

A dummy routine to use as a receive fillin callback, when we aren't really trying to process what is received. It just absorbs and ignores the request.

Parameters

  user_data | The context.
  len | The length of the signal buffer

Returns
  0.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Generate a block of T.31 modem audio samples.

Fake processing of a missing block of received T.31 modem audio samples.

Process a block of received T.31 modem audio samples.

Parameters

  s | The T.31 modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received T.31 modem audio samples (e.g due to packet loss).

Parameters

  s | The T.31 modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Generate a block of T.31 modem audio samples.

Parameters

  s | The T.31 modem context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Process a received T.38 IFP packet from a reliable stream (e.g. TCP).

Parameters

  s | The T.38 context.
  buf | The packet contents.
  len | The length of the packet contents.
  seq_no | The packet sequence number.

Returns
  0 for OK, else -1.

Parameters

  s | The T.38 context.
  buf | The packet contents.
  len | The length of the packet contents.
  seq_no | The packet sequence number, used for logging purposes.

Returns
  The length of the packet processed, or -1 if there is an error in the packet, or too few bytes of data to complete it.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Generate a block of FAX audio samples.

Apply fake received audio processing.

Process a block of received FAX audio samples.

Parameters

  s | The T.38 context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Apply fake processing when a block of audio samples is missing (e.g due to packet loss).

Parameters

  s | The T.38 context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Generate a block of FAX audio samples.

Parameters

  s | The T.38 context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Get a bit of received non-ECM image data.

Process a block of received V.8 audio samples.

Fake processing of a missing block of received V.29 modem audio samples.

Fake processing of a missing block of received V.27ter modem audio samples.

Generate a block of V.22bis modem audio samples.

Fake processing of a missing block of received V.22bis modem audio samples.

Process a block of received V.18 audio samples.

Fake processing of a missing block of received V.17 modem audio samples.

Generate a block of FAX audio samples.

Apply fake received audio processing.

Process a received T.38 IFP packet from a reliable stream (e.g. TCP).

Generate a block of T.31 modem audio samples.

Fake processing of a missing block of received T.31 modem audio samples.

Dummy receive fillin callback.

Dummy receive callback.

Process a block of samples through an instance of the modem connect tones detector.

Get the next sequence of bytes for transmission.

Get the next byte for transmission.

Fake processing of a missing block of received FSK modem audio samples.

Process a block of received FSK modem audio samples.

Apply T.30 transmit processing to generate a block of audio samples.

Apply fake T.30 receive processing.

Get the next bit of a transmitted serial bit stream.

Parameters

  user_data | An opaque point which must point to a transmitter context.

Returns
  the next bit, or PUTBIT_END_OF_DATA to indicate the data stream has ended.

Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).

Parameters

  s | The FAX context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply T.30 transmit processing to generate a block of audio samples.

Parameters

  s | The FAX context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated. This will be zero when there is nothing to send.

Process a block of received FSK modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Parameters

  s | A pointer to an HDLC transmitter context.

Returns
  The next byte for transmission.

Parameters

  s | A pointer to an HDLC transmitter context.
  buf | The buffer for the data.
  max_len | The number of bytes to get.

Returns
  The number of bytes actually got.

Parameters

  s | The context.
  amp | An array of signal samples.
  len | The number of samples in the array.

Returns
  The number of unprocessed samples.

A dummy routine to use as a receive callback, when we aren't really trying to process what is received. It just absorbs and ignores the data.

Parameters

  user_data | The context.
  amp | The signal.buffer
  len | The length of the signal buffer

Returns
  0.

A dummy routine to use as a receive fillin callback, when we aren't really trying to process what is received. It just absorbs and ignores the request.

Parameters

  user_data | The context.
  len | The length of the signal buffer

Returns
  0.

Fake processing of a missing block of received T.31 modem audio samples (e.g due to packet loss).

Parameters

  s | The T.31 modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Generate a block of T.31 modem audio samples.

Parameters

  s | The T.31 modem context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Parameters

  s | The T.38 context.
  buf | The packet contents.
  len | The length of the packet contents.
  seq_no | The packet sequence number, used for logging purposes.

Returns
  The length of the packet processed, or -1 if there is an error in the packet, or too few bytes of data to complete it.

Apply fake processing when a block of audio samples is missing (e.g due to packet loss).

Parameters

  s | The T.38 context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Generate a block of FAX audio samples.

Parameters

  s | The T.38 context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Fake processing of a missing block of received V.17 modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Process a block of received V.18 audio samples.

Parameters

  s | The V.18 context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Fake processing of a missing block of received V.22bis modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Generate a block of V.22bis modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Fake processing of a missing block of received V.27ter modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received V.29 modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Process a block of received V.8 audio samples.

Parameters

  s | The V.8 context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Get the next bit of a transmitted serial bit stream.

Apply T.30 transmit processing to generate a block of audio samples.

Apply fake T.30 receive processing.

Apply T.30 receive processing to a block of audio samples.

Parameters

  s | The FAX context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).

Parameters

  s | The FAX context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply T.30 transmit processing to generate a block of audio samples.

Parameters

  s | The FAX context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated. This will be zero when there is nothing to send.

Get the next bit of a transmitted serial bit stream.

Fake processing of a missing block of received FSK modem audio samples.

Process a block of received FSK modem audio samples.

Generate a block of FSK modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Process a block of received FSK modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Get the next bit of a transmitted serial bit stream.

Get the next sequence of bytes for transmission.

Get the next byte for transmission.

Parameters

  s | A pointer to an HDLC transmitter context.

Returns
  The next bit for transmission.

Parameters

  s | A pointer to an HDLC transmitter context.

Returns
  The next byte for transmission.

Parameters

  s | A pointer to an HDLC transmitter context.
  buf | The buffer for the data.
  max_len | The number of bytes to get.

Returns
  The number of bytes actually got.

Get the next bit of a transmitted serial bit stream.

Process a block of samples through an instance of the modem connect tones detector.

Parameters

  s | The context.
  amp | An array of signal samples.
  len | The number of samples to generate.

Returns
  The number of samples generated.

Parameters

  s | The context.
  amp | An array of signal samples.
  len | The number of samples in the array.

Returns
  The number of unprocessed samples.

Get the next bit of a transmitted serial bit stream.

Dummy receive fillin callback.

Dummy receive callback.

Generate a block of silent audio samples.

Parameters

  s | The silence generator context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated. This will be zero when there is nothing to send.

A dummy routine to use as a receive callback, when we aren't really trying to process what is received. It just absorbs and ignores the data.

Parameters

  user_data | The context.
  amp | The signal.buffer
  len | The length of the signal buffer

Returns
  0.

A dummy routine to use as a receive fillin callback, when we aren't really trying to process what is received. It just absorbs and ignores the request.

Parameters

  user_data | The context.
  len | The length of the signal buffer

Returns
  0.

Get the next bit of a transmitted serial bit stream.

Generate a block of T.31 modem audio samples.

Fake processing of a missing block of received T.31 modem audio samples.

Process a block of received T.31 modem audio samples.

Parameters

  s | The T.31 modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received T.31 modem audio samples (e.g due to packet loss).

Parameters

  s | The T.31 modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Generate a block of T.31 modem audio samples.

Parameters

  s | The T.31 modem context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Get the next bit of a transmitted serial bit stream.

Process a received T.38 IFP packet from a reliable stream (e.g. TCP).

Parameters

  s | The T.38 context.
  buf | The packet contents.
  len | The length of the packet contents.
  seq_no | The packet sequence number.

Returns
  0 for OK, else -1.

Parameters

  s | The T.38 context.
  buf | The packet contents.
  len | The length of the packet contents.
  seq_no | The packet sequence number, used for logging purposes.

Returns
  The length of the packet processed, or -1 if there is an error in the packet, or too few bytes of data to complete it.

Get the next bit of a transmitted serial bit stream.

Generate a block of FAX audio samples.

Apply fake received audio processing.

Process a block of received FAX audio samples.

Parameters

  s | The T.38 context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Apply fake processing when a block of audio samples is missing (e.g due to packet loss).

Parameters

  s | The T.38 context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Generate a block of FAX audio samples.

Parameters

  s | The T.38 context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Fake processing of a missing block of received V.17 modem audio samples.

Process a block of received V.17 modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received V.17 modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Generate a block of V.17 modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Process a block of received V.18 audio samples.

Generate a block of V.18 audio samples.

Parameters

  s | The V.18 context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Process a block of received V.18 audio samples.

Parameters

  s | The V.18 context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Generate a block of V.22bis modem audio samples.

Fake processing of a missing block of received V.22bis modem audio samples.

Process a block of received V.22bis modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received V.22bis modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Generate a block of V.22bis modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Fake processing of a missing block of received V.27ter modem audio samples.

Process a block of received V.27ter modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received V.27ter modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Generate a block of V.27ter modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Fake processing of a missing block of received V.29 modem audio samples.

Process a block of received V.29 modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received V.29 modem audio samples. (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Generate a block of V.29 modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Process a block of received V.8 audio samples.

Generate a block of V.8 audio samples.

Parameters

  s | The V.8 context.
  amp | The audio sample buffer.
  max_len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Process a block of received V.8 audio samples.

Parameters

  s | The V.8 context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

## ◆ SPAN_DECLARE_NONSTD() [2/2]

SPAN_DECLARE_NONSTD | ( | void |  | ) |

Process a bit of received non-ECM image data.

Process a received HDLC frame.

Process a bit of received non-ECM image data.

Parameters

  user_data | An opaque pointer, which must point to the T.30 context.
  bit | The received bit.

Process a received HDLC frame.

Parameters

  user_data | The T.30 context.
  msg | The HDLC message.
  len | The length of the message, in octets.
  ok | TRUE if the frame was received without error.

## ◆ t30_call_active()

int t30_call_active | ( | t30_state_t * | s | ) |

Check if a T.30 call is still active.

Check if a T.30 call is still active. This may be used to regularly poll if the job has finished.

Parameters

  s | The T.30 context.

Returns
  TRUE for call still active, or FALSE for call completed.

References t30_state_s::phase.

## ◆ t30_free()

int t30_free | ( | t30_state_t * | s | ) |

Free a T.30 context.

Free a T.30 context.

Parameters

  s | The T.30 context.

Returns
  0 for OK, else -1.

References t30_release().

## ◆ t30_front_end_status()

void t30_front_end_status | ( | void * | user_data,
|  | int | status )

Inform the T.30 engine of a status change in the front end (end of tx, rx signal change, etc.).

Inform the T.30 engine of a status change in the front end (end of tx, rx signal change, etc.).

Parameters

  user_data | The T.30 context.
  status | The type of status change which occured.

References t30_state_s::dis_received, t30_state_s::error_correcting_mode, t30_state_s::iaf, t30_state_s::image_carrier_attempted, t30_state_s::last_rx_page_result, t30_state_s::logging, t30_state_s::next_rx_step, t30_state_s::next_tx_step, t30_state_s::phase, t30_state_s::retries, t30_state_s::rx_signal_present, t30_state_s::short_train, SIG_STATUS_CARRIER_DOWN, SIG_STATUS_CARRIER_UP, SIG_STATUS_FRAMING_OK, span_log(), t30_state_s::state, t30_state_s::step, T30_EOM, T30_EOP, T30_EOS, T30_FRONT_END_RECEIVE_COMPLETE, T30_IAF_MODE_NO_TCF, T30_MPS, T30_NULL, T30_PRI_EOM, T30_PRI_EOP, and T30_PRI_MPS.

## ◆ t30_get_transfer_statistics()

void t30_get_transfer_statistics | ( | t30_state_t * | s,
|  | t30_stats_t * | t )

Get the current transfer statistics.

Get the current transfer statistics for the file being sent or received.

Parameters

  s | The T.30 context.
  t | A pointer to a buffer for the statistics.

References t30_stats_t::bad_rows, t4_stats_t::bad_rows, t30_stats_t::bit_rate, t30_state_s::current_fallback, t30_state_s::current_status, t30_stats_t::current_status, t30_stats_t::encoding, t4_stats_t::encoding, t30_state_s::error_correcting_mode, t30_stats_t::error_correcting_mode, t30_state_s::error_correcting_mode_retries, t30_stats_t::error_correcting_mode_retries, t30_stats_t::image_size, t30_stats_t::length, t4_stats_t::length, t4_stats_t::line_image_size, t30_stats_t::longest_bad_row_run, t4_stats_t::longest_bad_row_run, t30_state_s::operation_in_progress, t30_stats_t::pages_in_file, t4_stats_t::pages_in_file, t30_stats_t::pages_rx, t30_stats_t::pages_tx, t30_state_s::rtn_events, t30_state_s::rtp_events, t30_state_s::rx_page_number, t30_state_s::t4, t4_rx_get_transfer_statistics(), t4_tx_get_transfer_statistics(), t30_state_s::tx_page_number, t30_stats_t::width, t4_stats_t::width, t30_stats_t::x_resolution, t4_stats_t::x_resolution, t30_stats_t::y_resolution, and t4_stats_t::y_resolution.

## ◆ t30_init()

t30_state_t * t30_init | ( | t30_state_t * | s,
|  | int | calling_party,
|  | t30_set_handler_t * | set_rx_type_handler,
|  | void * | set_rx_type_user_data,
|  | t30_set_handler_t * | set_tx_type_handler,
|  | void * | set_tx_type_user_data,
|  | t30_send_hdlc_handler_t * | send_hdlc_handler,
|  | void * | send_hdlc_user_data )

Initialise a T.30 context.

Initialise a T.30 context.

Parameters

  s | The T.30 context.
  calling_party | TRUE if the context is for a calling party. FALSE if the context is for an answering party.
  set_rx_type_handler |
  set_rx_type_user_data |
  set_tx_type_handler |
  set_tx_type_user_data |
  send_hdlc_handler |
  send_hdlc_user_data |

Returns
  A pointer to the context, or NULL if there was a problem.

References t30_state_s::calling_party, t30_state_s::local_min_scan_time_code, t30_state_s::logging, t30_state_s::output_encoding, t30_state_s::send_hdlc_handler, t30_state_s::send_hdlc_user_data, t30_state_s::set_rx_type_handler, t30_state_s::set_rx_type_user_data, t30_state_s::set_tx_type_handler, t30_state_s::set_tx_type_user_data, t30_state_s::supported_compressions, t30_state_s::supported_image_sizes, t30_state_s::supported_modems, t30_state_s::supported_resolutions, t30_restart(), T30_SUPPORT_FINE_RESOLUTION, T30_SUPPORT_R8_RESOLUTION, T30_SUPPORT_STANDARD_RESOLUTION, T30_SUPPORT_SUPERFINE_RESOLUTION, T30_SUPPORT_T4_1D_COMPRESSION, T30_SUPPORT_T4_2D_COMPRESSION, T30_SUPPORT_V17, T30_SUPPORT_V27TER, T30_SUPPORT_V29, and T4_COMPRESSION_ITU_T4_2D.

Referenced by fax_init(), and t38_terminal_init().

## ◆ t30_local_interrupt_request()

void t30_local_interrupt_request | ( | t30_state_t * | s,
|  | int | state )

Request a local interrupt of FAX exchange.

Request a local interrupt of FAX exchange.

Parameters

  s | The T.30 context.
  state | TRUE to enable interrupt request, else FALSE.

References t30_state_s::local_interrupt_pending, T30_PIN, T30_PIP, and t30_state_s::timer_t3.

## ◆ t30_non_ecm_get_byte()

int t30_non_ecm_get_byte | ( | void * | user_data | ) |

Get a byte of received non-ECM image data.

Get a byte of received non-ECM image data.

Parameters

  user_data | An opaque pointer, which must point to the T.30 context.

Returns
  The next byte to transmit.

References t30_state_s::logging, span_log(), t30_state_s::state, t30_state_s::t4, t4_tx_get_byte(), and t30_state_s::tcf_test_bits.

## ◆ t30_non_ecm_get_chunk()

int t30_non_ecm_get_chunk | ( | void * | user_data,
|  | uint8_t | buf[],
|  | int | max_len )

Get a bit of received non-ECM image data.

Get a chunk of received non-ECM image data.

Parameters

  user_data | An opaque pointer, which must point to the T.30 context.
  buf | The buffer to contain the data.
  max_len | The maximum length of the chunk.

Returns
  The actual length of the chunk.

References t30_state_s::logging, span_log(), t30_state_s::state, t30_state_s::t4, t4_tx_get_chunk(), and t30_state_s::tcf_test_bits.

## ◆ t30_non_ecm_put_byte()

void t30_non_ecm_put_byte | ( | void * | user_data,
|  | int | byte )

Process a byte of received non-ECM image data.

Process a byte of received non-ECM image data.

Parameters

  user_data | An opaque pointer, which must point to the T.30 context.
  byte | The received byte.

References t30_state_s::state, t30_state_s::t4, t4_rx_put_byte(), t30_state_s::tcf_current_zeros, t30_state_s::tcf_most_zeros, and t30_state_s::tcf_test_bits.

## ◆ t30_non_ecm_put_chunk()

void t30_non_ecm_put_chunk | ( | void * | user_data,
|  | const uint8_t | buf[],
|  | int | len )

Process a chunk of received non-ECM image data.

Process a chunk of received non-ECM image data.

Parameters

  user_data | An opaque pointer, which must point to the T.30 context.
  buf | The buffer containing the received data.
  len | The length of the data in buf.

References t30_state_s::state, t30_state_s::t4, t4_rx_put_chunk(), t30_state_s::tcf_current_zeros, t30_state_s::tcf_most_zeros, and t30_state_s::tcf_test_bits.

## ◆ t30_release()

int t30_release | ( | t30_state_t * | s | ) |

Release a T.30 context.

Release a T.30 context.

Parameters

  s | The T.30 context.

Returns
  0 for OK, else -1.

Referenced by fax_free(), fax_release(), t30_free(), and t38_terminal_release().

## ◆ t30_remote_interrupts_allowed()

void t30_remote_interrupts_allowed | ( | t30_state_t * | s,
|  | int | state )

Allow remote interrupts of FAX exchange.

Allow remote interrupts of FAX exchange.

Parameters

  s | The T.30 context.
  state | TRUE to allow interruptd, else FALSE.

References t30_state_s::remote_interrupts_allowed.

## ◆ t30_restart()

int t30_restart | ( | t30_state_t * | s | ) |

Restart a T.30 context.

Restart a T.30 context.

Parameters

  s | The T.30 context.

Returns
  0 for OK, else -1.

References t30_state_s::calling_party, t30_state_s::current_fallback, t30_state_s::current_status, DEFAULT_TIMER_T0, t30_state_s::ecm_progress, t30_state_s::end_of_procedure_detected, t30_state_s::far_dis_dtc_frame, t30_state_s::far_dis_dtc_len, t30_state_s::far_end_detected, t30_state_s::local_interrupt_pending, t30_state_s::next_phase, t30_state_s::phase, t30_state_s::ppr_count, t30_state_s::receiver_not_ready_count, t30_state_s::rtn_events, t30_state_s::rtp_events, t30_state_s::rx_frame_received, t30_state_s::rx_info, t30_state_s::rx_page_number, t30_state_s::rx_signal_present, t30_state_s::rx_trained, t30_state_s::timer_t0_t1, and t30_state_s::tx_page_number.

Referenced by fax_restart(), t30_init(), t38_terminal_init(), and t38_terminal_restart().

## ◆ t30_terminate()

void t30_terminate | ( | t30_state_t * | s | ) |

Cleanup a T.30 context if the call terminates.

Cleanup a T.30 context if the call terminates.

Parameters

  s | The T.30 context.

References t30_state_s::end_of_procedure_detected, t30_state_s::phase, t30_state_s::state, T30_ERR_CALLDROPPED, and t30_set_status().

## ◆ t30_timer_update()

void t30_timer_update | ( | t30_state_t * | s,
|  | int | samples )

Report the passage of time to the T.30 engine.

Report the passage of time to the T.30 engine.

Parameters

  s | The T.30 context.
  samples | The time change in 1/8000th second steps.

References t30_state_s::far_end_detected, t30_state_s::timer_t0_t1, t30_state_s::timer_t2_t4, t30_state_s::timer_t2_t4_is, t30_state_s::timer_t3, and t30_state_s::timer_t5.