00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * private/t38_core.h - An implementation of T.38, less the packet exchange part 00005 * 00006 * Written by Steve Underwood <steveu@coppice.org> 00007 * 00008 * Copyright (C) 2005 Steve Underwood 00009 * 00010 * All rights reserved. 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 2.1, 00014 * as published by the Free Software Foundation. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 */ 00025 00026 #if !defined(_SPANDSP_PRIVATE_T38_CORE_H_) 00027 #define _SPANDSP_PRIVATE_T38_CORE_H_ 00028 00029 /*! 00030 Core T.38 state, common to all modes of T.38. 00031 */ 00032 struct t38_core_state_s 00033 { 00034 /*! \brief Handler routine to transmit IFP packets generated by the T.38 protocol engine */ 00035 t38_tx_packet_handler_t *tx_packet_handler; 00036 /*! \brief An opaque pointer passed to tx_packet_handler */ 00037 void *tx_packet_user_data; 00038 00039 /*! \brief Handler routine to process received indicator packets */ 00040 t38_rx_indicator_handler_t *rx_indicator_handler; 00041 /*! \brief Handler routine to process received data packets */ 00042 t38_rx_data_handler_t *rx_data_handler; 00043 /*! \brief Handler routine to process the missing packet condition */ 00044 t38_rx_missing_handler_t *rx_missing_handler; 00045 /*! \brief An opaque pointer passed to any of the above receive handling routines */ 00046 void *rx_user_data; 00047 00048 /*! NOTE - Bandwidth reduction shall only be done on suitable Phase C data, i.e., MH, MR 00049 and - in the case of transcoding to JBIG - MMR. MMR and JBIG require reliable data 00050 transport such as that provided by TCP. When transcoding is selected, it shall be 00051 applied to every suitable page in a call. */ 00052 00053 /*! \brief Method 1: Local generation of TCF (required for use with TCP). 00054 Method 2: Transfer of TCF is required for use with UDP (UDPTL or RTP). 00055 Method 2 is not recommended for use with TCP. */ 00056 int data_rate_management_method; 00057 00058 /*! \brief The emitting gateway may indicate a preference for either UDP/UDPTL, or 00059 UDP/RTP, or TCP for transport of T.38 IFP Packets. The receiving device 00060 selects the transport protocol. */ 00061 int data_transport_protocol; 00062 00063 /*! \brief Indicates the capability to remove and insert fill bits in Phase C, non-ECM 00064 data to reduce bandwidth in the packet network. */ 00065 int fill_bit_removal; 00066 00067 /*! \brief Indicates the ability to convert to/from MMR from/to the line format to 00068 improve the compression of the data, and reduce the bandwidth, in the 00069 packet network. */ 00070 int mmr_transcoding; 00071 00072 /*! \brief Indicates the ability to convert to/from JBIG to reduce bandwidth. */ 00073 int jbig_transcoding; 00074 00075 /*! \brief For UDP (UDPTL or RTP) modes, this option indicates the maximum 00076 number of octets that can be stored on the remote device before an 00077 overflow condition occurs. It is the responsibility of the transmitting 00078 application to limit the transfer rate to prevent an overflow. The 00079 negotiated data rate should be used to determine the rate at which 00080 data is being removed from the buffer. */ 00081 int max_buffer_size; 00082 00083 /*! \brief This option indicates the maximum size of a UDPTL packet or the 00084 maximum size of the payload within an RTP packet that can be accepted 00085 by the remote device. */ 00086 int max_datagram_size; 00087 00088 /*! \brief This is the version number of ITU-T Rec. T.38. New versions shall be 00089 compatible with previous versions. */ 00090 int t38_version; 00091 00092 /*! \brief Allow time for TEP playout */ 00093 int allow_for_tep; 00094 00095 /*! \brief The fastest data rate supported by the T.38 channel. */ 00096 int fastest_image_data_rate; 00097 00098 /*! \brief The number of times each packet type will be sent (low byte). The 00099 depth of redundancy (2nd byte). Higher numbers may increase reliability 00100 for UDP transmission. Zero is valid for the indicator packet category, 00101 to suppress all indicator packets (typicaly for TCP transmission). */ 00102 int category_control[5]; 00103 00104 /*! \brief TRUE if IFP packet sequence numbers are relevant. For some transports, like TPKT 00105 over TCP they are not relevent. */ 00106 int check_sequence_numbers; 00107 00108 /*! \brief The sequence number for the next packet to be transmitted */ 00109 int tx_seq_no; 00110 /*! \brief The sequence number expected in the next received packet */ 00111 int rx_expected_seq_no; 00112 00113 /*! \brief The current receive indicator - i.e. the last indicator received */ 00114 int current_rx_indicator; 00115 /*! \brief The current receive data type - i.e. the last data type received */ 00116 int current_rx_data_type; 00117 /*! \brief The current receive field type - i.e. the last field_type received */ 00118 int current_rx_field_type; 00119 /*! \brief The current transmit indicator - i.e. the last indicator transmitted */ 00120 int current_tx_indicator; 00121 /*! \brief The bit rate for V.34 operation */ 00122 int v34_rate; 00123 00124 /*! A count of missing receive packets. This count might not be accurate if the 00125 received packet numbers jump wildly. */ 00126 int missing_packets; 00127 00128 /*! \brief Error and flow logging control */ 00129 logging_state_t logging; 00130 }; 00131 00132 #endif 00133 /*- End of file ------------------------------------------------------------*/