spandsp
0.0.6
Main Page
Related Pages
Classes
Files
File List
File Members
private/t38_gateway.h
Go to the documentation of this file.
1
/*
2
* SpanDSP - a series of DSP components for telephony
3
*
4
* private/t38_gateway.h - A T.38, less the packet exchange part
5
*
6
* Written by Steve Underwood <steveu@coppice.org>
7
*
8
* Copyright (C) 2005, 2006, 2007 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
26
/*! \file */
27
28
#if !defined(_SPANDSP_PRIVATE_T38_GATEWAY_H_)
29
#define _SPANDSP_PRIVATE_T38_GATEWAY_H_
30
31
/*!
32
T.38 gateway T.38 side channel descriptor.
33
*/
34
typedef
struct
35
{
36
/*! \brief Core T.38 IFP support */
37
t38_core_state_t
t38
;
38
39
/*! \brief TRUE if the NSF, NSC, and NSS are to be suppressed by altering
40
their contents to something the far end will not recognise. */
41
int
suppress_nsx_len[2];
42
/*! \brief TRUE if we need to corrupt the HDLC frame in progress, so the receiver cannot
43
interpret it. The two values are for the two directions. */
44
int
corrupt_current_frame[2];
45
46
/*! \brief the current class of field being received - i.e. none, non-ECM or HDLC */
47
int
current_rx_field_class
;
48
/*! \brief The T.38 indicator currently in use */
49
int
in_progress_rx_indicator
;
50
51
/*! \brief The current T.38 data type being sent. */
52
int
current_tx_data_type
;
53
}
t38_gateway_t38_state_t
;
54
55
/*!
56
T.38 gateway audio side channel descriptor.
57
*/
58
typedef
struct
59
{
60
/*! \brief The FAX modem set for the audio side fo the gateway. */
61
fax_modems_state_t
modems
;
62
/*! \brief The current receive signal handler. Actual receiving hops between this
63
and a dummy receive routine. */
64
span_rx_handler_t *
base_rx_handler
;
65
span_rx_fillin_handler_t *base_rx_fillin_handler;
66
}
t38_gateway_audio_state_t
;
67
68
/*!
69
T.38 gateway T.38 side state.
70
*/
71
typedef
struct
72
{
73
/*! \brief non-ECM and HDLC modem receive data buffer. */
74
uint8_t data[
T38_RX_BUF_LEN
];
75
/*! \brief Current pointer into the data buffer. */
76
int
data_ptr
;
77
/*! \brief The current octet being received as non-ECM data. */
78
unsigned
int
bit_stream
;
79
/*! \brief The number of bits taken from the modem for the current scan row. This
80
is used during non-ECM transmission will fill bit removal to see that
81
T.38 packet transmissions do not stretch too far apart. */
82
int
bits_absorbed
;
83
/*! \brief The current bit number in the current non-ECM octet. */
84
int
bit_no
;
85
/*! \brief Progressively calculated CRC for HDLC messages received from a modem. */
86
uint16_t
crc
;
87
/*! \brief TRUE if non-ECM fill bits are to be stripped when sending image data. */
88
int
fill_bit_removal
;
89
/*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current
90
rate and the current specified packet interval. */
91
int
octets_per_data_packet
;
92
93
/*! \brief Bits into the non-ECM buffer */
94
int
in_bits
;
95
/*! \brief Octets fed out from the non-ECM buffer */
96
int
out_octets
;
97
}
t38_gateway_to_t38_state_t
;
98
99
/*!
100
T.38 gateway HDLC buffer.
101
*/
102
typedef
struct
103
{
104
/*! \brief HDLC message buffers. */
105
uint8_t buf[
T38_MAX_HDLC_LEN
];
106
/*! \brief HDLC message lengths. */
107
int
len
;
108
/*! \brief HDLC message status flags. */
109
int
flags
;
110
/*! \brief HDLC buffer contents. */
111
int
contents
;
112
}
t38_gateway_hdlc_buf_t
;
113
114
/*!
115
T.38 gateway HDLC state.
116
*/
117
typedef
struct
118
{
119
/*! \brief HDLC message buffers. */
120
t38_gateway_hdlc_buf_t
buf[
T38_TX_HDLC_BUFS
];
121
#if 0
122
/*! \brief HDLC message buffers. */
123
uint8_t buf[
T38_TX_HDLC_BUFS
][
T38_MAX_HDLC_LEN
];
124
/*! \brief HDLC message lengths. */
125
int
len[
T38_TX_HDLC_BUFS
];
126
/*! \brief HDLC message status flags. */
127
int
flags[
T38_TX_HDLC_BUFS
];
128
/*! \brief HDLC buffer contents. */
129
int
contents[
T38_TX_HDLC_BUFS
];
130
#endif
131
/*! \brief HDLC buffer number for input. */
132
int
in
;
133
/*! \brief HDLC buffer number for output. */
134
int
out
;
135
}
t38_gateway_hdlc_state_t
;
136
137
/*!
138
T.38 gateway core descriptor.
139
*/
140
typedef
struct
141
{
142
/*! \brief A bit mask of the currently supported modem types. */
143
int
supported_modems
;
144
/*! \brief TRUE if ECM FAX mode is allowed through the gateway. */
145
int
ecm_allowed
;
146
/*! \brief Required time between T.38 transmissions, in ms. */
147
int
ms_per_tx_chunk
;
148
149
/*! \brief TRUE if in image data modem is to use short training. This usually
150
follows image_data_mode, but in ECM mode T.30 defines recovery
151
conditions in which long training is used for image data. */
152
int
short_train
;
153
/*! \brief TRUE if in image data mode, as opposed to TCF mode. */
154
int
image_data_mode
;
155
/*! \brief The minimum permitted bits per FAX scan line row. */
156
int
min_row_bits
;
157
158
/*! \brief TRUE if we should count the next MCF as a page end, else FALSE */
159
int
count_page_on_mcf
;
160
/*! \brief The number of pages for which a confirm (MCF) message was returned. */
161
int
pages_confirmed
;
162
163
/*! \brief TRUE if we are in error correcting (ECM) mode */
164
int
ecm_mode
;
165
/*! \brief The current bit rate for the fast modem. */
166
int
fast_bit_rate
;
167
/*! \brief The current fast receive modem type. */
168
int
fast_rx_modem
;
169
/*! \brief The type of fast receive modem currently active, which may be T38_NONE */
170
int
fast_rx_active
;
171
172
/*! \brief The current timed operation. */
173
int
timed_mode
;
174
/*! \brief The number of samples until the next timeout event */
175
int
samples_to_timeout
;
176
177
/*! Buffer for HDLC and non-ECM data going to the T.38 channel */
178
t38_gateway_to_t38_state_t
to_t38
;
179
/*! Buffer for data going to an HDLC modem. */
180
t38_gateway_hdlc_state_t
hdlc_to_modem
;
181
/*! Buffer for data going to a non-ECM mode modem. */
182
t38_non_ecm_buffer_state_t
non_ecm_to_modem
;
183
184
/*! \brief A pointer to a callback routine to be called when frames are
185
exchanged. */
186
t38_gateway_real_time_frame_handler_t
*
real_time_frame_handler
;
187
/*! \brief An opaque pointer supplied in real time frame callbacks. */
188
void
*
real_time_frame_user_data
;
189
}
t38_gateway_core_state_t
;
190
191
/*!
192
T.38 gateway state.
193
*/
194
struct
t38_gateway_state_s
195
{
196
/*! T.38 side state */
197
t38_gateway_t38_state_t
t38x
;
198
/*! Audio side state */
199
t38_gateway_audio_state_t
audio
;
200
/*! T.38 core state */
201
t38_gateway_core_state_t
core
;
202
203
/*! \brief Error and flow logging control */
204
logging_state_t
logging
;
205
};
206
207
#endif
208
/*- End of file ------------------------------------------------------------*/
src
spandsp
private
t38_gateway.h
Generated on Mon Sep 10 2012 11:04:49 for spandsp by
1.8.1.2