spandsp 0.0.6
t30_api.h
Go to the documentation of this file.
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * t30_api.h - definitions for T.30 fax processing
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2003 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_T30_API_H_)
29#define _SPANDSP_T30_API_H_
30
31#if defined(__cplusplus)
32extern "C"
33{
34#endif
35
36/*! Set the transmitted NSF frame to be associated with a T.30 context.
37 \brief Set the transmitted NSF frame to be associated with a T.30 context.
38 \param s The T.30 context.
39 \param nsf A pointer to the frame.
40 \param len The length of the frame.
41 \return 0 for OK, else -1. */
42SPAN_DECLARE(int) t30_set_tx_nsf(t30_state_t *s, const uint8_t *nsf, int len);
43
44/*! Get an NSF frame to be associated with a T.30 context.
45 \brief Set an NSF frame to be associated with a T.30 context.
46 \param s The T.30 context.
47 \param nsf A pointer to the frame.
48 \return the length of the NSF message. */
49SPAN_DECLARE(size_t) t30_get_tx_nsf(t30_state_t *s, const uint8_t *nsf[]);
50
51/*! Get an NSF frame to be associated with a T.30 context.
52 \brief Set an NSF frame to be associated with a T.30 context.
53 \param s The T.30 context.
54 \param nsf A pointer to the frame.
55 \return the length of the NSF message. */
56SPAN_DECLARE(size_t) t30_get_rx_nsf(t30_state_t *s, const uint8_t *nsf[]);
57
58/*! Set the transmitted NSC frame to be associated with a T.30 context.
59 \brief Set the transmitted NSC frame to be associated with a T.30 context.
60 \param s The T.30 context.
61 \param nsc A pointer to the frame.
62 \param len The length of the frame.
63 \return 0 for OK, else -1. */
64SPAN_DECLARE(int) t30_set_tx_nsc(t30_state_t *s, const uint8_t *nsc, int len);
65
66/*! Get an NSC frame to be associated with a T.30 context.
67 \brief Set an NSC frame to be associated with a T.30 context.
68 \param s The T.30 context.
69 \param nsc A pointer to the frame.
70 \return the length of the NSC message. */
71SPAN_DECLARE(size_t) t30_get_tx_nsc(t30_state_t *s, const uint8_t *nsc[]);
72
73/*! Get an NSC frame to be associated with a T.30 context.
74 \brief Set an NSC frame to be associated with a T.30 context.
75 \param s The T.30 context.
76 \param nsc A pointer to the frame.
77 \return the length of the NSC message. */
78SPAN_DECLARE(size_t) t30_get_rx_nsc(t30_state_t *s, const uint8_t *nsc[]);
79
80/*! Set the transmitted NSS frame to be associated with a T.30 context.
81 \brief Set the transmitted NSS frame to be associated with a T.30 context.
82 \param s The T.30 context.
83 \param nss A pointer to the frame.
84 \param len The length of the frame.
85 \return 0 for OK, else -1. */
86SPAN_DECLARE(int) t30_set_tx_nss(t30_state_t *s, const uint8_t *nss, int len);
87
88/*! Get an NSS frame to be associated with a T.30 context.
89 \brief Set an NSS frame to be associated with a T.30 context.
90 \param s The T.30 context.
91 \param nss A pointer to the frame.
92 \return the length of the NSS message. */
93SPAN_DECLARE(size_t) t30_get_tx_nss(t30_state_t *s, const uint8_t *nss[]);
94
95/*! Get an NSS frame to be associated with a T.30 context.
96 \brief Set an NSS frame to be associated with a T.30 context.
97 \param s The T.30 context.
98 \param nss A pointer to the frame.
99 \return the length of the NSS message. */
100SPAN_DECLARE(size_t) t30_get_rx_nss(t30_state_t *s, const uint8_t *nss[]);
101
102/*! Set the transmitted identifier associated with a T.30 context.
103 \brief Set the transmitted identifier associated with a T.30 context.
104 \param s The T.30 context.
105 \param id A pointer to the identifier.
106 \return 0 for OK, else -1. */
107SPAN_DECLARE(int) t30_set_tx_ident(t30_state_t *s, const char *id);
108
109/*! Get the transmitted identifier associated with a T.30 context.
110 \brief Set the transmitted identifier associated with a T.30 context.
111 \param s The T.30 context.
112 \return A pointer to the identifier. */
113SPAN_DECLARE(const char *) t30_get_tx_ident(t30_state_t *s);
114
115/*! Get the transmitted identifier associated with a T.30 context.
116 \brief Set the transmitted identifier associated with a T.30 context.
117 \param s The T.30 context.
118 \return A pointer to the identifier. */
119SPAN_DECLARE(const char *) t30_get_rx_ident(t30_state_t *s);
120
121/*! Set the transmitted sub-address associated with a T.30 context.
122 \brief Set the transmitted sub-address associated with a T.30 context.
123 \param s The T.30 context.
124 \param sub_address A pointer to the sub-address.
125 \return 0 for OK, else -1. */
126SPAN_DECLARE(int) t30_set_tx_sub_address(t30_state_t *s, const char *sub_address);
127
128/*! Get the received sub-address associated with a T.30 context.
129 \brief Get the received sub-address associated with a T.30 context.
130 \param s The T.30 context.
131 \return A pointer to the sub-address. */
132SPAN_DECLARE(const char *) t30_get_tx_sub_address(t30_state_t *s);
133
134/*! Get the received sub-address associated with a T.30 context.
135 \brief Get the received sub-address associated with a T.30 context.
136 \param s The T.30 context.
137 \return A pointer to the sub-address. */
138SPAN_DECLARE(const char *) t30_get_rx_sub_address(t30_state_t *s);
139
140/*! Set the transmitted selective polling address (i.e. the one we will send to the far
141 end) associated with a T.30 context.
142 \brief Set the transmitted selective polling address associated with a T.30 context.
143 \param s The T.30 context.
144 \param selective_polling_address A pointer to the selective polling address.
145 \return 0 for OK, else -1. */
146SPAN_DECLARE(int) t30_set_tx_selective_polling_address(t30_state_t *s, const char *selective_polling_address);
147
148/*! Get the received selective polling address (i.e. the one we will send to the far
149 end) associated with a T.30 context.
150 \brief Get the received selective polling address associated with a T.30 context.
151 \param s The T.30 context.
152 \return A pointer to the selective polling address. */
153SPAN_DECLARE(const char *) t30_get_tx_selective_polling_address(t30_state_t *s);
154
155/*! Get the received selective polling address (i.e. the one we will send to the far
156 end) associated with a T.30 context.
157 \brief Get the received selective polling address associated with a T.30 context.
158 \param s The T.30 context.
159 \return A pointer to the selective polling address. */
160SPAN_DECLARE(const char *) t30_get_rx_selective_polling_address(t30_state_t *s);
161
162/*! Set the transmitted polled sub-address (i.e. the one we will send to the far
163 end) associated with a T.30 context.
164 \brief Set the transmitted polled sub-address associated with a T.30 context.
165 \param s The T.30 context.
166 \param polled_sub_address A pointer to the polled sub-address.
167 \return 0 for OK, else -1. */
168SPAN_DECLARE(int) t30_set_tx_polled_sub_address(t30_state_t *s, const char *polled_sub_address);
169
170/*! Get the received polled sub-address (i.e. the one we will send to the far
171 end) associated with a T.30 context.
172 \brief Get the received polled sub-address associated with a T.30 context.
173 \param s The T.30 context.
174 \return A pointer to the polled sub-address. */
175SPAN_DECLARE(const char *) t30_get_tx_polled_sub_address(t30_state_t *s);
176
177/*! Get the received polled sub-address (i.e. the one we will send to the far
178 end) associated with a T.30 context.
179 \brief Get the received polled sub-address associated with a T.30 context.
180 \param s The T.30 context.
181 \return A pointer to the polled sub-address. */
182SPAN_DECLARE(const char *) t30_get_rx_polled_sub_address(t30_state_t *s);
183
184/*! Set the transmitted sender ident (i.e. the one we will send to the far
185 end) associated with a T.30 context.
186 \brief Set the transmitted sender ident associated with a T.30 context.
187 \param s The T.30 context.
188 \param sender_ident A pointer to the sender ident.
189 \return 0 for OK, else -1. */
190SPAN_DECLARE(int) t30_set_tx_sender_ident(t30_state_t *s, const char *sender_ident);
191
192/*! Get the received sender ident (i.e. the one we will send to the far
193 end) associated with a T.30 context.
194 \brief Get the received sender ident associated with a T.30 context.
195 \param s The T.30 context.
196 \return A pointer to the sender ident. */
197SPAN_DECLARE(const char *) t30_get_tx_sender_ident(t30_state_t *s);
198
199/*! Get the received sender ident (i.e. the one we will send to the far
200 end) associated with a T.30 context.
201 \brief Get the received sender ident associated with a T.30 context.
202 \param s The T.30 context.
203 \return A pointer to the sender ident. */
204SPAN_DECLARE(const char *) t30_get_rx_sender_ident(t30_state_t *s);
205
206/*! Set the transmitted password (i.e. the one we will send to the far
207 end) associated with a T.30 context.
208 \brief Set the transmitted password associated with a T.30 context.
209 \param s The T.30 context.
210 \param password A pointer to the password.
211 \return 0 for OK, else -1. */
212SPAN_DECLARE(int) t30_set_tx_password(t30_state_t *s, const char *password);
213
214/*! Get the received password (i.e. the one we will send to the far
215 end) associated with a T.30 context.
216 \brief Get the received password associated with a T.30 context.
217 \param s The T.30 context.
218 \return A pointer to the password. */
219SPAN_DECLARE(const char *) t30_get_tx_password(t30_state_t *s);
220
221/*! Get the received password (i.e. the one we will send to the far
222 end) associated with a T.30 context.
223 \brief Get the received password associated with a T.30 context.
224 \param s The T.30 context.
225 \return A pointer to the password. */
226SPAN_DECLARE(const char *) t30_get_rx_password(t30_state_t *s);
227
228/*! Set the transmitted TSA (i.e. the one we will send to the far
229 end) associated with a T.30 context.
230 \brief Set the transmitted TSA associated with a T.30 context.
231 \param s The T.30 context.
232 \param type The type of address.
233 \param address A pointer to the address.
234 \param len The length of the address.
235 \return 0 for OK, else -1. */
236SPAN_DECLARE(int) t30_set_tx_tsa(t30_state_t *s, int type, const char *address, int len);
237
238/*! Get the transmitted TSA (i.e. the one we will send to the far
239 end) associated with a T.30 context.
240 \brief Get the received TSA associated with a T.30 context.
241 \param s The T.30 context.
242 \param type The type of address.
243 \param address A pointer to the address.
244 \return The length of the address. */
245SPAN_DECLARE(size_t) t30_get_tx_tsa(t30_state_t *s, int *type, const char *address[]);
246
247/*! Get the received TSA associated with a T.30 context.
248 \brief Get the received TSA associated with a T.30 context.
249 \param s The T.30 context.
250 \param type The type of address.
251 \param address A pointer to the address.
252 \return The length of the address. */
253SPAN_DECLARE(size_t) t30_get_rx_tsa(t30_state_t *s, int *type, const char *address[]);
254
255/*! Set the transmitted IRA (i.e. the one we will send to the far
256 end) associated with a T.30 context.
257 \brief Set the transmitted IRA associated with a T.30 context.
258 \param s The T.30 context.
259 \param type The type of address.
260 \param address A pointer to the address.
261 \param len The length of the address.
262 \return 0 for OK, else -1. */
263SPAN_DECLARE(int) t30_set_tx_ira(t30_state_t *s, int type, const char *address, int len);
264
265/*! Get the transmitted IRA (i.e. the one we will send to the far
266 end) associated with a T.30 context.
267 \brief Get the received IRA associated with a T.30 context.
268 \param s The T.30 context.
269 \param type The type of address.
270 \param address A pointer to the address.
271 \return The length of the address. */
272SPAN_DECLARE(size_t) t30_get_tx_ira(t30_state_t *s, int *type, const char *address[]);
273
274/*! Get the received IRA associated with a T.30 context.
275 \brief Get the received IRA associated with a T.30 context.
276 \param s The T.30 context.
277 \param type The type of address.
278 \param address A pointer to the address.
279 \return The length of the address. */
280SPAN_DECLARE(size_t) t30_get_rx_ira(t30_state_t *s, int *type, const char *address[]);
281
282/*! Set the transmitted CIA (i.e. the one we will send to the far
283 end) associated with a T.30 context.
284 \brief Set the transmitted CIA associated with a T.30 context.
285 \param s The T.30 context.
286 \param type The type of address.
287 \param address A pointer to the address.
288 \param len The length of the address.
289 \return 0 for OK, else -1. */
290SPAN_DECLARE(int) t30_set_tx_cia(t30_state_t *s, int type, const char *address, int len);
291
292/*! Get the transmitted CIA (i.e. the one we will send to the far
293 end) associated with a T.30 context.
294 \brief Get the received CIA associated with a T.30 context.
295 \param s The T.30 context.
296 \param type The type of address.
297 \param address A pointer to the address.
298 \return The length of the address. */
299SPAN_DECLARE(size_t) t30_get_tx_cia(t30_state_t *s, int *type, const char *address[]);
300
301/*! Get the received CIA associated with a T.30 context.
302 \brief Get the received CIA associated with a T.30 context.
303 \param s The T.30 context.
304 \param type The type of address.
305 \param address A pointer to the address.
306 \return 0 for OK, else -1. */
307SPAN_DECLARE(size_t) t30_get_rx_cia(t30_state_t *s, int *type, const char *address[]);
308
309/*! Set the transmitted ISP (i.e. the one we will send to the far
310 end) associated with a T.30 context.
311 \brief Set the transmitted ISP associated with a T.30 context.
312 \param s The T.30 context.
313 \param type The type of address.
314 \param address A pointer to the address.
315 \param len The length of the address.
316 \return 0 for OK, else -1. */
317SPAN_DECLARE(int) t30_set_tx_isp(t30_state_t *s, int type, const char *address, int len);
318
319/*! Get the transmitted ISP (i.e. the one we will send to the far
320 end) associated with a T.30 context.
321 \brief Get the received ISP associated with a T.30 context.
322 \param s The T.30 context.
323 \param type The type of address.
324 \param address A pointer to the address.
325 \return 0 for OK, else -1. */
326SPAN_DECLARE(size_t) t30_get_tx_isp(t30_state_t *s, int *type, const char *address[]);
327
328/*! Get the received ISP associated with a T.30 context.
329 \brief Get the received ISP associated with a T.30 context.
330 \param s The T.30 context.
331 \param type The type of address.
332 \param address A pointer to the address.
333 \return 0 for OK, else -1. */
334SPAN_DECLARE(size_t) t30_get_rx_isp(t30_state_t *s, int *type, const char *address[]);
335
336/*! Set the transmitted CSA (i.e. the one we will send to the far
337 end) associated with a T.30 context.
338 \brief Set the transmitted CSA associated with a T.30 context.
339 \param s The T.30 context.
340 \param type The type of address.
341 \param address A pointer to the address.
342 \param len The length of the address.
343 \return 0 for OK, else -1. */
344SPAN_DECLARE(int) t30_set_tx_csa(t30_state_t *s, int type, const char *address, int len);
345
346/*! Get the transmitted CSA (i.e. the one we will send to the far
347 end) associated with a T.30 context.
348 \brief Get the received CSA associated with a T.30 context.
349 \param s The T.30 context.
350 \param type The type of address.
351 \param address A pointer to the address.
352 \return The length of the address. */
353SPAN_DECLARE(size_t) t30_get_tx_csa(t30_state_t *s, int *type, const char *address[]);
354
355/*! Get the received CSA associated with a T.30 context.
356 \brief Get the received CSA associated with a T.30 context.
357 \param s The T.30 context.
358 \param type The type of address.
359 \param address A pointer to the address.
360 \return 0 for OK, else -1. */
361SPAN_DECLARE(size_t) t30_get_rx_csa(t30_state_t *s, int *type, const char *address[]);
362
363/*! Set page header extends or overlays the image mode.
364 \brief Set page header overlay mode.
365 \param s The T.30 context.
366 \param header_overlays_image TRUE for overlay, or FALSE for extend the page. */
367SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, int header_overlays_image);
368
369/*! Set the transmitted header information associated with a T.30 context.
370 \brief Set the transmitted header information associated with a T.30 context.
371 \param s The T.30 context.
372 \param info A pointer to the information string.
373 \return 0 for OK, else -1. */
374SPAN_DECLARE(int) t30_set_tx_page_header_info(t30_state_t *s, const char *info);
375
376/*! Set the transmitted header timestamp timezone associated with a T.30 context.
377 \brief Set the transmitted header timestamp timezone associated with a T.30 context.
378 \param s The T.30 context.
379 \param info A pointer to the POSIZ timezone string.
380 \return 0 for OK, else -1. */
381SPAN_DECLARE(int) t30_set_tx_page_header_tz(t30_state_t *s, const char *tzstring);
382
383/*! Get the header information associated with a T.30 context.
384 \brief Get the header information associated with a T.30 context.
385 \param s The T.30 context.
386 \param info A pointer to a buffer for the header information. The buffer
387 should be at least 51 bytes long.
388 \return the length of the string. */
389SPAN_DECLARE(size_t) t30_get_tx_page_header_info(t30_state_t *s, char *info);
390
391/*! Get the country of origin of the remote FAX machine associated with a T.30 context.
392 \brief Get the country of origin of the remote FAX machine associated with a T.30 context.
393 \param s The T.30 context.
394 \return a pointer to the country name, or NULL if the country is not known. */
395SPAN_DECLARE(const char *) t30_get_rx_country(t30_state_t *s);
396
397/*! Get the name of the vendor of the remote FAX machine associated with a T.30 context.
398 \brief Get the name of the vendor of the remote FAX machine associated with a T.30 context.
399 \param s The T.30 context.
400 \return a pointer to the vendor name, or NULL if the vendor is not known. */
401SPAN_DECLARE(const char *) t30_get_rx_vendor(t30_state_t *s);
402
403/*! Get the name of the model of the remote FAX machine associated with a T.30 context.
404 \brief Get the name of the model of the remote FAX machine associated with a T.30 context.
405 \param s The T.30 context.
406 \return a pointer to the model name, or NULL if the model is not known. */
407SPAN_DECLARE(const char *) t30_get_rx_model(t30_state_t *s);
408
409/*! Specify the file name of the next TIFF file to be received by a T.30
410 context.
411 \brief Set next receive file name.
412 \param s The T.30 context.
413 \param file The file name
414 \param stop_page The maximum page to receive. -1 for no restriction. */
415SPAN_DECLARE(void) t30_set_rx_file(t30_state_t *s, const char *file, int stop_page);
416
417/*! Specify the file name of the next TIFF file to be transmitted by a T.30
418 context.
419 \brief Set next transmit file name.
420 \param s The T.30 context.
421 \param file The file name
422 \param start_page The first page to send. -1 for no restriction.
423 \param stop_page The last page to send. -1 for no restriction. */
424SPAN_DECLARE(void) t30_set_tx_file(t30_state_t *s, const char *file, int start_page, int stop_page);
425
426/*! Set Internet aware FAX (IAF) mode.
427 \brief Set Internet aware FAX (IAF) mode.
428 \param s The T.30 context.
429 \param iaf TRUE for IAF, or FALSE for non-IAF. */
430SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, int iaf);
431
432/*! Specify if error correction mode (ECM) is allowed by a T.30 context.
433 \brief Select ECM capability.
434 \param s The T.30 context.
435 \param enabled TRUE for ECM capable, FALSE for not ECM capable.
436 \return 0 if OK, else -1. */
437SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, int enabled);
438
439/*! Specify the output encoding for TIFF files created during FAX reception.
440 \brief Specify the output encoding for TIFF files created during FAX reception.
441 \param s The T.30 context.
442 \param encoding The coding required. The options are T4_COMPRESSION_ITU_T4_1D,
443 T4_COMPRESSION_ITU_T4_2D, T4_COMPRESSION_ITU_T6. T6 is usually the
444 densest option, but support for it is broken in a number of software
445 packages.
446 \return 0 if OK, else -1. */
447SPAN_DECLARE(int) t30_set_rx_encoding(t30_state_t *s, int encoding);
448
449/*! Specify the minimum scan line time supported by a T.30 context.
450 \brief Specify minimum scan line time.
451 \param s The T.30 context.
452 \param min_time The minimum permitted scan line time, in milliseconds.
453 \return 0 if OK, else -1. */
454SPAN_DECLARE(int) t30_set_minimum_scan_line_time(t30_state_t *s, int min_time);
455
456/*! Specify which modem types are supported by a T.30 context.
457 \brief Specify supported modems.
458 \param s The T.30 context.
459 \param supported_modems Bit field list of the supported modems.
460 \return 0 if OK, else -1. */
461SPAN_DECLARE(int) t30_set_supported_modems(t30_state_t *s, int supported_modems);
462
463/*! Specify which compression types are supported by a T.30 context.
464 \brief Specify supported compression types.
465 \param s The T.30 context.
466 \param supported_compressions Bit field list of the supported compression types.
467 \return 0 if OK, else -1. */
468SPAN_DECLARE(int) t30_set_supported_compressions(t30_state_t *s, int supported_compressions);
469
470/*! Specify which resolutions are supported by a T.30 context.
471 \brief Specify supported resolutions.
472 \param s The T.30 context.
473 \param supported_resolutions Bit field list of the supported resolutions.
474 \return 0 if OK, else -1. */
475SPAN_DECLARE(int) t30_set_supported_resolutions(t30_state_t *s, int supported_resolutions);
476
477/*! Specify which images sizes are supported by a T.30 context.
478 \brief Specify supported image sizes.
479 \param s The T.30 context.
480 \param supported_image_sizes Bit field list of the supported widths and lengths.
481 \return 0 if OK, else -1. */
482SPAN_DECLARE(int) t30_set_supported_image_sizes(t30_state_t *s, int supported_image_sizes);
483
484/*! Specify which special T.30 features are supported by a T.30 context.
485 \brief Specify supported T.30 features.
486 \param s The T.30 context.
487 \param supported_t30_features Bit field list of the supported features.
488 \return 0 if OK, else -1. */
489SPAN_DECLARE(int) t30_set_supported_t30_features(t30_state_t *s, int supported_t30_features);
490
491/*! Set T.30 status. This may be used to adjust the status from within
492 the phase B and phase D callbacks.
493 \brief Set T.30 status.
494 \param s The T.30 context.
495 \param status The new status. */
496SPAN_DECLARE(void) t30_set_status(t30_state_t *s, int status);
497
498/*! Specify a period of responding with receiver not ready.
499 \brief Specify a period of responding with receiver not ready.
500 \param s The T.30 context.
501 \param count The number of times to report receiver not ready.
502 \return 0 if OK, else -1. */
503SPAN_DECLARE(int) t30_set_receiver_not_ready(t30_state_t *s, int count);
504
505/*! Set a callback function for T.30 phase B handling.
506 \brief Set a callback function for T.30 phase B handling.
507 \param s The T.30 context.
508 \param handler The callback function.
509 \param user_data An opaque pointer passed to the callback function. */
510SPAN_DECLARE(void) t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data);
511
512/*! Set a callback function for T.30 phase D handling.
513 \brief Set a callback function for T.30 phase D handling.
514 \param s The T.30 context.
515 \param handler The callback function.
516 \param user_data An opaque pointer passed to the callback function. */
517SPAN_DECLARE(void) t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data);
518
519/*! Set a callback function for T.30 phase E handling.
520 \brief Set a callback function for T.30 phase E handling.
521 \param s The T.30 context.
522 \param handler The callback function.
523 \param user_data An opaque pointer passed to the callback function. */
524SPAN_DECLARE(void) t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data);
525
526/*! Set a callback function for T.30 end of document handling.
527 \brief Set a callback function for T.30 end of document handling.
528 \param s The T.30 context.
529 \param handler The callback function.
530 \param user_data An opaque pointer passed to the callback function. */
531SPAN_DECLARE(void) t30_set_document_handler(t30_state_t *s, t30_document_handler_t *handler, void *user_data);
532
533/*! Set a callback function for T.30 frame exchange monitoring. This is called from the heart
534 of the signal processing, so don't take too long in the handler routine.
535 \brief Set a callback function for T.30 frame exchange monitoring.
536 \param s The T.30 context.
537 \param handler The callback function.
538 \param user_data An opaque pointer passed to the callback function. */
539SPAN_DECLARE(void) t30_set_real_time_frame_handler(t30_state_t *s, t30_real_time_frame_handler_t *handler, void *user_data);
540
541/*! Get a pointer to the logging context associated with a T.30 context.
542 \brief Get a pointer to the logging context associated with a T.30 context.
543 \param s The T.30 context.
544 \return A pointer to the logging context, or NULL.
545*/
546SPAN_DECLARE(logging_state_t *) t30_get_logging_state(t30_state_t *s);
547
548#if defined(__cplusplus)
549}
550#endif
551
552#endif
553/*- End of file ------------------------------------------------------------*/
struct logging_state_s logging_state_t
Definition logging.h:75
void t30_phase_e_handler_t(t30_state_t *s, void *user_data, int completion_code)
T.30 phase E callback handler.
Definition t30.h:180
int t30_phase_d_handler_t(t30_state_t *s, void *user_data, int result)
T.30 phase D callback handler.
Definition t30.h:171
void t30_real_time_frame_handler_t(t30_state_t *s, void *user_data, int direction, const uint8_t msg[], int len)
T.30 real time frame handler.
Definition t30.h:191
int t30_document_handler_t(t30_state_t *s, void *user_data, int status)
T.30 document handler.
Definition t30.h:204
int t30_phase_b_handler_t(t30_state_t *s, void *user_data, int result)
T.30 phase B callback handler.
Definition t30.h:161
const char * t30_get_tx_polled_sub_address(t30_state_t *s)
Get the received polled sub-address associated with a T.30 context.
Definition t30_api.c:195
int t30_set_tx_isp(t30_state_t *s, int type, const char *address, int len)
Set the transmitted ISP associated with a T.30 context.
Definition t30_api.c:483
int t30_set_tx_csa(t30_state_t *s, int type, const char *address, int len)
Set the transmitted CSA associated with a T.30 context.
Definition t30_api.c:517
size_t t30_get_tx_nss(t30_state_t *s, const uint8_t *nss[])
Set an NSS frame to be associated with a T.30 context.
Definition t30_api.c:357
void t30_set_document_handler(t30_state_t *s, t30_document_handler_t *handler, void *user_data)
Set a callback function for T.30 end of document handling.
Definition t30_api.c:770
const char * t30_get_rx_polled_sub_address(t30_state_t *s)
Get the received polled sub-address associated with a T.30 context.
Definition t30_api.c:203
int t30_set_tx_selective_polling_address(t30_state_t *s, const char *selective_polling_address)
Set the transmitted selective polling address associated with a T.30 context.
Definition t30_api.c:151
int t30_set_tx_ira(t30_state_t *s, int type, const char *address, int len)
Set the transmitted IRA associated with a T.30 context.
Definition t30_api.c:415
const char * t30_get_rx_country(t30_state_t *s)
Get the country of origin of the remote FAX machine associated with a T.30 context.
Definition t30_api.c:596
void t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data)
Set a callback function for T.30 phase B handling.
Definition t30_api.c:749
const char * t30_get_tx_sub_address(t30_state_t *s)
Get the received sub-address associated with a T.30 context.
Definition t30_api.c:135
int t30_set_supported_resolutions(t30_state_t *s, int supported_resolutions)
Specify supported resolutions.
Definition t30_api.c:708
const char * t30_get_rx_model(t30_state_t *s)
Get the name of the model of the remote FAX machine associated with a T.30 context.
Definition t30_api.c:608
size_t t30_get_rx_cia(t30_state_t *s, int *type, const char *address[])
Get the received CIA associated with a T.30 context.
Definition t30_api.c:473
void t30_set_real_time_frame_handler(t30_state_t *s, t30_real_time_frame_handler_t *handler, void *user_data)
Set a callback function for T.30 frame exchange monitoring.
Definition t30_api.c:777
size_t t30_get_rx_nss(t30_state_t *s, const uint8_t *nss[])
Set an NSS frame to be associated with a T.30 context.
Definition t30_api.c:365
size_t t30_get_rx_isp(t30_state_t *s, int *type, const char *address[])
Get the received ISP associated with a T.30 context.
Definition t30_api.c:507
const char * t30_get_rx_ident(t30_state_t *s)
Set the transmitted identifier associated with a T.30 context.
Definition t30_api.c:113
size_t t30_get_tx_nsc(t30_state_t *s, const uint8_t *nsc[])
Set an NSC frame to be associated with a T.30 context.
Definition t30_api.c:323
size_t t30_get_tx_nsf(t30_state_t *s, const uint8_t *nsf[])
Set an NSF frame to be associated with a T.30 context.
Definition t30_api.c:289
size_t t30_get_rx_csa(t30_state_t *s, int *type, const char *address[])
Get the received CSA associated with a T.30 context.
Definition t30_api.c:541
int t30_set_tx_cia(t30_state_t *s, int type, const char *address, int len)
Set the transmitted CIA associated with a T.30 context.
Definition t30_api.c:449
size_t t30_get_tx_csa(t30_state_t *s, int *type, const char *address[])
Get the received CSA associated with a T.30 context.
Definition t30_api.c:531
int t30_set_tx_password(t30_state_t *s, const char *password)
Set the transmitted password associated with a T.30 context.
Definition t30_api.c:241
size_t t30_get_tx_isp(t30_state_t *s, int *type, const char *address[])
Get the received ISP associated with a T.30 context.
Definition t30_api.c:497
size_t t30_get_tx_tsa(t30_state_t *s, int *type, const char *address[])
Get the received TSA associated with a T.30 context.
Definition t30_api.c:395
size_t t30_get_tx_cia(t30_state_t *s, int *type, const char *address[])
Get the received CIA associated with a T.30 context.
Definition t30_api.c:463
int t30_set_supported_compressions(t30_state_t *s, int supported_compressions)
Specify supported compression types.
Definition t30_api.c:688
int t30_set_tx_nss(t30_state_t *s, const uint8_t *nss, int len)
Set the transmitted NSS frame to be associated with a T.30 context.
Definition t30_api.c:339
int t30_set_supported_modems(t30_state_t *s, int supported_modems)
Specify supported modems.
Definition t30_api.c:680
int t30_set_rx_encoding(t30_state_t *s, int encoding)
Specify the output encoding for TIFF files created during FAX reception.
Definition t30_api.c:645
void t30_set_iaf_mode(t30_state_t *s, int iaf)
Set Internet aware FAX (IAF) mode.
Definition t30_api.c:631
int t30_set_tx_sender_ident(t30_state_t *s, const char *sender_ident)
Set the transmitted sender ident associated with a T.30 context.
Definition t30_api.c:211
logging_state_t * t30_get_logging_state(t30_state_t *s)
Get a pointer to the logging context associated with a T.30 context.
Definition t30_api.c:784
int t30_set_tx_tsa(t30_state_t *s, int type, const char *address, int len)
Set the transmitted TSA associated with a T.30 context.
Definition t30_api.c:373
void t30_set_tx_file(t30_state_t *s, const char *file, int start_page, int stop_page)
Set next transmit file name.
Definition t30_api.c:622
const char * t30_get_tx_ident(t30_state_t *s)
Set the transmitted identifier associated with a T.30 context.
Definition t30_api.c:105
int t30_set_ecm_capability(t30_state_t *s, int enabled)
Select ECM capability.
Definition t30_api.c:637
const char * t30_get_rx_sender_ident(t30_state_t *s)
Get the received sender ident associated with a T.30 context.
Definition t30_api.c:233
size_t t30_get_rx_ira(t30_state_t *s, int *type, const char *address[])
Get the received IRA associated with a T.30 context.
Definition t30_api.c:439
const char * t30_get_tx_selective_polling_address(t30_state_t *s)
Get the received selective polling address associated with a T.30 context.
Definition t30_api.c:165
int t30_set_tx_page_header_info(t30_state_t *s, const char *info)
Set the transmitted header information associated with a T.30 context.
Definition t30_api.c:561
void t30_set_rx_file(t30_state_t *s, const char *file, int stop_page)
Set next receive file name.
Definition t30_api.c:614
int t30_set_supported_image_sizes(t30_state_t *s, int supported_image_sizes)
Specify supported image sizes.
Definition t30_api.c:716
void t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data)
Set a callback function for T.30 phase E handling.
Definition t30_api.c:763
size_t t30_get_tx_ira(t30_state_t *s, int *type, const char *address[])
Get the received IRA associated with a T.30 context.
Definition t30_api.c:429
const char * t30_get_tx_password(t30_state_t *s)
Get the received password associated with a T.30 context.
Definition t30_api.c:255
size_t t30_get_tx_page_header_info(t30_state_t *s, char *info)
Get the header information associated with a T.30 context.
Definition t30_api.c:576
int t30_set_tx_ident(t30_state_t *s, const char *id)
Set the transmitted identifier associated with a T.30 context.
Definition t30_api.c:90
int t30_set_minimum_scan_line_time(t30_state_t *s, int min_time)
Specify minimum scan line time.
Definition t30_api.c:659
int t30_set_tx_nsf(t30_state_t *s, const uint8_t *nsf, int len)
Set the transmitted NSF frame to be associated with a T.30 context.
Definition t30_api.c:271
size_t t30_get_rx_nsf(t30_state_t *s, const uint8_t *nsf[])
Set an NSF frame to be associated with a T.30 context.
Definition t30_api.c:297
int t30_set_receiver_not_ready(t30_state_t *s, int count)
Specify a period of responding with receiver not ready.
Definition t30_api.c:742
int t30_set_tx_page_header_overlays_image(t30_state_t *s, int header_overlays_image)
Set page header overlay mode.
Definition t30_api.c:551
const char * t30_get_rx_selective_polling_address(t30_state_t *s)
Get the received selective polling address associated with a T.30 context.
Definition t30_api.c:173
int t30_set_tx_nsc(t30_state_t *s, const uint8_t *nsc, int len)
Set the transmitted NSC frame to be associated with a T.30 context.
Definition t30_api.c:305
void t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data)
Set a callback function for T.30 phase D handling.
Definition t30_api.c:756
const char * t30_get_rx_sub_address(t30_state_t *s)
Get the received sub-address associated with a T.30 context.
Definition t30_api.c:143
size_t t30_get_rx_nsc(t30_state_t *s, const uint8_t *nsc[])
Set an NSC frame to be associated with a T.30 context.
Definition t30_api.c:331
size_t t30_get_rx_tsa(t30_state_t *s, int *type, const char *address[])
Get the received TSA associated with a T.30 context.
Definition t30_api.c:405
int t30_set_supported_t30_features(t30_state_t *s, int supported_t30_features)
Specify supported T.30 features.
Definition t30_api.c:724
void t30_set_status(t30_state_t *s, int status)
Set T.30 status.
Definition t30_api.c:732
int t30_set_tx_sub_address(t30_state_t *s, const char *sub_address)
Set the transmitted sub-address associated with a T.30 context.
Definition t30_api.c:121
int t30_set_tx_page_header_tz(t30_state_t *s, const char *tzstring)
Set the transmitted header timestamp timezone associated with a T.30 context.
Definition t30_api.c:584
const char * t30_get_tx_sender_ident(t30_state_t *s)
Get the received sender ident associated with a T.30 context.
Definition t30_api.c:225
const char * t30_get_rx_password(t30_state_t *s)
Get the received password associated with a T.30 context.
Definition t30_api.c:263
const char * t30_get_rx_vendor(t30_state_t *s)
Get the name of the vendor of the remote FAX machine associated with a T.30 context.
Definition t30_api.c:602
int t30_set_tx_polled_sub_address(t30_state_t *s, const char *polled_sub_address)
Set the transmitted polled sub-address associated with a T.30 context.
Definition t30_api.c:181