28#if !defined(_SPANDSP_T38_CORE_H_)
29#define _SPANDSP_T38_CORE_H_
75 T38_IND_NO_SIGNAL = 0,
79 T38_IND_V27TER_2400_TRAINING,
80 T38_IND_V27TER_4800_TRAINING,
81 T38_IND_V29_7200_TRAINING,
82 T38_IND_V29_9600_TRAINING,
83 T38_IND_V17_7200_SHORT_TRAINING,
84 T38_IND_V17_7200_LONG_TRAINING,
85 T38_IND_V17_9600_SHORT_TRAINING,
86 T38_IND_V17_9600_LONG_TRAINING,
87 T38_IND_V17_12000_SHORT_TRAINING,
88 T38_IND_V17_12000_LONG_TRAINING,
89 T38_IND_V17_14400_SHORT_TRAINING,
90 T38_IND_V17_14400_LONG_TRAINING,
93 T38_IND_V34_CNTL_CHANNEL_1200,
94 T38_IND_V34_PRI_CHANNEL,
95 T38_IND_V34_CC_RETRAIN,
96 T38_IND_V33_12000_TRAINING,
97 T38_IND_V33_14400_TRAINING
105 T38_DATA_V27TER_2400,
106 T38_DATA_V27TER_4800,
114 T38_DATA_V34_PRI_RATE,
115 T38_DATA_V34_CC_1200,
124 T38_FIELD_HDLC_DATA = 0,
125 T38_FIELD_HDLC_SIG_END,
126 T38_FIELD_HDLC_FCS_OK,
127 T38_FIELD_HDLC_FCS_BAD,
128 T38_FIELD_HDLC_FCS_OK_SIG_END,
129 T38_FIELD_HDLC_FCS_BAD_SIG_END,
130 T38_FIELD_T4_NON_ECM_DATA,
131 T38_FIELD_T4_NON_ECM_SIG_END,
132 T38_FIELD_CM_MESSAGE,
133 T38_FIELD_JM_MESSAGE,
134 T38_FIELD_CI_MESSAGE,
141 T38_FIELD_CLASS_NONE = 0,
142 T38_FIELD_CLASS_HDLC,
143 T38_FIELD_CLASS_NON_ECM
149 T38_TYPE_OF_MSG_T30_INDICATOR = 0,
150 T38_TYPE_OF_MSG_T30_DATA
156 T38_TRANSPORT_UDPTL = 0,
159 T38_TRANSPORT_TCP_TPKT
165 T38_DATA_RATE_MANAGEMENT_LOCAL_TCF = 1,
166 T38_DATA_RATE_MANAGEMENT_TRANSFERRED_TCF = 2
185#define T38_RX_BUF_LEN 2048
186#define T38_TX_BUF_LEN 16384
204typedef int (t38_tx_packet_handler_t)(
t38_core_state_t *s,
void *user_data,
const uint8_t *buf,
int len,
int count);
206typedef int (t38_rx_indicator_handler_t)(
t38_core_state_t *s,
void *user_data,
int indicator);
207typedef int (t38_rx_data_handler_t)(
t38_core_state_t *s,
void *user_data,
int data_type,
int field_type,
const uint8_t *buf,
int len);
208typedef int (t38_rx_missing_handler_t)(
t38_core_state_t *s,
void *user_data,
int rx_seq_no,
int expected_seq_no);
210#if defined(__cplusplus)
239SPAN_DECLARE(
const char *)
t38_jm_to_str(
const uint8_t *data,
int len);
354SPAN_DECLARE(
void) t38_set_fastest_image_data_rate(
t38_core_state_t *s,
int max_rate);
420#if defined(__cplusplus)
Definition: private/logging.h:34
Definition: private/t38_core.h:33
int max_buffer_size
For UDP (UDPTL or RTP) modes, this option indicates the maximum number of octets that can be stored o...
Definition: private/t38_core.h:81
int fill_bit_removal
Indicates the capability to remove and insert fill bits in Phase C, non-ECM data to reduce bandwidth ...
Definition: private/t38_core.h:65
t38_rx_missing_handler_t * rx_missing_handler
Handler routine to process the missing packet condition.
Definition: private/t38_core.h:44
int data_transport_protocol
The emitting gateway may indicate a preference for either UDP/UDPTL, or UDP/RTP, or TCP for transport...
Definition: private/t38_core.h:61
int max_datagram_size
This option indicates the maximum size of a UDPTL packet or the maximum size of the payload within an...
Definition: private/t38_core.h:86
void * rx_user_data
An opaque pointer passed to any of the above receive handling routines.
Definition: private/t38_core.h:46
int pace_transmission
Pace transmission.
Definition: private/t38_core.h:99
int jbig_transcoding
Indicates the ability to convert to/from JBIG to reduce bandwidth.
Definition: private/t38_core.h:73
t38_rx_indicator_handler_t * rx_indicator_handler
Handler routine to process received indicator packets.
Definition: private/t38_core.h:40
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
t38_rx_data_handler_t * rx_data_handler
Handler routine to process received data packets.
Definition: private/t38_core.h:42
void * tx_packet_user_data
An opaque pointer passed to tx_packet_handler.
Definition: private/t38_core.h:37
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 mmr_transcoding
Indicates the ability to convert to/from MMR from/to the line format to improve the compression of th...
Definition: private/t38_core.h:70
int allow_for_tep
Allow time for TEP playout.
Definition: private/t38_core.h:93
Definition: t38_core.h:190
const uint8_t * field
Definition: t38_core.h:194
int field_len
Definition: t38_core.h:196
int field_type
Definition: t38_core.h:192
const char * t38_data_type_to_str(int data_type)
Convert the code for a type of data to a short text name.
Definition: t38_core.c:148
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 t38_core_restart(t38_core_state_t *s)
Restart a T.38 core context.
Definition: t38_core.c:1082
void t38_set_data_rate_management_method(t38_core_state_t *s, int method)
Definition: t38_core.c:992
void t38_set_t38_version(t38_core_state_t *s, int t38_version)
Definition: t38_core.c:1034
void t38_set_sequence_number_handling(t38_core_state_t *s, int check)
Definition: t38_core.c:1040
void t38_set_data_transport_protocol(t38_core_state_t *s, int data_transport_protocol)
Definition: t38_core.c:998
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
t38_data_types_e
Definition: t38_core.h:102
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 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
void t38_set_mmr_transcoding(t38_core_state_t *s, int mmr_transcoding)
Definition: t38_core.c:1010
t38_transport_types_e
Definition: t38_core.h:155
t38_data_rate_management_types_e
Definition: t38_core.h:164
int t38_core_send_indicator(t38_core_state_t *s, int indicator)
Send an indicator packet.
Definition: t38_core.c:889
t38_field_classes_e
Definition: t38_core.h:140
void t38_set_tep_handling(t38_core_state_t *s, int allow_for_tep)
Definition: t38_core.c:1052
void t38_set_fill_bit_removal(t38_core_state_t *s, int fill_bit_removal)
Definition: t38_core.c:1004
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
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
t38_packet_categories_e
Definition: t38_core.h:172
@ T38_PACKET_CATEGORY_IMAGE_DATA
Image data packet.
Definition: t38_core.h:180
@ T38_PACKET_CATEGORY_CONTROL_DATA_END
Terminating control data packet.
Definition: t38_core.h:178
@ T38_PACKET_CATEGORY_IMAGE_DATA_END
Terminating image data packet.
Definition: t38_core.h:182
@ T38_PACKET_CATEGORY_INDICATOR
Indicator packet.
Definition: t38_core.h:174
@ T38_PACKET_CATEGORY_CONTROL_DATA
Control data packet.
Definition: t38_core.h:176
t38_message_types_e
Definition: t38_core.h:148
int t38_core_release(t38_core_state_t *s)
Release a signaling tone transmitter context.
Definition: t38_core.c:1151
t30_indicator_types_e
Definition: t38_core.h:74
int t38_core_free(t38_core_state_t *s)
Free a signaling tone transmitter context.
Definition: t38_core.c:1157
SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_packet(t38_core_state_t *s
Process a received T.38 IFP packet from an unreliable packet stream (e.g. UDPTL or RTP)....
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
t38_field_types_e
Definition: t38_core.h:123
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
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
void t38_set_max_datagram_size(t38_core_state_t *s, int max_datagram_size)
Definition: t38_core.c:1028
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
void t38_set_jbig_transcoding(t38_core_state_t *s, int jbig_transcoding)
Definition: t38_core.c:1016
void t38_set_max_buffer_size(t38_core_state_t *s, int max_buffer_size)
Definition: t38_core.c:1022
const char * t38_field_type_to_str(int field_type)
Convert the code for a type of data field to a short text name.
Definition: t38_core.c:187
void t38_set_redundancy_control(t38_core_state_t *s, int category, int setting)
Send a data packet.
Definition: t38_core.c:1058