private/t38_core.h

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  * $Id: t38_core.h,v 1.3 2009/04/12 14:18:02 steveu Exp $
00026  */
00027 
00028 #if !defined(_SPANDSP_PRIVATE_T38_CORE_H_)
00029 #define _SPANDSP_PRIVATE_T38_CORE_H_
00030 
00031 /*!
00032     Core T.38 state, common to all modes of T.38.
00033 */
00034 struct t38_core_state_s
00035 {
00036     /*! \brief Handler routine to transmit IFP packets generated by the T.38 protocol engine */
00037     t38_tx_packet_handler_t *tx_packet_handler;
00038     /*! \brief An opaque pointer passed to tx_packet_handler */
00039     void *tx_packet_user_data;
00040 
00041     /*! \brief Handler routine to process received indicator packets */
00042     t38_rx_indicator_handler_t *rx_indicator_handler;
00043     /*! \brief Handler routine to process received data packets */
00044     t38_rx_data_handler_t *rx_data_handler;
00045     /*! \brief Handler routine to process the missing packet condition */
00046     t38_rx_missing_handler_t *rx_missing_handler;
00047     /*! \brief An opaque pointer passed to any of the above receive handling routines */
00048     void *rx_user_data;
00049 
00050     /*! NOTE - Bandwidth reduction shall only be done on suitable Phase C data, i.e., MH, MR
00051         and - in the case of transcoding to JBIG - MMR. MMR and JBIG require reliable data
00052         transport such as that provided by TCP. When transcoding is selected, it shall be
00053         applied to every suitable page in a call. */
00054 
00055     /*! \brief Method 1: Local generation of TCF (required for use with TCP).
00056                Method 2: Transfer of TCF is required for use with UDP (UDPTL or RTP).
00057                Method 2 is not recommended for use with TCP. */
00058     int data_rate_management_method;
00059     
00060     /*! \brief The emitting gateway may indicate a preference for either UDP/UDPTL, or
00061                UDP/RTP, or TCP for transport of T.38 IFP Packets. The receiving device
00062                selects the transport protocol. */
00063     int data_transport_protocol;
00064 
00065     /*! \brief Indicates the capability to remove and insert fill bits in Phase C, non-ECM
00066         data to reduce bandwidth in the packet network. */
00067     int fill_bit_removal;
00068 
00069     /*! \brief Indicates the ability to convert to/from MMR from/to the line format to
00070         improve the compression of the data, and reduce the bandwidth, in the
00071         packet network. */
00072     int mmr_transcoding;
00073 
00074     /*! \brief Indicates the ability to convert to/from JBIG to reduce bandwidth. */
00075     int jbig_transcoding;
00076 
00077     /*! \brief For UDP (UDPTL or RTP) modes, this option indicates the maximum
00078                number of octets that can be stored on the remote device before an
00079                overflow condition occurs. It is the responsibility of the transmitting
00080                application to limit the transfer rate to prevent an overflow. The
00081                negotiated data rate should be used to determine the rate at which
00082                data is being removed from the buffer. */
00083     int max_buffer_size;
00084 
00085     /*! \brief This option indicates the maximum size of a UDPTL packet or the
00086                maximum size of the payload within an RTP packet that can be accepted 
00087                by the remote device. */
00088     int max_datagram_size;
00089 
00090     /*! \brief This is the version number of ITU-T Rec. T.38. New versions shall be
00091                compatible with previous versions. */
00092     int t38_version;
00093 
00094     /*! \brief Allow time for TEP playout */
00095     int allow_for_tep;
00096 
00097     /*! \brief The fastest data rate supported by the T.38 channel. */
00098     int fastest_image_data_rate;
00099 
00100     /*! \brief The number of times an indicator packet will be sent. Numbers greater than one
00101                will increase reliability for UDP transmission. Zero is valid, to suppress all
00102                indicator packets for TCP transmission. */
00103     int indicator_tx_count;
00104 
00105     /*! \brief The number of times a data packet which does not end transmission will be sent.
00106                Numbers greater than one will increase reliability for UDP transmission. Zero
00107                is not valid. */
00108     int data_tx_count;
00109 
00110     /*! \brief The number of times a data packet which ends transmission will be sent. Numbers
00111                greater than one will increase reliability for UDP transmission. Zero is not valid. */
00112     int data_end_tx_count;
00113 
00114     /*! \brief TRUE if IFP packet sequence numbers are relevant. For some transports, like TPKT
00115                over TCP they are not relevent. */
00116     int check_sequence_numbers;
00117 
00118     /*! \brief The sequence number for the next packet to be transmitted */
00119     int tx_seq_no;
00120     /*! \brief The sequence number expected in the next received packet */
00121     int rx_expected_seq_no;
00122 
00123     /*! \brief The current receive indicator - i.e. the last indicator received */
00124     int current_rx_indicator;
00125     /*! \brief The current receive data type - i.e. the last data type received */
00126     int current_rx_data_type;
00127     /*! \brief The current receive field type - i.e. the last field_type received */
00128     int current_rx_field_type;
00129     /*! \brief The current transmit indicator - i.e. the last indicator transmitted */
00130     int current_tx_indicator;
00131     /*! \brief The bit rate for V.34 operation */
00132     int v34_rate;
00133 
00134     /*! A count of missing receive packets. This count might not be accurate if the
00135         received packet numbers jump wildly. */
00136     int missing_packets;
00137 
00138     /*! \brief Error and flow logging control */
00139     logging_state_t logging;
00140 };
00141 
00142 #endif
00143 /*- End of file ------------------------------------------------------------*/

Generated on Tue Aug 4 03:36:06 2009 for spandsp by  doxygen 1.5.9