Go to the documentation of this file.
28 #if !defined(_SPANDSP_PRIVATE_T38_GATEWAY_H_)
29 #define _SPANDSP_PRIVATE_T38_GATEWAY_H_
41 int suppress_nsx_len[2];
44 int corrupt_current_frame[2];
65 span_rx_fillin_handler_t *base_rx_fillin_handler;
void t30_set_rx_file(t30_state_t *s, const char *file, int stop_page)
Set next receive file name.
Definition: t30_api.c:614
int data_ptr
Current pointer into the data buffer.
Definition: private/t38_gateway.h:76
int field_type
Definition: t38_core.h:192
t38_gateway_t38_state_t t38x
Definition: private/t38_gateway.h:197
#define INDICATOR_TX_COUNT
Definition: t38_gateway.c:128
unsigned long int rx_frames
The number of good frames received.
Definition: private/hdlc.h:78
t38_non_ecm_buffer_state_t non_ecm_to_modem
Definition: private/t38_gateway.h:182
uint16_t crc
Progressively calculated CRC for HDLC messages received from a modem.
Definition: private/t38_gateway.h:86
const char * t38_cm_profile_to_str(int profile)
Convert the code for a CM profile code to text description.
Definition: t38_core.c:220
float v29_rx_signal_power(v29_rx_state_t *s)
Definition: v29rx.c:165
@ T30_EOS
Definition: t30_fcf.h:78
@ T30_DCS
Definition: t30_fcf.h:54
int t30_set_tx_nsf(t30_state_t *s, const uint8_t *nsf, int len)
Set the transmitted NSF frame to be associated with a T.30 context.
Definition: t30_api.c:271
@ MODEM_CONNECT_TONES_FAX_CNG
CNG tone is a pure 1100Hz tone, in 0.5s bursts, with 3s silences in between. The bursts repeat for as...
Definition: modem_connect_tones.h:62
void v17_rx_set_put_bit(v17_rx_state_t *s, put_bit_func_t put_bit, void *user_data)
Change the put_bit function associated with a V.17 modem receive context.
Definition: v17rx.c:1360
int fast_rx_active
The type of fast receive modem currently active, which may be T38_NONE.
Definition: private/t38_gateway.h:170
int v34_rate
The bit rate for V.34 operation.
Definition: private/t38_core.h:125
void t38_gateway_set_ecm_capability(t38_gateway_state_t *s, int ecm_allowed)
Control whether error correcting mode (ECM) is allowed.
Definition: t38_gateway.c:2392
int fill_bit_removal
TRUE if non-ECM fill bits are to be stripped when sending image data.
Definition: private/t38_gateway.h:88
#define DATA_END_TX_COUNT
Definition: t38_gateway.c:132
int current_rx_field_class
the current class of field being received - i.e. none, non-ECM or HDLC
Definition: private/t38_gateway.h:47
@ T30_SUPPORT_T6_COMPRESSION
Definition: t30.h:362
int current_rx_field_type
The current receive field type - i.e. the last field_type received.
Definition: private/t38_core.h:121
int current_tx_data_type
The current T.38 data type being sent.
Definition: private/t38_gateway.h:52
void v27ter_tx_set_get_bit(v27ter_tx_state_t *s, get_bit_func_t get_bit, void *user_data)
Change the get_bit function associated with a V.27ter modem transmit context.
Definition: v27ter_tx.c:368
int bit_rate
The current bit rate for image transfer.
Definition: t38_gateway.h:71
int pages_transferred
The number of pages transferred so far.
Definition: t38_gateway.h:75
int out
HDLC buffer number for output.
Definition: private/t38_gateway.h:134
void t38_gateway_set_ecm_capability(t38_gateway_state_t *s, int ecm_allowed)
Control whether error correcting mode (ECM) is allowed.
Definition: t38_gateway.c:2392
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.
Definition: t38_gateway.c:2380
t38_gateway_real_time_frame_handler_t * real_time_frame_handler
A pointer to a callback routine to be called when frames are exchanged.
Definition: private/t38_gateway.h:186
@ T30_EOM
Definition: t30_fcf.h:72
const char * t30_completion_code_to_str(int result)
Convert a phase E completion code to a short text description.
Definition: t30_logging.c:108
int span_log_test(logging_state_t *s, int level)
Test if logging of a specified severity level is enabled.
Definition: logging.c:76
int audio_tx_log
Audio logging file handle for transmitted audio.
Definition: private/fax_modems.h:122
@ T30_PPS
Definition: t30_fcf.h:79
void fax_set_transmit_on_idle(fax_state_t *s, int transmit_on_idle)
Select whether silent audio will be sent when FAX transmit is idle.
Definition: fax.c:579
int t38_core_send_data_multi_field(t38_core_state_t *s, int data_type, const t38_data_field_t field[], int fields, int category)
Send a data packet.
Definition: t38_core.c:972
int len
HDLC message lengths.
Definition: private/t38_gateway.h:107
@ T30_MCF
Definition: t30_fcf.h:84
hdlc_tx_state_t * hdlc_tx_init(hdlc_tx_state_t *s, int crc32, int inter_frame_flags, int progressive, hdlc_underflow_handler_t handler, void *user_data)
Initialise an HDLC transmitter context.
Definition: hdlc.c:626
int error_correcting_mode
TRUE if error correcting mode is used.
Definition: t38_gateway.h:73
unsigned long int rx_length_errors
The number of too short and too long frames received.
Definition: private/hdlc.h:82
int framing_ok_announced
TRUE if framing OK has been announced.
Definition: private/hdlc.h:52
Definition: private/t38_gateway.h:195
@ SIG_STATUS_CARRIER_UP
The carrier signal is up. This merely indicates that carrier energy has been seen....
Definition: async.h:58
fax_state_t * fax_init(fax_state_t *s, int calling_party)
Initialise a FAX context.
Definition: fax.c:664
float fsk_rx_signal_power(fsk_rx_state_t *s)
Definition: fsk.c:246
void t38_set_redundancy_control(t38_core_state_t *s, int category, int setting)
Send a data packet.
Definition: t38_core.c:1058
t38_tx_packet_handler_t * tx_packet_handler
Handler routine to transmit IFP packets generated by the T.38 protocol engine.
Definition: private/t38_core.h:35
int t30_set_supported_compressions(t30_state_t *s, int supported_compressions)
Specify supported compression types.
Definition: t30_api.c:688
@ SIG_STATUS_TRAINING_IN_PROGRESS
The modem is training. This is an early indication that the signal seems to be of the right type....
Definition: async.h:63
v27ter_rx_state_t v27ter_rx
A V.27ter modem context used when receiving FAXes at 2400bps or 4800bps.
Definition: private/fax_modems.h:74
int t38_v34rate_to_bps(const uint8_t *data, int len)
Convert a V34rate message to an actual bit rate.
Definition: t38_core.c:272
void v29_rx_signal_cutoff(v29_rx_state_t *s, float cutoff)
Definition: v29rx.c:171
void * frame_user_data
An opaque parameter passed to the frame callback routine.
Definition: private/hdlc.h:41
t38_rx_missing_handler_t * rx_missing_handler
Handler routine to process the missing packet condition.
Definition: private/t38_core.h:44
int flags_seen
Number of consecutive flags seen so far.
Definition: private/hdlc.h:54
Definition: private/t38_core.h:33
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.
Definition: t38_gateway.h:59
int suppress_nsx_len[2]
TRUE if the NSF, NSC, and NSS are to be suppressed by altering their contents to something the far en...
Definition: private/t38_gateway.h:41
int v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int short_train)
Reinitialise an existing V.17 modem transmit context.
Definition: v17tx.c:380
@ T38_PACKET_CATEGORY_CONTROL_DATA
Control data packet.
Definition: t38_core.h:176
void t38_gateway_get_transfer_statistics(t38_gateway_state_t *s, t38_stats_t *t)
Get the current transfer statistics.
Definition: t38_gateway.c:2371
void(* put_bit_func_t)(void *user_data, int bit)
Definition: async.h:105
const char * t30_frametype(uint8_t x)
Return a text name for a T.30 frame type.
Definition: t30_logging.c:241
span_rx_fillin_handler_t * rx_fillin_handler
The current receive missing signal fill-in handler.
Definition: private/fax_modems.h:100
void v27ter_rx_set_put_bit(v27ter_rx_state_t *s, put_bit_func_t put_bit, void *user_data)
Change the put_bit function associated with a V.27ter modem receive context.
Definition: v27ter_rx.c:1016
int num_bits
The current number of bits in byte_in_progress.
Definition: private/hdlc.h:61
#define MODEM_CONNECT_TONES_FAX_CED
FAX CED tone is the same as ANS tone.
Definition: modem_connect_tones.h:87
@ T30_NSS
Definition: t30_fcf.h:56
@ T38_PACKET_CATEGORY_INDICATOR
Indicator packet.
Definition: t38_core.h:174
unsigned int bit_stream
The current octet being received as non-ECM data.
Definition: private/t38_gateway.h:78
Definition: t38_core.h:190
v29_tx_state_t v29_tx
A V.29 modem context used when sending FAXes at 7200bps or 9600bps.
Definition: private/fax_modems.h:65
int rx_trained
TRUE if a modem has trained correctly.
Definition: private/fax_modems.h:93
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.
Definition: t38_gateway.c:2386
int framing_ok_threshold
The number of consecutive flags which must be seen before framing is declared OK.
Definition: private/hdlc.h:50
t38_gateway_to_t38_state_t to_t38
Definition: private/t38_gateway.h:178
int rx_signal_present
TRUE if a carrier is present. Otherwise FALSE.
Definition: private/fax_modems.h:91
const char * signal_status_to_str(int status)
Convert a signal status to a short text description.
Definition: async.c:42
v27ter_tx_state_t v27ter_tx
A V.27ter modem context used when sending FAXes at 2400bps or 4800bps.
Definition: private/fax_modems.h:71
SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data)
Get the next bit of a transmitted serial bit stream.
int fast_bit_rate
The current bit rate for the fast modem.
Definition: private/t38_gateway.h:166
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.
Definition: t38_gateway.c:2380
void v29_rx_set_put_bit(v29_rx_state_t *s, put_bit_func_t put_bit, void *user_data)
Change the put_bit function associated with a V.29 modem receive context.
Definition: v29rx.c:1052
v17_tx_state_t v17_tx
A V.17 modem context used when sending FAXes at 7200bps, 9600bps 12000bps or 14400bps.
Definition: private/fax_modems.h:59
logging_state_t logging
Error and flow logging control.
Definition: private/t38_gateway.h:204
int t38_version
This is the version number of ITU-T Rec. T.38. New versions shall be compatible with previous version...
Definition: private/t38_core.h:90
int v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_train)
Reinitialise an existing V.27ter modem receive context.
Definition: v27ter_rx.c:1036
#define T38_RX_BUF_LEN
Definition: t38_gateway.h:42
@ T30_DTC
Definition: t30_fcf.h:42
int timed_mode
The current timed operation.
Definition: private/t38_gateway.h:173
silence_gen_state_t silence_gen
Used to insert timed silences.
Definition: private/fax_modems.h:77
@ T30_MPS
Definition: t30_fcf.h:73
int samples_to_timeout
The number of samples until the next timeout event.
Definition: private/t38_gateway.h:175
@ T38_PACKET_CATEGORY_IMAGE_DATA
Image data packet.
Definition: t38_core.h:180
int transmit_on_idle
Definition: private/fax_modems.h:43
int audio_rx_log
Audio logging file handle for received audio.
Definition: private/fax_modems.h:120
void t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_tep)
Select whether TEP time will be allowed for.
Definition: t38_terminal.c:1405
t38_core_state_t * t38_terminal_get_t38_core_state(t38_terminal_state_t *s)
Get a pointer to the T.38 core IFP packet engine associated with a T.38 context.
Definition: t38_terminal.c:1433
v29_rx_state_t v29_rx
A V.29 modem context used when receiving FAXes at 7200bps or 9600bps.
Definition: private/fax_modems.h:68
void fax_set_tep_mode(fax_state_t *s, int use_tep)
Select whether TEP will be sent for the image modems.
Definition: fax.c:585
int image_data_mode
TRUE if in image data mode, as opposed to TCF mode.
Definition: private/t38_gateway.h:154
#define T38_MAX_HDLC_LEN
Definition: t38_gateway.h:46
int current_rx_data_type
The current receive data type - i.e. the last data type received.
Definition: private/t38_core.h:119
@ T30_PRI_EOM
Definition: t30_fcf.h:75
Definition: private/t38_gateway.h:141
uint8_t buf[T38_MAX_HDLC_LEN]
HDLC message buffers.
Definition: private/t38_gateway.h:105
Definition: private/fax_modems.h:35
int t38_gateway_free(t38_gateway_state_t *s)
Free a T.38 context.
Definition: t38_gateway.c:2566
@ SIG_STATUS_TRAINING_FAILED
The modem has failed to train.
Definition: async.h:67
logging_state_t * t38_core_get_logging_state(t38_core_state_t *s)
Get a pointer to the logging context associated with a T.38 context.
Definition: t38_core.c:1076
int(* get_bit_func_t)(void *user_data)
Definition: async.h:108
span_rx_handler_t * base_rx_handler
The current receive signal handler. Actual receiving hops between this and a dummy receive routine.
Definition: private/t38_gateway.h:64
#define DATA_TX_COUNT
Definition: t38_gateway.c:130
@ T30_SUPPORT_T4_2D_COMPRESSION
Definition: t30.h:360
void t38_non_ecm_buffer_report_output_status(t38_non_ecm_buffer_state_t *s, logging_state_t *logging)
Report the output status of a T.38 rate adapting non-ECM buffer context to the specified logging cont...
Definition: t38_non_ecm_buffer.c:326
t38_gateway_audio_state_t audio
Definition: private/t38_gateway.h:199
span_rx_handler_t * rx_handler
The current receive signal handler.
Definition: private/fax_modems.h:98
int in_bits
Bits into the non-ECM buffer.
Definition: private/t38_gateway.h:94
#define MAX_NSX_SUPPRESSION
Definition: t38_gateway.c:172
@ T30_SUPPORT_V29
Definition: t30.h:344
span_tx_handler_t * next_tx_handler
The next transmit signal handler, for two stage transmit operations. E.g. a short silence followed by...
Definition: private/fax_modems.h:109
@ SIG_STATUS_CARRIER_DOWN
The carrier signal has dropped.
Definition: async.h:54
@ T30_CFR
Definition: t30_fcf.h:66
int in_progress_rx_indicator
The T.38 indicator currently in use.
Definition: private/t38_gateway.h:49
void silence_gen_set(silence_gen_state_t *s, int silent_samples)
Set a silence generator context to output a specified period of silence.
Definition: silence_gen.c:79
Definition: private/t38_terminal.h:111
size_t len
Length of a frame in progress.
Definition: private/hdlc.h:73
int tx_bit_rate
The current bit rate of the transmitter.
Definition: private/fax_modems.h:113
#define HDLC_START_BUFFER_LEVEL
Definition: t38_gateway.c:125
logging_state_t * t30_get_logging_state(t30_state_t *s)
Get a pointer to the logging context associated with a T.30 context.
Definition: t30_api.c:784
void v29_tx_set_get_bit(v29_tx_state_t *s, get_bit_func_t get_bit, void *user_data)
Change the get_bit function associated with a V.29 modem transmit context.
Definition: v29tx.c:310
const char * t38_indicator_to_str(int indicator)
Convert the code for an indicator to a short text name.
Definition: t38_core.c:93
int v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_train)
Reinitialise an existing V.17 modem receive context.
Definition: v17rx.c:1380
@ T30_SUPPORT_V27TER
Definition: t30.h:342
int bit_no
The current bit number in the current non-ECM octet.
Definition: private/t38_gateway.h:84
void * real_time_frame_user_data
An opaque pointer supplied in real time frame callbacks.
Definition: private/t38_gateway.h:188
int current_rx_indicator
The current receive indicator - i.e. the last indicator received.
Definition: private/t38_core.h:117
Definition: private/hdlc.h:33
Definition: private/fax.h:36
@ T30_RTP
Definition: t30_fcf.h:85
Definition: private/t38_gateway.h:59
int fast_rx_modem
The current fast receive modem type.
Definition: private/t38_gateway.h:168
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.
Definition: t38_gateway.c:2494
@ T30_PRI_MPS
Definition: t30_fcf.h:76
int t38_core_send_data(t38_core_state_t *s, int data_type, int field_type, const uint8_t field[], int field_len, int category)
Send a data packet.
Definition: t38_core.c:948
hdlc_rx_state_t hdlc_rx
An HDLC context used when receiving HDLC messages.
Definition: private/fax_modems.h:48
t38_terminal_state_t * t38_terminal_init(t38_terminal_state_t *s, int calling_party, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data)
Initialise a termination mode T.38 context.
Definition: t38_terminal.c:1509
@ T38_PACKET_CATEGORY_CONTROL_DATA_END
Terminating control data packet.
Definition: t38_core.h:178
#define HDLC_FRAMING_OK_THRESHOLD
Definition: t38_gateway.c:175
@ T30_PRI_EOP
Definition: t30_fcf.h:77
int span_log(logging_state_t *s, int level, const char *format,...)
Generate a log entry.
Definition: logging.c:84
Definition: private/t38_gateway.h:72
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.
Definition: t38_gateway.c:2398
@ T30_EOP
Definition: t30_fcf.h:74
#define T38_TX_HDLC_BUFS
Definition: t38_gateway.h:44
void t30_get_transfer_statistics(t30_state_t *s, t30_stats_t *t)
Get the current transfer statistics.
Definition: t30.c:6229
int silence_gen_remainder(silence_gen_state_t *s)
Find how long a silence generator context has to run.
Definition: silence_gen.c:99
unsigned long int rx_bytes
The number of bytes of good frames received (CRC not included).
Definition: private/hdlc.h:76
logging_state_t logging
Error and flow logging control.
Definition: private/t38_core.h:132
void t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data)
Set a callback function for T.30 phase D handling.
Definition: t30_api.c:756
const char * t38_jm_to_str(const uint8_t *data, int len)
Convert a JM message code to text description.
Definition: t38_core.c:241
modem_connect_tones_tx_state_t * modem_connect_tones_tx_init(modem_connect_tones_tx_state_t *s, int tone_type)
Initialise an instance of the modem connect tones generator.
Definition: modem_connect_tones.c:253
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.
Definition: t38_gateway.c:2440
Definition: private/t38_gateway.h:35
unsigned int raw_bit_stream
The raw (stuffed) bit stream buffer.
Definition: private/hdlc.h:57
hdlc_rx_state_t * hdlc_rx_init(hdlc_rx_state_t *s, int crc32, int report_bad_frames, int framing_ok_threshold, hdlc_frame_handler_t handler, void *user_data)
Initialise an HDLC receiver context.
Definition: hdlc.c:327
void t30_set_tx_file(t30_state_t *s, const char *file, int start_page, int stop_page)
Set next transmit file name.
Definition: t30_api.c:622
int octets_per_data_packet
The number of octets to send in each image packet (non-ECM or ECM) at the current rate and the curren...
Definition: private/t38_gateway.h:91
t38_gateway_core_state_t core
Definition: private/t38_gateway.h:201
#define DEFAULT_MS_PER_TX_CHUNK
Definition: t38_gateway.c:121
Definition: private/t30.h:36
void silence_gen_alter(silence_gen_state_t *s, int silent_samples)
Alter the period of a silence generator context by a specified amount.
Definition: silence_gen.c:86
uint16_t crc_itu16_calc(const uint8_t *buf, int len, uint16_t crc)
Calculate the ITU/CCITT CRC-16 value in buffer by whole bytes.
Definition: crc.c:153
@ T38_PACKET_CATEGORY_IMAGE_DATA_END
Terminating image data packet.
Definition: t38_core.h:182
fsk_rx_state_t * fsk_rx_init(fsk_rx_state_t *s, const fsk_spec_t *spec, int framing_mode, put_bit_func_t put_bit, void *user_data)
Initialise an FSK modem receive context.
Definition: fsk.c:314
int flags
HDLC message status flags.
Definition: private/t38_gateway.h:109
int v29_rx_restart(v29_rx_state_t *s, int bit_rate, int old_train)
Reinitialise an existing V.29 modem receive context.
Definition: v29rx.c:1072
void t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data)
Set a callback function for T.30 phase B handling.
Definition: t30_api.c:749
void t38_non_ecm_buffer_inject(t38_non_ecm_buffer_state_t *s, const uint8_t *buf, int len)
Inject data to T.38 rate adapting non-ECM buffer context.
Definition: t38_non_ecm_buffer.c:130
@ T30_DIS
Definition: t30_fcf.h:35
int ecm_mode
TRUE if we are in error correcting (ECM) mode.
Definition: private/t38_gateway.h:164
void t38_terminal_set_config(t38_terminal_state_t *s, int config)
Set configuration options.
Definition: t38_terminal.c:1354
t38_non_ecm_buffer_state_t * t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, int mode, int min_row_bits)
Initialise a T.38 rate adapting non-ECM buffer context.
Definition: t38_non_ecm_buffer.c:350
t30_state_t * fax_get_t30_state(fax_state_t *s)
Get a pointer to the T.30 engine associated with a FAX context.
Definition: fax.c:591
fsk_tx_state_t * fsk_tx_init(fsk_tx_state_t *s, const fsk_spec_t *spec, get_bit_func_t get_bit, void *user_data)
Initialise an FSK modem transmit context.
Definition: fsk.c:153
int t38_core_send_indicator(t38_core_state_t *s, int indicator)
Send an indicator packet.
Definition: t38_core.c:889
t38_core_state_t t38
Core T.38 IFP support.
Definition: private/t38_gateway.h:37
t38_rx_indicator_handler_t * rx_indicator_handler
Handler routine to process received indicator packets.
Definition: private/t38_core.h:40
void t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data)
Set a callback function for T.30 phase E handling.
Definition: t30_api.c:763
Definition: private/t38_gateway.h:103
int v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep)
Reinitialise an existing V.27ter modem transmit context.
Definition: v27ter_tx.c:390
void v17_tx_set_get_bit(v17_tx_state_t *s, get_bit_func_t get_bit, void *user_data)
Change the get_bit function associated with a V.17 modem transmit context.
Definition: v17tx.c:358
int min_row_bits
The minimum permitted bits per FAX scan line row.
Definition: private/t38_gateway.h:156
Definition: private/t38_gateway.h:118
int tx_seq_no
The sequence number for the next packet to be transmitted.
Definition: private/t38_core.h:112
int missing_packets
Definition: private/t38_core.h:129
@ T30_RTN
Definition: t30_fcf.h:86
int out_octets
Octets fed out from the non-ECM buffer.
Definition: private/t38_gateway.h:96
void fsk_rx_signal_cutoff(fsk_rx_state_t *s, float cutoff)
Adjust an FSK modem receive context's carrier detect power threshold.
Definition: fsk.c:238
int fax_release(fax_state_t *s)
Release a FAX context.
Definition: fax.c:719
uint8_t buffer[HDLC_MAXFRAME_LEN+4]
Buffer for a frame in progress.
Definition: private/hdlc.h:71
void t38_gateway_set_tep_mode(t38_gateway_state_t *s, int use_tep)
Select whether TEP will be sent for the image modems.
Definition: t38_gateway.c:2428
fax_modems_state_t modems
The FAX modem set for the audio side fo the gateway.
Definition: private/t38_gateway.h:61
int short_train
TRUE if in image data modem is to use short training. This usually follows image_data_mode,...
Definition: private/t38_gateway.h:152
void t38_gateway_set_supported_modems(t38_gateway_state_t *s, int supported_modems)
Specify supported modems.
Definition: t38_gateway.c:2404
int hdlc_tx_corrupt_frame(hdlc_tx_state_t *s)
Corrupt the frame currently being transmitted, by giving it the wrong CRC.
Definition: hdlc.c:450
t30_state_t * t38_terminal_get_t30_state(t38_terminal_state_t *s)
Get a pointer to the T.30 engine associated with a T.38 context.
Definition: t38_terminal.c:1427
t38_rx_data_handler_t * rx_data_handler
Handler routine to process received data packets.
Definition: private/t38_core.h:42
@ T30_CTR
Definition: t30_fcf.h:68
void t38_non_ecm_buffer_report_input_status(t38_non_ecm_buffer_state_t *s, logging_state_t *logging)
Report the input status of a T.38 rate adapting non-ECM buffer context to the specified logging conte...
Definition: t38_non_ecm_buffer.c:309
@ T30_SUPPORT_T4_1D_COMPRESSION
Definition: t30.h:358
t38_gateway_hdlc_state_t hdlc_to_modem
Definition: private/t38_gateway.h:180
fsk_rx_state_t v21_rx
A V.21 FSK modem context used when receiving HDLC over V.21 messages.
Definition: private/fax_modems.h:54
int in
HDLC buffer number for input.
Definition: private/t38_gateway.h:132
void t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, int mode, int min_row_bits)
Set the mode of a T.38 rate adapting non-ECM buffer context.
Definition: t38_non_ecm_buffer.c:343
int contents
HDLC buffer contents.
Definition: private/t38_gateway.h:111
void bit_reverse(uint8_t to[], const uint8_t from[], int len)
Bit reverse each byte in a buffer.
Definition: bit_operations.c:79
int use_tep
Definition: private/fax_modems.h:37
int t30_set_supported_modems(t30_state_t *s, int supported_modems)
Specify supported modems.
Definition: t30_api.c:680
unsigned long int rx_crc_errors
The number of frames with CRC errors received.
Definition: private/hdlc.h:80
span_tx_handler_t * tx_handler
The current transmit signal handler.
Definition: private/fax_modems.h:104
A flow controlled non-ECM image data buffer, for buffering T.38 to analogue modem data.
Definition: private/t38_non_ecm_buffer.h:34
t38_core_state_t * t38_core_init(t38_core_state_t *s, t38_rx_indicator_handler_t *rx_indicator_handler, t38_rx_data_handler_t *rx_data_handler, t38_rx_missing_handler_t *rx_missing_handler, void *rx_user_data, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data)
Initialise a T.38 core context.
Definition: t38_core.c:1102
hdlc_tx_state_t hdlc_tx
An HDLC context used when transmitting HDLC messages.
Definition: private/fax_modems.h:46
const uint8_t * field
Definition: t38_core.h:194
v17_rx_state_t v17_rx
A V.29 modem context used when receiving FAXes at 7200bps, 9600bps 12000bps or 14400bps.
Definition: private/fax_modems.h:62
int pages_confirmed
The number of pages for which a confirm (MCF) message was returned.
Definition: private/t38_gateway.h:161
int field_len
Definition: t38_core.h:196
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.
Definition: t38_gateway.c:2398
int corrupt_current_frame[2]
TRUE if we need to corrupt the HDLC frame in progress, so the receiver cannot interpret it....
Definition: private/t38_gateway.h:44
int ms_per_tx_chunk
Required time between T.38 transmissions, in ms.
Definition: private/t38_gateway.h:147
void t38_set_data_transport_protocol(t38_core_state_t *s, int data_transport_protocol)
Definition: t38_core.c:998
int bits_absorbed
The number of bits taken from the modem for the current scan row. This is used during non-ECM transmi...
Definition: private/t38_gateway.h:82
@ T30_NSF
Definition: t30_fcf.h:37
logging_state_t * fax_get_logging_state(fax_state_t *s)
Get a pointer to the logging context associated with a FAX context.
Definition: fax.c:597
@ T30_SUPPORT_V17
Definition: t30.h:346
int supported_modems
A bit mask of the currently supported modem types.
Definition: private/t38_gateway.h:143
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.
Definition: t38_gateway.c:2434
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.
Definition: t38_gateway.c:2417
void t38_non_ecm_buffer_push(t38_non_ecm_buffer_state_t *s)
Inform a T.38 rate adapting non-ECM buffer context that the incoming data has finished,...
Definition: t38_non_ecm_buffer.c:121
int count_page_on_mcf
TRUE if we should count the next MCF as a page end, else FALSE.
Definition: private/t38_gateway.h:159
@ SIG_STATUS_TRAINING_SUCCEEDED
The modem has trained, and is ready for data exchange.
Definition: async.h:65
int t30_set_tx_ident(t30_state_t *s, const char *id)
Set the transmitted identifier associated with a T.30 context.
Definition: t30_api.c:90
uint8_t data[T38_RX_BUF_LEN]
non-ECM and HDLC modem receive data buffer.
Definition: private/t38_gateway.h:74
float v27ter_rx_signal_power(v27ter_rx_state_t *s)
Definition: v27ter_rx.c:152
Definition: t38_gateway.h:69
Definition: private/logging.h:34
int hdlc_tx_frame(hdlc_tx_state_t *s, const uint8_t *frame, size_t len)
Transmit a frame.
Definition: hdlc.c:389
@ T30_SUPPORT_T85_COMPRESSION
Definition: t30.h:364
@ T30_CTC
Definition: t30_fcf.h:60
int ecm_allowed
TRUE if ECM FAX mode is allowed through the gateway.
Definition: private/t38_gateway.h:145
int t30_set_ecm_capability(t30_state_t *s, int enabled)
Select ECM capability.
Definition: t30_api.c:637
void t38_set_t38_version(t38_core_state_t *s, int t38_version)
Definition: t38_core.c:1034
modem_connect_tones_tx_state_t connect_tx
CED or CNG generator.
Definition: private/fax_modems.h:79
int t38_gateway_release(t38_gateway_state_t *s)
Release a T.38 context.
Definition: t38_gateway.c:2560
fsk_tx_state_t v21_tx
A V.21 FSK modem context used when transmitting HDLC over V.21 messages.
Definition: private/fax_modems.h:51
logging_state_t * t38_terminal_get_logging_state(t38_terminal_state_t *s)
Get a pointer to the logging context associated with a T.38 context.
Definition: t38_terminal.c:1494
@ T30_NSC
Definition: t30_fcf.h:44
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.
Definition: t38_gateway.c:2386
int t38_gateway_release(t38_gateway_state_t *s)
Release a T.38 context.
Definition: t38_gateway.c:2560
int v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep)
Reinitialise an existing V.29 modem transmit context.
Definition: v29tx.c:332
int hdlc_tx_flags(hdlc_tx_state_t *s, int len)
Transmit a specified quantity of flag octets, typically as a preamble.
Definition: hdlc.c:424
void t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, int remove)
Select whether non-ECM fill bits are to be removed during transmission.
Definition: t38_terminal.c:1416
unsigned long int rx_aborts
The number of HDLC aborts received.
Definition: private/hdlc.h:84
t38_gateway_hdlc_buf_t buf[T38_TX_HDLC_BUFS]
HDLC message buffers.
Definition: private/t38_gateway.h:120
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.
Definition: t38_gateway.c:2494
float v17_rx_signal_power(v17_rx_state_t *s)
Definition: v17rx.c:182
unsigned int byte_in_progress
The destuffed bit stream buffer.
Definition: private/hdlc.h:59