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.4 2009/07/14 13:54:22 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 each packet type will be sent (low byte). The 
00101                depth of redundancy (2nd byte). Higher numbers may increase reliability
00102                for UDP transmission. Zero is valid for the indicator packet category,
00103                to suppress all indicator packets (typicaly for TCP transmission). */
00104     int category_control[5];
00105 
00106     /*! \brief TRUE if IFP packet sequence numbers are relevant. For some transports, like TPKT
00107                over TCP they are not relevent. */
00108     int check_sequence_numbers;
00109 
00110     /*! \brief The sequence number for the next packet to be transmitted */
00111     int tx_seq_no;
00112     /*! \brief The sequence number expected in the next received packet */
00113     int rx_expected_seq_no;
00114 
00115     /*! \brief The current receive indicator - i.e. the last indicator received */
00116     int current_rx_indicator;
00117     /*! \brief The current receive data type - i.e. the last data type received */
00118     int current_rx_data_type;
00119     /*! \brief The current receive field type - i.e. the last field_type received */
00120     int current_rx_field_type;
00121     /*! \brief The current transmit indicator - i.e. the last indicator transmitted */
00122     int current_tx_indicator;
00123     /*! \brief The bit rate for V.34 operation */
00124     int v34_rate;
00125 
00126     /*! A count of missing receive packets. This count might not be accurate if the
00127         received packet numbers jump wildly. */
00128     int missing_packets;
00129 
00130     /*! \brief Error and flow logging control */
00131     logging_state_t logging;
00132 };
00133 
00134 #endif
00135 /*- End of file ------------------------------------------------------------*/

Generated on Tue Jan 11 14:08:44 2011 for spandsp by  doxygen 1.4.7