spandsp 0.0.6
t35.h
Go to the documentation of this file.
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * t35.h - ITU T.35 FAX non-standard facility 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_T35_H_)
29#define _SPANDSP_T35_H_
30
31/*! \page t35_page T.35 manufacturer specific processing for FAX machines
32\section t35_page_sec_1 What does it do?
33???.
34
35\section t35_page_sec_2 How does it work?
36???.
37*/
38
39#if defined(__cplusplus)
40extern "C"
41{
42#endif
43
44/*! Resolve a T.35 country code its probable likely real value, using heuristics to try to resolve issues
45 of broken bit order in the country code.
46 \brief Resolve a T.35 country code with bit reversal resolution.
47 \param country_code The country code.
48 \param country_code_extension The country code extension.
49 \return The true country code, or -1 for an invalid code.
50*/
51SPAN_DECLARE(int) t35_real_country_code(int country_code, int country_code_extension);
52
53/*! Decode a T.35 country code to a country name, using heuristics to try to resolve issues of broken bit order
54 in the country code.
55 \brief Decode a T.35 country code to a country name, with bit reversal resolution.
56 \param country_code The country code.
57 \param country_code_extension The country code extension.
58 \return The country name, or NULL for an invalid country code.
59*/
60SPAN_DECLARE(const char *) t35_real_country_code_to_str(int country_code, int country_code_extension);
61
62/*! Decode a T.35 country code to a country name.
63 \brief Decode a T.35 country code to a country name.
64 \param country_code The country code.
65 \param country_code_extension The country code extension.
66 \return The country name, or NULL for an invalid country code.
67*/
68SPAN_DECLARE(const char *) t35_country_code_to_str(int country_code, int country_code_extension);
69
70SPAN_DECLARE(const char *) t35_vendor_to_str(const uint8_t *msg, int len);
71
72/*! Decode an NSF field to try to determine the make and model of the
73 remote machine.
74 \brief Decode an NSF field.
75 \param msg The NSF message.
76 \param len The length of the NSF message.
77 \param country A pointer which will be pointed to the identified country of origin.
78 If a NULL pointer is given, the country of origin will not be returned.
79 If the country of origin is not identified, NULL will be returned.
80 \param vendor A pointer which will be pointed to the identified vendor.
81 If a NULL pointer is given, the vendor ID will not be returned.
82 If the vendor is not identified, NULL will be returned.
83 \param model A pointer which will be pointed to the identified model.
84 If a NULL pointer is given, the model will not be returned.
85 If the model is not identified, NULL will be returned.
86 \return TRUE if the machine was identified, otherwise FALSE.
87*/
88SPAN_DECLARE(int) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model);
89
90#if defined(__cplusplus)
91}
92#endif
93
94#endif
95/*- End of file ------------------------------------------------------------*/
const char * t35_country_code_to_str(int country_code, int country_code_extension)
Decode a T.35 country code to a country name.
Definition: t35.c:853
int t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model)
Decode an NSF field.
Definition: t35.c:909
int t35_real_country_code(int country_code, int country_code_extension)
Resolve a T.35 country code with bit reversal resolution.
Definition: t35.c:791
const char * t35_real_country_code_to_str(int country_code, int country_code_extension)
Decode a T.35 country code to a country name, with bit reversal resolution.
Definition: t35.c:843