spandsp  3.0.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. */
395 SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, bool header_overlays_image);
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 Bitmap of values from enum t30_iaf_mode_e. */
458 SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, int 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 if page retransmission is allowed by a T.30 context.
468  \brief Select page retransmission capable.
469  \param s The T.30 context.
470  \param enabled True for retransmit capable, or false for not retransmit capable. */
471 SPAN_DECLARE(void) t30_set_retransmit_capable(t30_state_t *s, bool enabled);
472 
473 /*! Specify the maximum number of times a command will be tried by a T.30 context before giving up.
474  \brief Select maximum command tries.
475  \param s The T.30 context.
476  \param tries The mmaximum number of tries. Default is 3 */
477 SPAN_DECLARE(void) t30_set_max_command_tries(t30_state_t *s, int tries);
478 
479 /*! Specify the maximum number of times a response will be tried by a T.30 context before giving up.
480  \brief Select maximum response tries.
481  \param s The T.30 context.
482  \param tries The mmaximum number of tries. Default is 6 */
483 SPAN_DECLARE(void) t30_set_max_response_tries(t30_state_t *s, int tries);
484 
485 /*! Specify the output encoding for TIFF files created during FAX reception.
486  \brief Specify the output encoding for TIFF files created during FAX reception.
487  \param s The T.30 context.
488  \param supported_compressions Bit field list of the supported compression types, for
489  output of received page images.
490  \return 0 if OK, else -1. */
491 SPAN_DECLARE(int) t30_set_supported_output_compressions(t30_state_t *s, int supported_compressions);
492 
493 /*! Specify the minimum scan line time supported by a T.30 context.
494  \brief Specify minimum scan line time.
495  \param s The T.30 context.
496  \param min_time The minimum permitted scan line time, in milliseconds.
497  \return 0 if OK, else -1. */
498 SPAN_DECLARE(int) t30_set_minimum_scan_line_time(t30_state_t *s, int min_time);
499 
500 /*! Specify which modem types are supported by a T.30 context.
501  \brief Specify supported modems.
502  \param s The T.30 context.
503  \param supported_modems Bit field list of the supported modems.
504  \return 0 if OK, else -1. */
505 SPAN_DECLARE(int) t30_set_supported_modems(t30_state_t *s, int supported_modems);
506 
507 /*! Specify which compression types are supported by a T.30 context.
508  \brief Specify supported compression types.
509  \param s The T.30 context.
510  \param supported_compressions Bit field list of the supported compression types.
511  \return 0 if OK, else -1. */
512 SPAN_DECLARE(int) t30_set_supported_compressions(t30_state_t *s, int supported_compressions);
513 
514 /*! Specify which bi-level resolutions are supported by a T.30 context.
515  \brief Specify supported bi-level resolutions.
516  \param s The T.30 context.
517  \param supported_resolutions Bit field list of the supported resolutions.
518  \return 0 if OK, else -1. */
519 SPAN_DECLARE(int) t30_set_supported_bilevel_resolutions(t30_state_t *s, int supported_resolutions);
520 
521 /*! Specify which colour resolutions are supported by a T.30 context.
522  \brief Specify supported colour resolutions.
523  \param s The T.30 context.
524  \param supported_resolutions Bit field list of the supported resolutions.
525  \return 0 if OK, else -1. */
526 SPAN_DECLARE(int) t30_set_supported_colour_resolutions(t30_state_t *s, int supported_resolutions);
527 
528 /*! Specify which images sizes are supported by a T.30 context.
529  \brief Specify supported image sizes.
530  \param s The T.30 context.
531  \param supported_image_sizes Bit field list of the supported widths and lengths.
532  \return 0 if OK, else -1. */
533 SPAN_DECLARE(int) t30_set_supported_image_sizes(t30_state_t *s, int supported_image_sizes);
534 
535 /*! Specify which special T.30 features are supported by a T.30 context.
536  \brief Specify supported T.30 features.
537  \param s The T.30 context.
538  \param supported_t30_features Bit field list of the supported features.
539  \return 0 if OK, else -1. */
540 SPAN_DECLARE(int) t30_set_supported_t30_features(t30_state_t *s, int supported_t30_features);
541 
542 /*! Set T.30 status. This may be used to adjust the status from within
543  the phase B and phase D callbacks.
544  \brief Set T.30 status.
545  \param s The T.30 context.
546  \param status The new status. */
547 SPAN_DECLARE(void) t30_set_status(t30_state_t *s, int status);
548 
549 /*! Specify a period of responding with receiver not ready.
550  \brief Specify a period of responding with receiver not ready.
551  \param s The T.30 context.
552  \param count The number of times to report receiver not ready.
553  \return 0 if OK, else -1. */
554 SPAN_DECLARE(int) t30_set_receiver_not_ready(t30_state_t *s, int count);
555 
556 /*! Set a callback function for T.30 phase B handling.
557  \brief Set a callback function for T.30 phase B handling.
558  \param s The T.30 context.
559  \param handler The callback function.
560  \param user_data An opaque pointer passed to the callback function. */
561 SPAN_DECLARE(void) t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t handler, void *user_data);
562 
563 /*! Set a callback function for T.30 phase D handling.
564  \brief Set a callback function for T.30 phase D handling.
565  \param s The T.30 context.
566  \param handler The callback function.
567  \param user_data An opaque pointer passed to the callback function. */
568 SPAN_DECLARE(void) t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t handler, void *user_data);
569 
570 /*! Set a callback function for T.30 phase E handling.
571  \brief Set a callback function for T.30 phase E handling.
572  \param s The T.30 context.
573  \param handler The callback function.
574  \param user_data An opaque pointer passed to the callback function. */
575 SPAN_DECLARE(void) t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t handler, void *user_data);
576 
577 /*! Set a callback function for T.30 end of document handling.
578  \brief Set a callback function for T.30 end of document handling.
579  \param s The T.30 context.
580  \param handler The callback function.
581  \param user_data An opaque pointer passed to the callback function. */
582 SPAN_DECLARE(void) t30_set_document_handler(t30_state_t *s, t30_document_handler_t handler, void *user_data);
583 
584 /*! Set a callback function for T.30 frame exchange monitoring. This is called from the heart
585  of the signal processing, so don't take too long in the handler routine.
586  \brief Set a callback function for T.30 frame exchange monitoring.
587  \param s The T.30 context.
588  \param handler The callback function.
589  \param user_data An opaque pointer passed to the callback function. */
590 SPAN_DECLARE(void) t30_set_real_time_frame_handler(t30_state_t *s, t30_real_time_frame_handler_t handler, void *user_data);
591 
592 SPAN_DECLARE(void) t30_set_document_get_handler(t30_state_t *s, t30_document_get_handler_t handler, void *user_data);
593 
594 SPAN_DECLARE(void) t30_set_document_put_handler(t30_state_t *s, t30_document_put_handler_t handler, void *user_data);
595 
596 /*! Get a pointer to the logging context associated with a T.30 context.
597  \brief Get a pointer to the logging context associated with a T.30 context.
598  \param s The T.30 context.
599  \return A pointer to the logging context, or NULL.
600 */
602 
603 #if defined(__cplusplus)
604 }
605 #endif
606 
607 #endif
608 /*- End of file ------------------------------------------------------------*/
Definition: private/logging.h:34
Definition: private/t30.h:36
void(* t30_phase_e_handler_t)(void *user_data, int completion_code)
T.30 phase E callback handler.
Definition: t30.h:177
int(* t30_phase_d_handler_t)(void *user_data, int result)
T.30 phase D callback handler.
Definition: t30.h:169
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
int(* t30_phase_b_handler_t)(void *user_data, int result)
T.30 phase B callback handler.
Definition: t30.h:160
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_document_handler_t)(void *user_data, int status)
T.30 document handler.
Definition: t30.h:198
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_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:618
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:658
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:470
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:100
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:238
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:538
const char * t30_get_tx_password(t30_state_t *s)
Get the received password associated with a T.30 context.
Definition: t30_api.c:356
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:1012
int t30_set_ecm_capability(t30_state_t *s, bool enabled)
Select ECM capability.
Definition: t30_api.c:786
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:818
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:606
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:998
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:698
void t30_set_max_command_tries(t30_state_t *s, int tries)
Select maximum command tries.
Definition: t30_api.c:800
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:479
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:646
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:432
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:394
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:331
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:686
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:254
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:1047
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:751
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:578
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:674
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:340
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:634
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:297
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:514
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:594
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:157
int t30_set_supported_compressions(t30_state_t *s, int supported_compressions)
Specify supported compression types.
Definition: t30_api.c:877
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:450
int t30_set_supported_modems(t30_state_t *s, int supported_modems)
Specify supported modems.
Definition: t30_api.c:869
void t30_set_iaf_mode(t30_state_t *s, int iaf)
Set Internet aware FAX (IAF) mode.
Definition: t30_api.c:780
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:306
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:488
int t30_set_supported_bilevel_resolutions(t30_state_t *s, int supported_resolutions)
Specify supported bi-level resolutions.
Definition: t30_api.c:913
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:771
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:322
const char * t30_get_tx_ident(t30_state_t *s)
Set the transmitted identifier associated with a T.30 context.
Definition: t30_api.c:186
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:812
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:566
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:757
int t30_set_supported_colour_resolutions(t30_state_t *s, int supported_resolutions)
Specify supported colour resolutions.
Definition: t30_api.c:938
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:706
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:220
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:263
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:745
void t30_set_rx_file(t30_state_t *s, const char *file, int stop_page)
Set next receive file name.
Definition: t30_api.c:763
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:288
int t30_set_supported_image_sizes(t30_state_t *s, int supported_image_sizes)
Specify supported image sizes.
Definition: t30_api.c:955
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:554
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:229
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:1005
const char * t30_get_rx_password(t30_state_t *s)
Get the received password associated with a T.30 context.
Definition: t30_api.c:365
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:723
void t30_set_retransmit_capable(t30_state_t *s, bool enabled)
Select page retransmission capable.
Definition: t30_api.c:794
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:169
int t30_set_minimum_scan_line_time(t30_state_t *s, int min_time)
Specify minimum scan line time.
Definition: t30_api.c:847
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:374
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:403
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:991
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:412
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:1026
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:441
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:526
int t30_set_supported_t30_features(t30_state_t *s, int supported_t30_features)
Specify supported T.30 features.
Definition: t30_api.c:972
const char * t30_get_rx_ident(t30_state_t *s)
Set the transmitted identifier associated with a T.30 context.
Definition: t30_api.c:195
void t30_set_status(t30_state_t *s, int status)
Set T.30 status.
Definition: t30_api.c:980
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:204
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:732
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:1019
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:272
void t30_set_max_response_tries(t30_state_t *s, int tries)
Select maximum response tries.
Definition: t30_api.c:806