spandsp  3.0.0
private/t38_core.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/t38_core.h - An implementation of T.38, less the packet exchange part
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2005 Steve Underwood
9  *
10  * All rights reserved.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 2.1,
14  * as published by the Free Software Foundation.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 #if !defined(_SPANDSP_PRIVATE_T38_CORE_H_)
27 #define _SPANDSP_PRIVATE_T38_CORE_H_
28 
29 /*!
30  Core T.38 state, common to all modes of T.38. Higher layers should support the specifics
31  of a gateway, terminal, T.31 interface, etc and incorporate an instance of this structure
32  to handle the basics of T.38, mostly IFP.
33 */
35 {
36  /*! \brief Handler routine to transmit IFP packets generated by the T.38 protocol engine */
37  t38_tx_packet_handler_t tx_packet_handler;
38  /*! \brief An opaque pointer passed to tx_packet_handler */
40 
41  /*! \brief Handler routine to process received indicator packets */
42  t38_rx_indicator_handler_t rx_indicator_handler;
43  /*! \brief Handler routine to process received data packets */
44  t38_rx_data_handler_t rx_data_handler;
45  /*! \brief Handler routine to process the missing packet condition */
46  t38_rx_missing_handler_t rx_missing_handler;
47  /*! \brief An opaque pointer passed to any of the above receive handling routines */
48  void *rx_user_data;
49 
50  /*! \brief Required time between T.38 transmissions, in us. */
52  /*! \brief Bit fields controlling the way data is packed into chunks for transmission. */
54  /*! \brief Internet Aware FAX mode bit mask. */
55  int iaf;
56 
57  /*! NOTE - Bandwidth reduction shall only be done on suitable Phase C data, i.e., MH, MR
58  and - in the case of transcoding to JBIG - MMR. MMR and JBIG require reliable data
59  transport such as that provided by TCP. When transcoding is selected, it shall be
60  applied to every suitable page in a call. */
61 
62  /*! \brief Method 1: Local generation of TCF (required for use with TCP).
63  Method 2: Transfer of TCF is required for use with UDP (UDPTL or RTP).
64  Method 2 is not recommended for use with TCP. */
66 
67  /*! \brief The emitting gateway may indicate a preference for either UDP/UDPTL, or
68  UDP/RTP, or TCP for transport of T.38 IFP Packets. The receiving device
69  selects the transport protocol. */
71 
72  /*! \brief Indicates the capability to remove and insert fill bits in Phase C, non-ECM
73  data to reduce bandwidth in the packet network. */
75 
76  /*! \brief Indicates the ability to convert to/from MMR from/to the line format to
77  improve the compression of the data, and reduce the bandwidth, in the
78  packet network. */
80 
81  /*! \brief Indicates the ability to convert to/from JBIG to reduce bandwidth. */
83 
84  /*! \brief For UDP (UDPTL or RTP) modes, this option indicates the maximum
85  number of octets that can be stored on the remote device before an
86  overflow condition occurs. It is the responsibility of the transmitting
87  application to limit the transfer rate to prevent an overflow. The
88  negotiated data rate should be used to determine the rate at which
89  data is being removed from the buffer. */
91 
92  /*! \brief This option indicates the maximum size of a UDPTL packet or the
93  maximum size of the payload within an RTP packet that can be accepted
94  by the remote device. */
96 
97  /*! \brief This is the version number of ITU-T Rec. T.38. New versions shall be
98  compatible with previous versions. */
100 
101  /*! \brief Allow time for TEP playout */
103 
104  /*! \brief The fastest data rate supported by the T.38 channel. */
106 
107  /*! \brief Pace transmission */
109 
110  /*! \brief True if IFP packet sequence numbers are relevant. For some transports, like TPKT
111  over TCP they are not relevent. */
113 
114  /*! \brief The number of times each packet type will be sent (low byte). The
115  depth of redundancy (2nd byte). Higher numbers may increase reliability
116  for UDP transmission. Zero is valid for the indicator packet category,
117  to suppress all indicator packets (typicaly for TCP transmission). */
119 
120  /*! \brief The sequence number for the next packet to be transmitted */
122  /*! \brief The sequence number expected in the next received packet */
124 
125  /*! \brief The current receive indicator - i.e. the last indicator received */
127  /*! \brief The current receive data type - i.e. the last data type received */
129  /*! \brief The current receive field type - i.e. the last field_type received */
131  /*! \brief The current transmit indicator - i.e. the last indicator transmitted */
133  /*! \brief The bit rate for V.34 operation */
134  int v34_rate;
135 
136  /*! A count of missing receive packets. This count might not be accurate if the
137  received packet numbers jump wildly. */
139 
140  /*! \brief Error and flow logging control */
142 };
143 
144 #endif
145 /*- End of file ------------------------------------------------------------*/
int iaf
Internet Aware FAX mode bit mask.
Definition: private/t38_core.h:55
t38_rx_data_handler_t rx_data_handler
Handler routine to process received data packets.
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:70
int fastest_image_data_rate
The fastest data rate supported by the T.38 channel.
Definition: private/t38_core.h:105
int data_rate_management_method
Method 1: Local generation of TCF (required for use with TCP). Method 2: Transfer of TCF is required ...
Definition: private/t38_core.h:65
int v34_rate
The bit rate for V.34 operation.
Definition: private/t38_core.h:134
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:95
int rx_expected_seq_no
The sequence number expected in the next received packet.
Definition: private/t38_core.h:123
void * tx_packet_user_data
An opaque pointer passed to tx_packet_handler.
Definition: private/t38_core.h:39
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:99
int missing_packets
Definition: private/t38_core.h:138
int jbig_transcoding
Indicates the ability to convert to/from JBIG to reduce bandwidth.
Definition: private/t38_core.h:82
logging_state_t logging
Error and flow logging control.
Definition: private/t38_core.h:141
void * rx_user_data
An opaque pointer passed to any of the above receive handling routines.
Definition: private/t38_core.h:48
int current_rx_data_type
The current receive data type - i.e. the last data type received.
Definition: private/t38_core.h:128
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:37
int pace_transmission
Pace transmission.
Definition: private/t38_core.h:108
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:74
Definition: private/logging.h:33
int chunking_modes
Bit fields controlling the way data is packed into chunks for transmission.
Definition: private/t38_core.h:53
t38_rx_indicator_handler_t rx_indicator_handler
Handler routine to process received indicator packets.
Definition: private/t38_core.h:42
int current_rx_indicator
The current receive indicator - i.e. the last indicator received.
Definition: private/t38_core.h:126
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:79
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:90
int tx_seq_no
The sequence number for the next packet to be transmitted.
Definition: private/t38_core.h:121
int current_rx_field_type
The current receive field type - i.e. the last field_type received.
Definition: private/t38_core.h:130
int allow_for_tep
Allow time for TEP playout.
Definition: private/t38_core.h:102
int current_tx_indicator
The current transmit indicator - i.e. the last indicator transmitted.
Definition: private/t38_core.h:132
bool check_sequence_numbers
True if IFP packet sequence numbers are relevant. For some transports, like TPKT over TCP they are no...
Definition: private/t38_core.h:112
Definition: private/t38_core.h:34
int microseconds_per_tx_chunk
Required time between T.38 transmissions, in us.
Definition: private/t38_core.h:51
t38_rx_missing_handler_t rx_missing_handler
Handler routine to process the missing packet condition.
Definition: private/t38_core.h:46
int category_control[5]
The number of times each packet type will be sent (low byte). The depth of redundancy (2nd byte)...
Definition: private/t38_core.h:118