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.1 2008/11/30 13:44:35 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     /*! Handler routine to transmit IFP packets generated by the T.38 protocol engine */
00037     t38_tx_packet_handler_t *tx_packet_handler;
00038     /*! An opaque pointer passed to tx_packet_handler */
00039     void *tx_packet_user_data;
00040 
00041     /*! Handler routine to process received indicator packets */
00042     t38_rx_indicator_handler_t *rx_indicator_handler;
00043     /*! Handler routine to process received data packets */
00044     t38_rx_data_handler_t *rx_data_handler;
00045     /*! Handler routine to process the missing packet condition */
00046     t38_rx_missing_handler_t *rx_missing_handler;
00047     /*! 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     /*! 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     /*! 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     /*! 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     /*! 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     /*! Indicates the ability to convert to/from JBIG to reduce bandwidth. */
00075     int jbig_transcoding;
00076 
00077     /*! 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 overflow
00079         condition occurs. It is the responsibility of the transmitting application to
00080         limit the transfer rate to prevent an overflow. The negotiated data rate
00081         should be used to determine the rate at which data is being removed from
00082         the buffer. */
00083     int max_buffer_size;
00084 
00085     /*! 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 by
00087         the remote device. */
00088     int max_datagram_size;
00089 
00090     /*! 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     /*! The fastest data rate supported by the T.38 channel. */
00095     int fastest_image_data_rate;
00096 
00097     /*! \brief The number of times an indicator packet will be sent. Numbers greater than one
00098                will increase reliability for UDP transmission. Zero is valid, to suppress all
00099                indicator packets for TCP transmission. */
00100     int indicator_tx_count;
00101 
00102     /*! \brief The number of times a data packet which does not end transmission will be sent.
00103                Numbers greater than one will increase reliability for UDP transmission. Zero
00104                is not valid. */
00105     int data_tx_count;
00106 
00107     /*! \brief The number of times a data packet which ends transmission will be sent. Numbers
00108                greater than one will increase reliability for UDP transmission. Zero is not valid. */
00109     int data_end_tx_count;
00110 
00111     /*! TRUE if IFP packet sequence numbers are relevant. For some transports, like TPKT
00112         over TCP they are not relevent. */
00113     int check_sequence_numbers;
00114 
00115     /*! The sequence number for the next packet to be transmitted */
00116     int tx_seq_no;
00117     /*! The sequence number expected in the next received packet */
00118     int rx_expected_seq_no;
00119 
00120     /*! The current receive indicator - i.e. the last indicator received */
00121     int current_rx_indicator;
00122     /*! The current receive data type - i.e. the last data type received */
00123     int current_rx_data_type;
00124     /*! The current receive field type - i.e. the last field_type received */
00125     int current_rx_field_type;
00126     /*! The current transmit indicator - i.e. the last indicator transmitted */
00127     int current_tx_indicator;
00128     /*! The bit rate for V.34 operation */
00129     int v34_rate;
00130 
00131     /*! A count of missing receive packets. This count might not be accurate if the
00132         received packet numbers jump wildly. */
00133     int missing_packets;
00134 
00135     logging_state_t logging;
00136 };
00137 
00138 #endif
00139 /*- End of file ------------------------------------------------------------*/

Generated on Thu Feb 12 14:16:07 2009 for spandsp by  doxygen 1.5.5