comparison spandsp-0.0.6pre17/src/spandsp/private/t38_core.h @ 4:26cd8f1ef0b1

import spandsp-0.0.6pre17
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Fri, 25 Jun 2010 15:50:58 +0200
parents
children
comparison
equal deleted inserted replaced
3:c6c5a16ce2f2 4:26cd8f1ef0b1
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 * $Id: t38_core.h,v 1.4 2009/07/14 13:54:22 steveu Exp $
26 */
27
28 #if !defined(_SPANDSP_PRIVATE_T38_CORE_H_)
29 #define _SPANDSP_PRIVATE_T38_CORE_H_
30
31 /*!
32 Core T.38 state, common to all modes of T.38.
33 */
34 struct t38_core_state_s
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 */
39 void *tx_packet_user_data;
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 /*! NOTE - Bandwidth reduction shall only be done on suitable Phase C data, i.e., MH, MR
51 and - in the case of transcoding to JBIG - MMR. MMR and JBIG require reliable data
52 transport such as that provided by TCP. When transcoding is selected, it shall be
53 applied to every suitable page in a call. */
54
55 /*! \brief Method 1: Local generation of TCF (required for use with TCP).
56 Method 2: Transfer of TCF is required for use with UDP (UDPTL or RTP).
57 Method 2 is not recommended for use with TCP. */
58 int data_rate_management_method;
59
60 /*! \brief The emitting gateway may indicate a preference for either UDP/UDPTL, or
61 UDP/RTP, or TCP for transport of T.38 IFP Packets. The receiving device
62 selects the transport protocol. */
63 int data_transport_protocol;
64
65 /*! \brief Indicates the capability to remove and insert fill bits in Phase C, non-ECM
66 data to reduce bandwidth in the packet network. */
67 int fill_bit_removal;
68
69 /*! \brief Indicates the ability to convert to/from MMR from/to the line format to
70 improve the compression of the data, and reduce the bandwidth, in the
71 packet network. */
72 int mmr_transcoding;
73
74 /*! \brief Indicates the ability to convert to/from JBIG to reduce bandwidth. */
75 int jbig_transcoding;
76
77 /*! \brief For UDP (UDPTL or RTP) modes, this option indicates the maximum
78 number of octets that can be stored on the remote device before an
79 overflow condition occurs. It is the responsibility of the transmitting
80 application to limit the transfer rate to prevent an overflow. The
81 negotiated data rate should be used to determine the rate at which
82 data is being removed from the buffer. */
83 int max_buffer_size;
84
85 /*! \brief This option indicates the maximum size of a UDPTL packet or the
86 maximum size of the payload within an RTP packet that can be accepted
87 by the remote device. */
88 int max_datagram_size;
89
90 /*! \brief This is the version number of ITU-T Rec. T.38. New versions shall be
91 compatible with previous versions. */
92 int t38_version;
93
94 /*! \brief Allow time for TEP playout */
95 int allow_for_tep;
96
97 /*! \brief The fastest data rate supported by the T.38 channel. */
98 int fastest_image_data_rate;
99
100 /*! \brief The number of times each packet type will be sent (low byte). The
101 depth of redundancy (2nd byte). Higher numbers may increase reliability
102 for UDP transmission. Zero is valid for the indicator packet category,
103 to suppress all indicator packets (typicaly for TCP transmission). */
104 int category_control[5];
105
106 /*! \brief TRUE if IFP packet sequence numbers are relevant. For some transports, like TPKT
107 over TCP they are not relevent. */
108 int check_sequence_numbers;
109
110 /*! \brief The sequence number for the next packet to be transmitted */
111 int tx_seq_no;
112 /*! \brief The sequence number expected in the next received packet */
113 int rx_expected_seq_no;
114
115 /*! \brief The current receive indicator - i.e. the last indicator received */
116 int current_rx_indicator;
117 /*! \brief The current receive data type - i.e. the last data type received */
118 int current_rx_data_type;
119 /*! \brief The current receive field type - i.e. the last field_type received */
120 int current_rx_field_type;
121 /*! \brief The current transmit indicator - i.e. the last indicator transmitted */
122 int current_tx_indicator;
123 /*! \brief The bit rate for V.34 operation */
124 int v34_rate;
125
126 /*! A count of missing receive packets. This count might not be accurate if the
127 received packet numbers jump wildly. */
128 int missing_packets;
129
130 /*! \brief Error and flow logging control */
131 logging_state_t logging;
132 };
133
134 #endif
135 /*- End of file ------------------------------------------------------------*/

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.