spandsp  0.0.6
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 */
45  /*! This option enables the regular repeat transmission of indicator signals,
46  during periods when no FAX signal transmission occurs. */
48  /*! This option enables the regular repeat transmission of indicator signals for the
49  first 2s, during periods when no FAX signal transmission occurs. */
51 };
52 
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 */
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 */
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 */
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. */
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 ------------------------------------------------------------*/
logging_state_t * t38_terminal_get_logging_state(t38_terminal_state_t *s)
Get a pointer to the logging context associated with a T.38 context.
Definition: t38_terminal.c:1346
int t38_terminal_restart(t38_terminal_state_t *s, int calling_party)
Reinitialise a termination mode T.38 context.
Definition: t38_terminal.c:1352
Definition: private/t38_terminal.h:107
Definition: private/t30.h:35
Definition: t38_terminal.h:47
Definition: t38_terminal.h:50
void t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, int remove)
Select whether non-ECM fill bits are to be removed during transmission.
Definition: t38_terminal.c:1271
int t38_terminal_free(t38_terminal_state_t *s)
Free a T.38 context.
Definition: t38_terminal.c:1408
Definition: t38_terminal.h:44
t38_core_state_t * t38_terminal_get_t38_core_state(t38_terminal_state_t *s)
Get a pointer to the T.38 core IFP packet engine associated with a T.38 context.
Definition: t38_terminal.c:1288
void t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_tep)
Select whether TEP time will be allowed for.
Definition: t38_terminal.c:1260
void t38_terminal_set_config(t38_terminal_state_t *s, int config)
Set configuration options.
Definition: t38_terminal.c:1221
int t38_terminal_release(t38_terminal_state_t *s)
Release a T.38 context.
Definition: t38_terminal.c:1401
Definition: private/logging.h:33
t38_terminal_state_t * t38_terminal_init(t38_terminal_state_t *s, int calling_party, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data)
Initialise a termination mode T.38 context.
Definition: t38_terminal.c:1361
Definition: private/t38_core.h:32
t30_state_t * t38_terminal_get_t30_state(t38_terminal_state_t *s)
Get a pointer to the T.30 engine associated with a T.38 context.
Definition: t38_terminal.c:1282