|
spandsp 0.0.6
|
Go to the source code of this file.
Classes | |
| struct | t38_stats_t |
Macros | |
| #define | T38_RX_BUF_LEN 2048 |
| #define | T38_TX_HDLC_BUFS 256 |
| #define | T38_MAX_HDLC_LEN 260 |
Typedefs | |
| typedef struct t38_gateway_state_s | t38_gateway_state_t |
| typedef void | t38_gateway_real_time_frame_handler_t(t38_gateway_state_t *s, void *user_data, int direction, const uint8_t *msg, int len) |
| T.30 real time frame handler. | |
Functions | |
| t38_gateway_state_t * | t38_gateway_init (t38_gateway_state_t *s, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data) |
| Initialise a gateway mode T.38 context. | |
| int | t38_gateway_release (t38_gateway_state_t *s) |
| Release a T.38 context. | |
| int | t38_gateway_free (t38_gateway_state_t *s) |
| Free a T.38 context. | |
| SPAN_DECLARE_NONSTD (int) t38_gateway_rx(t38_gateway_state_t *s | |
| Process a block of received FAX audio samples. | |
| void | t38_gateway_set_ecm_capability (t38_gateway_state_t *s, int ecm_allowed) |
| Control whether error correcting mode (ECM) is allowed. | |
| void | t38_gateway_set_transmit_on_idle (t38_gateway_state_t *s, int transmit_on_idle) |
| Select whether silent audio will be sent when transmit is idle. | |
| void | t38_gateway_set_supported_modems (t38_gateway_state_t *s, int supported_modems) |
| Specify supported modems. | |
| void | t38_gateway_set_nsx_suppression (t38_gateway_state_t *s, const uint8_t *from_t38, int from_t38_len, const uint8_t *from_modem, int from_modem_len) |
| Select whether NSC, NSF, and NSS should be suppressed. | |
| void | t38_gateway_set_tep_mode (t38_gateway_state_t *s, int use_tep) |
| Select whether TEP will be sent for the image modems. | |
| void | t38_gateway_set_fill_bit_removal (t38_gateway_state_t *s, int remove) |
| Select whether non-ECM fill bits are to be removed during transmission. | |
| void | t38_gateway_get_transfer_statistics (t38_gateway_state_t *s, t38_stats_t *t) |
| Get the current transfer statistics. | |
| t38_core_state_t * | t38_gateway_get_t38_core_state (t38_gateway_state_t *s) |
| Get a pointer to the T.38 core IFP packet engine associated with a T.38 context. | |
| logging_state_t * | t38_gateway_get_logging_state (t38_gateway_state_t *s) |
| Get a pointer to the logging context associated with a T.38 context. | |
| void | t38_gateway_set_real_time_frame_handler (t38_gateway_state_t *s, t38_gateway_real_time_frame_handler_t *handler, void *user_data) |
| Set a callback function for T.30 frame exchange monitoring. | |
Variables | |
| int16_t | amp [] |
| int16_t int | len |
| int16_t int | max_len |
| #define T38_MAX_HDLC_LEN 260 |
The maximum length of an HDLC frame buffer. This must be big enough for ECM frames.
| #define T38_RX_BUF_LEN 2048 |
The receive buffer length
| #define T38_TX_HDLC_BUFS 256 |
The number of HDLC transmit buffers
| typedef void t38_gateway_real_time_frame_handler_t(t38_gateway_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.
| 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. |
| SPAN_DECLARE_NONSTD | ( | int | ) |
Process a block of received FAX audio samples.
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.
| s | The T.38 context. |
| amp | The audio sample buffer. |
| len | The number of samples in the buffer. |
Apply fake processing when a block of audio samples is missing (e.g due to packet loss).
| s | The T.38 context. |
| len | The number of samples to fake. |
Generate a block of FAX audio samples.
| s | The T.38 context. |
| amp | The audio sample buffer. |
| max_len | The number of samples to be generated. |
Apply T.30 receive processing to a block of audio samples.
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.
| user_data | An opaque point which must point to a transmitter context. |
Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).
| s | The FAX context. |
| len | The number of samples to fake. |
Apply T.30 transmit processing to generate a block of audio samples.
| s | The FAX context. |
| amp | The audio sample buffer. |
| max_len | The number of samples to be generated. |
Process a block of received FSK modem audio samples.
| s | The modem context. |
| amp | The audio sample buffer. |
| len | The number of samples in the buffer. |
Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss).
| s | The modem context. |
| len | The number of samples to fake. |
| s | A pointer to an HDLC transmitter context. |
| s | A pointer to an HDLC transmitter context. |
| buf | The buffer for the data. |
| max_len | The number of bytes to get. |
| s | The context. |
| amp | An array of signal samples. |
| len | The number of samples in the array. |
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.
| user_data | The context. |
| amp | The signal.buffer |
| len | The length of the signal buffer |
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.
| user_data | The context. |
| len | The length of the signal buffer |
Fake processing of a missing block of received T.31 modem audio samples (e.g due to packet loss).
| s | The T.31 modem context. |
| len | The number of samples to fake. |
Generate a block of T.31 modem audio samples.
| s | The T.31 modem context. |
| amp | The audio sample buffer. |
| max_len | The number of samples to be generated. |
| 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. |
Apply fake processing when a block of audio samples is missing (e.g due to packet loss).
| s | The T.38 context. |
| len | The number of samples to fake. |
Generate a block of FAX audio samples.
| s | The T.38 context. |
| amp | The audio sample buffer. |
| max_len | The number of samples to be generated. |
Fake processing of a missing block of received V.17 modem audio samples. (e.g due to packet loss).
| s | The modem context. |
| len | The number of samples to fake. |
Process a block of received V.18 audio samples.
| 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).
| s | The modem context. |
| len | The number of samples to fake. |
Generate a block of V.22bis modem audio samples.
| s | The modem context. |
| amp | The audio sample buffer. |
| len | The number of samples to be generated. |
Fake processing of a missing block of received V.27ter modem audio samples. (e.g due to packet loss).
| s | The modem context. |
| len | The number of samples to fake. |
Fake processing of a missing block of received V.29 modem audio samples. (e.g due to packet loss).
| s | The modem context. |
| len | The number of samples to fake. |
Process a block of received V.8 audio samples.
| 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.
| s | The FAX context. |
| amp | The audio sample buffer. |
| len | The number of samples in the buffer. |
Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).
| s | The FAX context. |
| len | The number of samples to fake. |
Apply T.30 transmit processing to generate a block of audio samples.
| s | The FAX context. |
| amp | The audio sample buffer. |
| max_len | The number of samples to be generated. |
| int t38_gateway_free | ( | t38_gateway_state_t * | s | ) |
Free a T.38 context.
Free a gateway mode T.38 context.
| s | The T.38 context. |
| logging_state_t * t38_gateway_get_logging_state | ( | t38_gateway_state_t * | s | ) |
Get a pointer to the logging context associated with a T.38 context.
Get a pointer to the logging context associated with a T.38 context.
| s | The T.38 context. |
References t38_gateway_state_s::logging.
| t38_core_state_t * t38_gateway_get_t38_core_state | ( | t38_gateway_state_t * | s | ) |
Get a pointer to the T.38 core IFP packet engine associated with a T.38 context.
Get a pointer to the T.38 core IFP packet engine associated with a gateway mode T.38 context.
| s | The T.38 context. |
References t38_gateway_t38_state_t::t38, and t38_gateway_state_s::t38x.
| void t38_gateway_get_transfer_statistics | ( | t38_gateway_state_t * | s, |
| t38_stats_t * | t ) |
Get the current transfer statistics.
Get the current transfer statistics for the current T.38 session.
| s | The T.38 context. |
| t | A pointer to a buffer for the statistics. |
References t38_stats_t::bit_rate, t38_gateway_state_s::core, t38_gateway_core_state_t::ecm_mode, t38_stats_t::error_correcting_mode, t38_gateway_core_state_t::fast_bit_rate, t38_gateway_core_state_t::pages_confirmed, and t38_stats_t::pages_transferred.
| t38_gateway_state_t * t38_gateway_init | ( | t38_gateway_state_t * | s, |
| t38_tx_packet_handler_t * | tx_packet_handler, | ||
| void * | tx_packet_user_data ) |
Initialise a gateway mode T.38 context.
| s | The T.38 context. |
| tx_packet_handler | A callback routine to encapsulate and transmit T.38 packets. |
| tx_packet_user_data | An opaque pointer passed to the tx_packet_handler routine. |
References t38_gateway_state_s::audio, fax_modems_state_s::audio_rx_log, fax_modems_state_s::audio_tx_log, t38_gateway_state_s::core, t38_gateway_core_state_t::ecm_allowed, t38_gateway_state_s::logging, t38_gateway_audio_state_t::modems, t38_gateway_core_state_t::non_ecm_to_modem, t38_gateway_to_t38_state_t::octets_per_data_packet, t38_gateway_core_state_t::samples_to_timeout, T30_SUPPORT_V17, T30_SUPPORT_V27TER, T30_SUPPORT_V29, t38_gateway_set_nsx_suppression(), t38_gateway_set_supported_modems(), t38_non_ecm_buffer_init(), t38_gateway_core_state_t::timed_mode, and t38_gateway_core_state_t::to_t38.
| int t38_gateway_release | ( | t38_gateway_state_t * | s | ) |
Release a T.38 context.
Release a gateway mode T.38 context.
| s | The T.38 context. |
| void t38_gateway_set_ecm_capability | ( | t38_gateway_state_t * | s, |
| int | ecm_allowed ) |
Control whether error correcting mode (ECM) is allowed.
Control whether error correcting mode (ECM) is allowed.
| s | The T.38 context. |
| ecm_allowed | TRUE is ECM is to be allowed. |
References t38_gateway_state_s::core, and t38_gateway_core_state_t::ecm_allowed.
| void t38_gateway_set_fill_bit_removal | ( | t38_gateway_state_t * | s, |
| int | remove ) |
Select whether non-ECM fill bits are to be removed during transmission.
Select whether non-ECM fill bits are to be removed during transmission.
| s | The T.38 context. |
| remove | TRUE if fill bits are to be removed. |
References t38_gateway_state_s::core, t38_gateway_to_t38_state_t::fill_bit_removal, and t38_gateway_core_state_t::to_t38.
| void t38_gateway_set_nsx_suppression | ( | t38_gateway_state_t * | s, |
| const uint8_t * | from_t38, | ||
| int | from_t38_len, | ||
| const uint8_t * | from_modem, | ||
| int | from_modem_len ) |
Select whether NSC, NSF, and NSS should be suppressed.
Select whether NSC, NSF, and NSS should be suppressed. It selected, the contents of these messages are forced to zero for all octets beyond the message type. This makes them look like manufacturer specific messages, from a manufacturer which does not exist.
| s | The T.38 context. |
| from_t38 | A string of bytes to overwrite the header of any NSC, NSF, and NSS frames passing through the gateway from T.38 the the modem. |
| from_t38_len | The length of the overwrite string. |
| from_modem | A string of bytes to overwrite the header of any NSC, NSF, and NSS frames passing through the gateway from the modem to T.38. |
| from_modem_len | The length of the overwrite string. |
References MAX_NSX_SUPPRESSION, t38_gateway_t38_state_t::suppress_nsx_len, and t38_gateway_state_s::t38x.
Referenced by t38_gateway_init().
| void t38_gateway_set_real_time_frame_handler | ( | t38_gateway_state_t * | s, |
| t38_gateway_real_time_frame_handler_t * | handler, | ||
| void * | user_data ) |
Set a callback function for T.30 frame exchange monitoring.
Set a callback function for T.30 frame exchange monitoring. This is called from the heart of the signal processing, so don't take too long in the handler routine.
| s | The T.30 context. |
| handler | The callback function. |
| user_data | An opaque pointer passed to the callback function. |
References t38_gateway_state_s::core, t38_gateway_core_state_t::real_time_frame_handler, and t38_gateway_core_state_t::real_time_frame_user_data.
| void t38_gateway_set_supported_modems | ( | t38_gateway_state_t * | s, |
| int | supported_modems ) |
Specify supported modems.
Specify which modem types are supported by a T.30 context.
| s | The T.38 context. |
| supported_modems | Bit field list of the supported modems. |
References t38_gateway_state_s::core, t38_gateway_core_state_t::supported_modems, T30_SUPPORT_V17, T30_SUPPORT_V29, t38_gateway_t38_state_t::t38, and t38_gateway_state_s::t38x.
Referenced by t38_gateway_init().
| void t38_gateway_set_tep_mode | ( | t38_gateway_state_t * | s, |
| int | use_tep ) |
Select whether TEP will be sent for the image modems.
Select whether talker echo protection tone will be sent for the image modems.
| s | The T.38 context. |
| use_tep | TRUE if TEP should be sent. |
References t38_gateway_state_s::audio, t38_gateway_audio_state_t::modems, and fax_modems_state_s::use_tep.
| void t38_gateway_set_transmit_on_idle | ( | t38_gateway_state_t * | s, |
| int | transmit_on_idle ) |
Select whether silent audio will be sent when transmit is idle.
Select whether silent audio will be sent when transmit is idle.
| s | The T.38 context. |
| transmit_on_idle | TRUE if silent audio should be output when the FAX transmitter is idle. FALSE to transmit zero length audio when the FAX transmitter is idle. The default behaviour is FALSE. |
References t38_gateway_state_s::audio, t38_gateway_audio_state_t::modems, and fax_modems_state_s::transmit_on_idle.