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