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 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 transmitted TSA (i.e. the one we will send to the far
251  end) associated with a T.30 context.
252  \brief Set the transmitted TSA associated with a T.30 context.
253  \param s The T.30 context.
254  \param type The type of address.
255  \param address A pointer to the address.
256  \param len The length of the address.
257  \return 0 for OK, else -1. */
258 SPAN_DECLARE(int) t30_set_tx_tsa(t30_state_t *s, int type, const char *address, int len);
259 
260 /*! Get the transmitted TSA (i.e. the one we will send to the far
261  end) associated with a T.30 context.
262  \brief Get the received TSA associated with a T.30 context.
263  \param s The T.30 context.
264  \param type The type of address.
265  \param address A pointer to the address.
266  \return The length of the address. */
267 SPAN_DECLARE(size_t) t30_get_tx_tsa(t30_state_t *s, int *type, const char *address[]);
268 
269 /*! Get the received TSA associated with a T.30 context.
270  \brief Get the received TSA associated with a T.30 context.
271  \param s The T.30 context.
272  \param type The type of address.
273  \param address A pointer to the address.
274  \return The length of the address. */
275 SPAN_DECLARE(size_t) t30_get_rx_tsa(t30_state_t *s, int *type, const char *address[]);
276 
277 /*! Set the transmitted IRA (i.e. the one we will send to the far
278  end) associated with a T.30 context.
279  \brief Set the transmitted IRA associated with a T.30 context.
280  \param s The T.30 context.
281  \param type The type of address.
282  \param address A pointer to the address.
283  \param len The length of the address.
284  \return 0 for OK, else -1. */
285 SPAN_DECLARE(int) t30_set_tx_ira(t30_state_t *s, int type, const char *address, int len);
286 
287 /*! Get the transmitted IRA (i.e. the one we will send to the far
288  end) associated with a T.30 context.
289  \brief Get the received IRA associated with a T.30 context.
290  \param s The T.30 context.
291  \param type The type of address.
292  \param address A pointer to the address.
293  \return The length of the address. */
294 SPAN_DECLARE(size_t) t30_get_tx_ira(t30_state_t *s, int *type, const char *address[]);
295 
296 /*! Get the received IRA associated with a T.30 context.
297  \brief Get the received IRA associated with a T.30 context.
298  \param s The T.30 context.
299  \param type The type of address.
300  \param address A pointer to the address.
301  \return The length of the address. */
302 SPAN_DECLARE(size_t) t30_get_rx_ira(t30_state_t *s, int *type, const char *address[]);
303 
304 /*! Set the transmitted CIA (i.e. the one we will send to the far
305  end) associated with a T.30 context.
306  \brief Set the transmitted CIA associated with a T.30 context.
307  \param s The T.30 context.
308  \param type The type of address.
309  \param address A pointer to the address.
310  \param len The length of the address.
311  \return 0 for OK, else -1. */
312 SPAN_DECLARE(int) t30_set_tx_cia(t30_state_t *s, int type, const char *address, int len);
313 
314 /*! Get the transmitted CIA (i.e. the one we will send to the far
315  end) associated with a T.30 context.
316  \brief Get the received CIA associated with a T.30 context.
317  \param s The T.30 context.
318  \param type The type of address.
319  \param address A pointer to the address.
320  \return The length of the address. */
321 SPAN_DECLARE(size_t) t30_get_tx_cia(t30_state_t *s, int *type, const char *address[]);
322 
323 /*! Get the received CIA associated with a T.30 context.
324  \brief Get the received CIA associated with a T.30 context.
325  \param s The T.30 context.
326  \param type The type of address.
327  \param address A pointer to the address.
328  \return 0 for OK, else -1. */
329 SPAN_DECLARE(size_t) t30_get_rx_cia(t30_state_t *s, int *type, const char *address[]);
330 
331 /*! Set the transmitted ISP (i.e. the one we will send to the far
332  end) associated with a T.30 context.
333  \brief Set the transmitted ISP associated with a T.30 context.
334  \param s The T.30 context.
335  \param type The type of address.
336  \param address A pointer to the address.
337  \param len The length of the address.
338  \return 0 for OK, else -1. */
339 SPAN_DECLARE(int) t30_set_tx_isp(t30_state_t *s, int type, const char *address, int len);
340 
341 /*! Get the transmitted ISP (i.e. the one we will send to the far
342  end) associated with a T.30 context.
343  \brief Get the received ISP associated with a T.30 context.
344  \param s The T.30 context.
345  \param type The type of address.
346  \param address A pointer to the address.
347  \return 0 for OK, else -1. */
348 SPAN_DECLARE(size_t) t30_get_tx_isp(t30_state_t *s, int *type, const char *address[]);
349 
350 /*! Get the received ISP associated with a T.30 context.
351  \brief Get the received ISP associated with a T.30 context.
352  \param s The T.30 context.
353  \param type The type of address.
354  \param address A pointer to the address.
355  \return 0 for OK, else -1. */
356 SPAN_DECLARE(size_t) t30_get_rx_isp(t30_state_t *s, int *type, const char *address[]);
357 
358 /*! Set the transmitted CSA (i.e. the one we will send to the far
359  end) associated with a T.30 context.
360  \brief Set the transmitted CSA associated with a T.30 context.
361  \param s The T.30 context.
362  \param type The type of address.
363  \param address A pointer to the address.
364  \param len The length of the address.
365  \return 0 for OK, else -1. */
366 SPAN_DECLARE(int) t30_set_tx_csa(t30_state_t *s, int type, const char *address, int len);
367 
368 /*! Get the transmitted CSA (i.e. the one we will send to the far
369  end) associated with a T.30 context.
370  \brief Get the received CSA associated with a T.30 context.
371  \param s The T.30 context.
372  \param type The type of address.
373  \param address A pointer to the address.
374  \return The length of the address. */
375 SPAN_DECLARE(size_t) t30_get_tx_csa(t30_state_t *s, int *type, const char *address[]);
376 
377 /*! Get the received CSA associated with a T.30 context.
378  \brief Get the received CSA associated with a T.30 context.
379  \param s The T.30 context.
380  \param type The type of address.
381  \param address A pointer to the address.
382  \return 0 for OK, else -1. */
383 SPAN_DECLARE(size_t) t30_get_rx_csa(t30_state_t *s, int *type, const char *address[]);
384 
385 /*! Set page header extends or overlays the image mode.
386  \brief Set page header overlay mode.
387  \param s The T.30 context.
388  \param header_overlays_image True for overlay, or false for extend the page. */
390 
391 /*! Set the transmitted header information associated with a T.30 context.
392  \brief Set the transmitted header information associated with a T.30 context.
393  \param s The T.30 context.
394  \param info A pointer to the information string.
395  \return 0 for OK, else -1. */
396 SPAN_DECLARE(int) t30_set_tx_page_header_info(t30_state_t *s, const char *info);
397 
398 /*! Set the transmitted header timestamp timezone associated with a T.30 context.
399  \brief Set the transmitted header timestamp timezone associated with a T.30 context.
400  \param s The T.30 context.
401  \param info A pointer to the POSIZ timezone string.
402  \return 0 for OK, else -1. */
403 SPAN_DECLARE(int) t30_set_tx_page_header_tz(t30_state_t *s, const char *tzstring);
404 
405 /*! Get the header information associated with a T.30 context.
406  \brief Get the header information associated with a T.30 context.
407  \param s The T.30 context.
408  \param info A pointer to a buffer for the header information. The buffer
409  should be at least 51 bytes long.
410  \return the length of the string. */
411 SPAN_DECLARE(size_t) t30_get_tx_page_header_info(t30_state_t *s, char *info);
412 
413 /*! Get the country of origin of the remote FAX machine associated with a T.30 context.
414  \brief Get the country of origin of the remote FAX machine associated with a T.30 context.
415  \param s The T.30 context.
416  \return a pointer to the country name, or NULL if the country is not known. */
417 SPAN_DECLARE(const char *) t30_get_rx_country(t30_state_t *s);
418 
419 /*! Get the name of the vendor of the remote FAX machine associated with a T.30 context.
420  \brief Get the name of the vendor of the remote FAX machine associated with a T.30 context.
421  \param s The T.30 context.
422  \return a pointer to the vendor name, or NULL if the vendor is not known. */
423 SPAN_DECLARE(const char *) t30_get_rx_vendor(t30_state_t *s);
424 
425 /*! Get the name of the model of the remote FAX machine associated with a T.30 context.
426  \brief Get the name of the model of the remote FAX machine associated with a T.30 context.
427  \param s The T.30 context.
428  \return a pointer to the model name, or NULL if the model is not known. */
429 SPAN_DECLARE(const char *) t30_get_rx_model(t30_state_t *s);
430 
431 /*! Specify the file name of the next TIFF file to be received by a T.30
432  context.
433  \brief Set next receive file name.
434  \param s The T.30 context.
435  \param file The file name
436  \param stop_page The maximum page to receive. -1 for no restriction. */
437 SPAN_DECLARE(void) t30_set_rx_file(t30_state_t *s, const char *file, int stop_page);
438 
439 /*! Specify the file name of the next TIFF file to be transmitted by a T.30
440  context.
441  \brief Set next transmit file name.
442  \param s The T.30 context.
443  \param file The file name
444  \param start_page The first page to send. -1 for no restriction.
445  \param stop_page The last page to send. -1 for no restriction. */
446 SPAN_DECLARE(void) t30_set_tx_file(t30_state_t *s, const char *file, int start_page, int stop_page);
447 
448 /*! Set Internet aware FAX (IAF) mode.
449  \brief Set Internet aware FAX (IAF) mode.
450  \param s The T.30 context.
451  \param iaf True for IAF, or false for non-IAF. */
452 SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, int iaf);
453 
454 /*! Specify if error correction mode (ECM) is allowed by a T.30 context.
455  \brief Select ECM capability.
456  \param s The T.30 context.
457  \param enabled True for ECM capable, or false for not ECM capable.
458  \return 0 if OK, else -1. */
459 SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, int enabled);
460 
461 /*! Specify the output encoding for TIFF files created during FAX reception.
462  \brief Specify the output encoding for TIFF files created during FAX reception.
463  \param s The T.30 context.
464  \param encoding The coding required. The options are T4_COMPRESSION_ITU_T4_1D,
465  T4_COMPRESSION_ITU_T4_2D, T4_COMPRESSION_ITU_T6. T6 is usually the
466  densest option, but support for it is broken in a number of software
467  packages.
468  \return 0 if OK, else -1. */
469 SPAN_DECLARE(int) t30_set_rx_encoding(t30_state_t *s, int encoding);
470 
471 /*! Specify the minimum scan line time supported by a T.30 context.
472  \brief Specify minimum scan line time.
473  \param s The T.30 context.
474  \param min_time The minimum permitted scan line time, in milliseconds.
475  \return 0 if OK, else -1. */
476 SPAN_DECLARE(int) t30_set_minimum_scan_line_time(t30_state_t *s, int min_time);
477 
478 /*! Specify which modem types are supported by a T.30 context.
479  \brief Specify supported modems.
480  \param s The T.30 context.
481  \param supported_modems Bit field list of the supported modems.
482  \return 0 if OK, else -1. */
483 SPAN_DECLARE(int) t30_set_supported_modems(t30_state_t *s, int supported_modems);
484 
485 /*! Specify which compression types are supported by a T.30 context.
486  \brief Specify supported compression types.
487  \param s The T.30 context.
488  \param supported_compressions Bit field list of the supported compression types.
489  \return 0 if OK, else -1. */
491 
492 /*! Specify which resolutions are supported by a T.30 context.
493  \brief Specify supported resolutions.
494  \param s The T.30 context.
495  \param supported_resolutions Bit field list of the supported resolutions.
496  \return 0 if OK, else -1. */
498 
499 /*! Specify which images sizes are supported by a T.30 context.
500  \brief Specify supported image sizes.
501  \param s The T.30 context.
502  \param supported_image_sizes Bit field list of the supported widths and lengths.
503  \return 0 if OK, else -1. */
505 
506 /*! Specify which special T.30 features are supported by a T.30 context.
507  \brief Specify supported T.30 features.
508  \param s The T.30 context.
509  \param supported_t30_features Bit field list of the supported features.
510  \return 0 if OK, else -1. */
512 
513 /*! Set T.30 status. This may be used to adjust the status from within
514  the phase B and phase D callbacks.
515  \brief Set T.30 status.
516  \param s The T.30 context.
517  \param status The new status. */
518 SPAN_DECLARE(void) t30_set_status(t30_state_t *s, int status);
519 
520 /*! Specify a period of responding with receiver not ready.
521  \brief Specify a period of responding with receiver not ready.
522  \param s The T.30 context.
523  \param count The number of times to report receiver not ready.
524  \return 0 if OK, else -1. */
525 SPAN_DECLARE(int) t30_set_receiver_not_ready(t30_state_t *s, int count);
526 
527 /*! Set a callback function for T.30 phase B handling.
528  \brief Set a callback function for T.30 phase B handling.
529  \param s The T.30 context.
530  \param handler The callback function.
531  \param user_data An opaque pointer passed to the callback function. */
532 SPAN_DECLARE(void) t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data);
533 
534 /*! Set a callback function for T.30 phase D handling.
535  \brief Set a callback function for T.30 phase D handling.
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. */
539 SPAN_DECLARE(void) t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data);
540 
541 /*! Set a callback function for T.30 phase E handling.
542  \brief Set a callback function for T.30 phase E handling.
543  \param s The T.30 context.
544  \param handler The callback function.
545  \param user_data An opaque pointer passed to the callback function. */
546 SPAN_DECLARE(void) t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data);
547 
548 /*! Set a callback function for T.30 end of document handling.
549  \brief Set a callback function for T.30 end of document handling.
550  \param s The T.30 context.
551  \param handler The callback function.
552  \param user_data An opaque pointer passed to the callback function. */
553 SPAN_DECLARE(void) t30_set_document_handler(t30_state_t *s, t30_document_handler_t *handler, void *user_data);
554 
555 /*! Set a callback function for T.30 frame exchange monitoring. This is called from the heart
556  of the signal processing, so don't take too long in the handler routine.
557  \brief Set a callback function for T.30 frame exchange monitoring.
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_real_time_frame_handler(t30_state_t *s, t30_real_time_frame_handler_t *handler, void *user_data);
562 
563 #if 0
564 SPAN_DECLARE(void) t30_set_document_get_handler(t30_state_t *s, t30_document_get_handler_t handler, void *user_data);
565 
566 SPAN_DECLARE(void) t30_set_document_put_handler(t30_state_t *s, t30_document_put_handler_t handler, void *user_data);
567 #endif
568 
569 /*! Get a pointer to the logging context associated with a T.30 context.
570  \brief Get a pointer to the logging context associated with a T.30 context.
571  \param s The T.30 context.
572  \return A pointer to the logging context, or NULL.
573 */
575 
576 #if defined(__cplusplus)
577 }
578 #endif
579 
580 #endif
581 /*- 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:352
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:484
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:899
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:390
const char * t30_get_rx_password(t30_state_t *s)
Get the received password associated with a T.30 context.
Definition: t30_api.c:361
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:602
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:682
int supported_compressions
A bit mask of the currently supported image compression modes.
Definition: private/t30.h:54
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:906
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:318
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
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:670
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:234
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_ecm_capability(t30_state_t *s, int enabled)
Select ECM capability.
Definition: t30_api.c:784
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:428
int 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:75
void t30_set_iaf_mode(t30_state_t *s, int iaf)
Set Internet aware FAX (IAF) mode.
Definition: t30_api.c:778
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:302
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:950
int supported_resolutions
A bit mask of the currently supported image resolutions.
Definition: private/t30.h:56
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:574
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:408
const char * t30_get_tx_ident(t30_state_t *s)
Set the transmitted identifier associated with a T.30 context.
Definition: t30_api.c:182
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:250
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_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:268
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:873
int t30_set_supported_resolutions(t30_state_t *s, int supported_resolutions)
Specify supported resolutions.
Definition: t30_api.c:857
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:284
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:446
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:293
int t30_set_supported_image_sizes(t30_state_t *s, int supported_image_sizes)
Specify supported image sizes.
Definition: t30_api.c:865
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:327
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:792
int t30_set_supported_compressions(t30_state_t *s, int supported_compressions)
Specify supported compression types.
Definition: t30_api.c:837
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:550
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:562
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:153
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:590
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:510
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:466
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:892
void t30_set_status(t30_state_t *s, int status)
Set T.30 status.
Definition: t30_api.c:881
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:642
int supported_modems
A bit mask of the currently supported modem types.
Definition: private/t30.h:52
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:370
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
int t30_set_minimum_scan_line_time(t30_state_t *s, int min_time)
Specify minimum scan line time.
Definition: t30_api.c:807
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:96
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:630
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:259
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:522
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:534
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
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:399
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
int( t30_document_handler_t)(t30_state_t *s, void *user_data, int status)
T.30 document handler.
Definition: t30.h:204
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:336
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:913
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:654
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:475
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:437
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:694
const char * t30_get_rx_ident(t30_state_t *s)
Set the transmitted identifier associated with a T.30 context.
Definition: t30_api.c:191
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:216
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:165
int supported_t30_features
A bit mask of the currently supported T.30 special features.
Definition: private/t30.h:60
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:920
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:200
int iaf
Internet aware FAX mode bit mask.
Definition: private/t30.h:50
int t30_set_supported_modems(t30_state_t *s, int supported_modems)
Specify supported modems.
Definition: t30_api.c:829
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:927
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:225
int supported_image_sizes
A bit mask of the currently supported image sizes.
Definition: private/t30.h:58
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:614
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_real_time_frame_handler_t)(t30_state_t *s, void *user_data, int incoming, const uint8_t msg[], int len)
T.30 real time frame handler.
Definition: t30.h:191