Go to the documentation of this file.
28 #if !defined(_SPANDSP_PRIVATE_T38_TERMINAL_H_)
29 #define _SPANDSP_PRIVATE_T38_TERMINAL_H_
int field_type
Definition: t38_core.h:192
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
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
int rx_data_missing
TRUE is there has been some T.38 data missed (i.e. lost packets) in the current reception period.
Definition: private/t38_terminal.h:51
@ T38_TERMINAL_OPTION_2S_REPEATING_INDICATORS
Definition: t38_terminal.h:50
int v34_rate
The bit rate for V.34 operation.
Definition: private/t38_core.h:125
int current_rx_field_type
The current receive field type - i.e. the last field_type received.
Definition: private/t38_core.h:121
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,...
Definition: t30.c:5833
int32_t timeout_rx_samples
The current receive timeout.
Definition: private/t38_terminal.h:104
@ T38_TERMINAL_OPTION_NO_PACING
Definition: t38_terminal.h:44
int t38_terminal_free(t38_terminal_state_t *s)
Free a T.38 context.
Definition: t38_terminal.c:1556
int tx_bit_rate
Current transmission bit rate.
Definition: private/t38_terminal.h:96
@ T30_FRONT_END_RECEIVE_COMPLETE
Definition: t30.h:332
void t30_set_iaf_mode(t30_state_t *s, int iaf)
Set Internet aware FAX (IAF) mode.
Definition: t30_api.c:631
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
#define DATA_END_TX_COUNT
Definition: t31.c:121
void t38_set_redundancy_control(t38_core_state_t *s, int category, int setting)
Send a data packet.
Definition: t38_core.c:1058
int t38_core_send_training_delay(t38_core_state_t *s, int indicator)
Find the delay to allow for modem training after sending an indicator.
Definition: t38_core.c:940
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
int t30_non_ecm_get_chunk(void *user_data, uint8_t buf[], int max_len)
Get a bit of received non-ECM image data.
Definition: t30.c:5608
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
Definition: private/t38_terminal.h:31
int t30_release(t30_state_t *s)
Release a T.30 context.
Definition: t30.c:6368
Definition: private/t38_core.h:32
void t38_set_tep_handling(t38_core_state_t *s, int allow_for_tep)
Definition: t38_core.c:1052
int rx_signal_present
TRUE if a carrier is present. Otherwise FALSE.
Definition: private/t38_terminal.h:88
@ T38_PACKET_CATEGORY_CONTROL_DATA
Control data packet.
Definition: t38_core.h:176
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_terminal.h:55
const char * t30_frametype(uint8_t x)
Return a text name for a T.30 frame type.
Definition: t30_logging.c:241
int us_per_tx_chunk
Required time between T.38 transmissions, in microseconds.
Definition: private/t38_terminal.h:36
@ T38_PACKET_CATEGORY_INDICATOR
Indicator packet.
Definition: t38_core.h:174
void t38_terminal_set_config(t38_terminal_state_t *s, int config)
Set configuration options.
Definition: t38_terminal.c:1354
Definition: t38_core.h:189
void t30_non_ecm_put_chunk(void *user_data, const uint8_t buf[], int len)
Process a chunk of received non-ECM image data.
Definition: t30.c:5498
logging_state_t logging
Error and flow logging control.
Definition: private/t38_terminal.h:119
#define DATA_TX_COUNT
Definition: t31.c:119
int bit_no
The current bit number in the current non-ECM octet.
Definition: private/t38_non_ecm_buffer.h:63
int current_tx_type
The current operating mode of the transmitter.
Definition: private/t38_terminal.h:93
void t30_timer_update(t30_state_t *s, int samples)
Report the passage of time to the T.30 engine.
Definition: t30.c:6127
int non_ecm_trailer_bytes
Counter for trailing non-ECM bytes, used to flush out the far end's modem.
Definition: private/t38_terminal.h:80
uint8_t buf[T38_MAX_HDLC_LEN]
HDLC receive buffer.
Definition: private/t38_terminal.h:60
int current_tx_indicator
The current transmit indicator - i.e. the last indicator transmitted.
Definition: private/t38_core.h:123
@ T38_PACKET_CATEGORY_IMAGE_DATA
Image data packet.
Definition: t38_core.h:180
int current_rx_type
The current operating mode of the receiver.
Definition: private/t38_terminal.h:91
int extra_bits
The number of extra bits in a fully stuffed version of the contents of the HDLC transmit buffer....
Definition: private/t38_terminal.h:76
#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
int current_tx_data_type
The current T.38 data type being transmitted.
Definition: private/t38_terminal.h:85
@ T30_SUPPORT_IAF
Definition: t30.h:350
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
@ T30_SUPPORT_V29
Definition: t30.h:344
t38_terminal_front_end_state_t t38_fe
The T.38 front-end.
Definition: private/t38_terminal.h:116
@ SIG_STATUS_CARRIER_DOWN
The carrier signal has dropped.
Definition: async.h:54
int t38_core_send_flags_delay(t38_core_state_t *s, int indicator)
Find the delay to allow for HDLC flags after sending an indicator.
Definition: t38_core.c:932
Definition: private/t38_terminal.h:110
@ T30_SUPPORT_V27TER
Definition: t30.h:342
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
int32_t samples
A "sample" count, used to time events.
Definition: private/t38_terminal.h:98
int current_rx_indicator
The current receive indicator - i.e. the last indicator received.
Definition: private/t38_core.h:117
void t30_terminate(t30_state_t *s)
Cleanup a T.30 context if the call terminates.
Definition: t30.c:6196
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
@ T38_PACKET_CATEGORY_CONTROL_DATA_END
Terminating control data packet.
Definition: t38_core.h:178
int span_log(logging_state_t *s, int level, const char *format,...)
Generate a log entry.
Definition: logging.c:84
int len
The length of the contents of the HDLC receive buffer.
Definition: private/t38_terminal.h:62
@ T38_TERMINAL_OPTION_NO_INDICATORS
Definition: t38_terminal.h:53
@ T38_TERMINAL_OPTION_REGULAR_INDICATORS
Definition: t38_terminal.h:47
int timed_step
The current transmit step being timed.
Definition: private/t38_terminal.h:44
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
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
int queued_timed_step
The timed step to go to when we reach idle from the current timed step.
Definition: private/t38_terminal.h:47
Definition: private/t30.h:35
@ T38_PACKET_CATEGORY_IMAGE_DATA_END
Terminating image data packet.
Definition: t38_core.h:182
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
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
int32_t next_tx_samples
The value for samples at the next transmission point.
Definition: private/t38_terminal.h:100
int t38_core_send_indicator(t38_core_state_t *s, int indicator)
Send an indicator packet.
Definition: t38_core.c:889
int32_t timeout_tx_samples
The current transmit timeout.
Definition: private/t38_terminal.h:102
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
int ptr
Current pointer within the contents of the HDLC transmit buffer.
Definition: private/t38_terminal.h:72
t30_state_t t30
The T.30 back-end.
Definition: private/t38_terminal.h:113
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
int t38_core_restart(t38_core_state_t *s)
Restart a T.38 core context.
Definition: t38_core.c:1082
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
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 t38_terminal_restart(t38_terminal_state_t *s, int calling_party)
Reinitialise a termination mode T.38 context.
Definition: t38_terminal.c:1500
int t30_set_supported_modems(t30_state_t *s, int supported_modems)
Specify supported modems.
Definition: t30_api.c:680
A flow controlled non-ECM image data buffer, for buffering T.38 to analogue modem data.
Definition: private/t38_non_ecm_buffer.h:33
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
const uint8_t * field
Definition: t38_core.h:194
int field_len
Definition: t38_core.h:196
int iaf
Internet Aware FAX mode bit mask.
Definition: private/t38_terminal.h:34
int t30_restart(t30_state_t *s)
Restart a T.30 context.
Definition: t30.c:6287
@ T30_SUPPORT_V17
Definition: t30.h:346
#define INDICATOR_TX_COUNT
Definition: t31.c:117
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
@ SIG_STATUS_TRAINING_SUCCEEDED
The modem has trained, and is ready for data exchange.
Definition: async.h:65
int t38_terminal_release(t38_terminal_state_t *s)
Release a T.38 context.
Definition: t38_terminal.c:1549
@ T30_IAF_MODE_NO_FILL_BITS
Definition: t30.h:465
Definition: private/logging.h:33
t38_core_state_t t38
Core T.38 IFP support.
Definition: private/t38_terminal.h:41
int next_tx_indicator
The next T.38 indicator queued for transmission.
Definition: private/t38_terminal.h:83
@ SIG_STATUS_END_OF_DATA
The data stream has ended.
Definition: async.h:71
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.
Definition: t30.c:6327
int chunking_modes
Bit fields controlling the way data is packed into chunked for transmission.
Definition: private/t38_terminal.h:38