spandsp
0.0.6
Main Page
Related Pages
Classes
Files
File List
File Members
t38_terminal.h
Go to the documentation of this file.
1
/*
2
* SpanDSP - a series of DSP components for telephony
3
*
4
* t38_terminal.h - T.38 termination, 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
26
/*! \file */
27
28
#if !defined(_SPANDSP_T38_TERMINAL_H_)
29
#define _SPANDSP_T38_TERMINAL_H_
30
31
/*! \page t38_terminal_page T.38 real time FAX over IP termination
32
\section t38_terminal_page_sec_1 What does it do?
33
34
\section t38_terminal_page_sec_2 How does it work?
35
*/
36
37
/* Make sure the HDLC frame buffers are big enough for ECM frames. */
38
#define T38_MAX_HDLC_LEN 260
39
40
enum
41
{
42
/*! This option enables the continuous streaming of FAX data, with no allowance for
43
FAX machine speeds. This is usually used with TCP/TPKT transmission of T.38 FAXes */
44
T38_TERMINAL_OPTION_NO_PACING
= 0x01,
45
/*! This option enables the regular repeat transmission of indicator signals,
46
during periods when no FAX signal transmission occurs. */
47
T38_TERMINAL_OPTION_REGULAR_INDICATORS
= 0x02,
48
/*! This option enables the regular repeat transmission of indicator signals for the
49
first 2s, during periods when no FAX signal transmission occurs. */
50
T38_TERMINAL_OPTION_2S_REPEATING_INDICATORS
= 0x04
51
};
52
53
typedef
struct
t38_terminal_state_s
t38_terminal_state_t
;
54
55
#if defined(__cplusplus)
56
extern
"C"
57
{
58
#endif
59
60
SPAN_DECLARE(
int
) t38_terminal_send_timeout(
t38_terminal_state_t
*s,
int
samples);
61
62
/*! Set configuration options.
63
\brief Set configuration options.
64
\param s The T.38 context.
65
\param config A combinations of T38_TERMINAL_OPTION_* bits.
66
*/
67
SPAN_DECLARE(
void
)
t38_terminal_set_config
(
t38_terminal_state_t
*s,
int
config);
68
69
/*! Select whether the time for talker echo protection tone will be allowed for when sending.
70
\brief Select whether TEP time will be allowed for.
71
\param s The T.38 context.
72
\param use_tep TRUE if TEP should be allowed for.
73
*/
74
SPAN_DECLARE(
void
)
t38_terminal_set_tep_mode
(
t38_terminal_state_t
*s,
int
use_tep);
75
76
/*! Select whether non-ECM fill bits are to be removed during transmission.
77
\brief Select whether non-ECM fill bits are to be removed during transmission.
78
\param s The T.38 context.
79
\param remove TRUE if fill bits are to be removed.
80
*/
81
SPAN_DECLARE(
void
)
t38_terminal_set_fill_bit_removal
(
t38_terminal_state_t
*s,
int
remove);
82
83
/*! Get a pointer to the T.30 engine associated with a termination mode T.38 context.
84
\brief Get a pointer to the T.30 engine associated with a T.38 context.
85
\param s The T.38 context.
86
\return A pointer to the T.30 context, or NULL.
87
*/
88
SPAN_DECLARE(
t30_state_t
*)
t38_terminal_get_t30_state
(
t38_terminal_state_t
*s);
89
90
/*! Get a pointer to the T.38 core IFP packet engine associated with a
91
termination mode T.38 context.
92
\brief Get a pointer to the T.38 core IFP packet engine associated
93
with a T.38 context.
94
\param s The T.38 context.
95
\return A pointer to the T.38 core context, or NULL.
96
*/
97
SPAN_DECLARE(
t38_core_state_t
*)
t38_terminal_get_t38_core_state
(
t38_terminal_state_t
*s);
98
99
/*! Get a pointer to the logging context associated with a T.38 context.
100
\brief Get a pointer to the logging context associated with a T.38 context.
101
\param s The T.38 context.
102
\return A pointer to the logging context, or NULL.
103
*/
104
SPAN_DECLARE(
logging_state_t
*)
t38_terminal_get_logging_state
(
t38_terminal_state_t
*s);
105
106
/*! \brief Reinitialise a termination mode T.38 context.
107
\param s The T.38 context.
108
\param calling_party TRUE if the context is for a calling party. FALSE if the
109
context is for an answering party.
110
\return 0 for OK, else -1. */
111
SPAN_DECLARE(
int
)
t38_terminal_restart
(
t38_terminal_state_t
*s,
112
int
calling_party);
113
114
/*! \brief Initialise a termination mode T.38 context.
115
\param s The T.38 context.
116
\param calling_party TRUE if the context is for a calling party. FALSE if the
117
context is for an answering party.
118
\param tx_packet_handler A callback routine to encapsulate and transmit T.38 packets.
119
\param tx_packet_user_data An opaque pointer passed to the tx_packet_handler routine.
120
\return A pointer to the termination mode T.38 context, or NULL if there was a problem. */
121
SPAN_DECLARE(
t38_terminal_state_t
*)
t38_terminal_init
(
t38_terminal_state_t
*s,
122
int
calling_party,
123
t38_tx_packet_handler_t *tx_packet_handler,
124
void
*tx_packet_user_data);
125
126
/*! Release a termination mode T.38 context.
127
\brief Release a T.38 context.
128
\param s The T.38 context.
129
\return 0 for OK, else -1. */
130
SPAN_DECLARE(
int
)
t38_terminal_release
(
t38_terminal_state_t
*s);
131
132
/*! Free a a termination mode T.38 context.
133
\brief Free a T.38 context.
134
\param s The T.38 context.
135
\return 0 for OK, else -1. */
136
SPAN_DECLARE(
int
)
t38_terminal_free
(
t38_terminal_state_t
*s);
137
138
#if defined(__cplusplus)
139
}
140
#endif
141
142
#endif
143
/*- End of file ------------------------------------------------------------*/
src
spandsp
t38_terminal.h
Generated by
1.8.4