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)
40 extern "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 */
51 SPAN_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 */
60 SPAN_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 */
68 SPAN_DECLARE(const char *) t35_country_code_to_str(int country_code, int country_code_extension);
69 
70 SPAN_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 */
88 SPAN_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 ------------------------------------------------------------*/
t30_set_rx_file
void t30_set_rx_file(t30_state_t *s, const char *file, int stop_page)
Set next receive file name.
Definition: t30_api.c:614
model_data_t::model_id
const char * model_id
Definition: t35.c:75
t31_init
t31_state_t * t31_init(t31_state_t *s, at_tx_handler_t *at_tx_handler, void *at_tx_user_data, t31_modem_control_handler_t *modem_control_handler, void *modem_control_user_data, t38_tx_packet_handler_t *tx_t38_packet_handler, void *tx_t38_packet_user_data)
Initialise a T.31 context.
Definition: t31.c:2605
AT_MODEM_CONTROL_ANSWER
@ AT_MODEM_CONTROL_ANSWER
Definition: at_interpreter.h:65
AT_MODEM_CONTROL_CAR
@ AT_MODEM_CONTROL_CAR
Definition: at_interpreter.h:79
AT_MODEM_CONTROL_RNG
@ AT_MODEM_CONTROL_RNG
Definition: at_interpreter.h:81
fax_init
fax_state_t * fax_init(fax_state_t *s, int calling_party)
Initialise a FAX context.
Definition: fax.c:664
nsf_data_t::vendor_id
const char * vendor_id
Definition: t35.c:84
t35_decode
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
t35_real_country_code
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
nsf_data_t
Definition: t35.c:82
command_response_s
Definition: at_interpreter_tests.c:55
fax_utils.h
t38_core_state_s
Definition: private/t38_core.h:33
AT_MODEM_CONTROL_OFFHOOK
@ AT_MODEM_CONTROL_OFFHOOK
Definition: at_interpreter.h:69
AT_MODEM_CONTROL_CALL
@ AT_MODEM_CONTROL_CALL
Definition: at_interpreter.h:63
t30_frametype
const char * t30_frametype(uint8_t x)
Return a text name for a T.30 frame type.
Definition: t30_logging.c:241
t35_real_country_code
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
model_data_t::model_name
const char * model_name
Definition: t35.c:77
t35_real_country_code_to_str
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
AT_MODEM_CONTROL_RTS
@ AT_MODEM_CONTROL_RTS
Definition: at_interpreter.h:75
t35_country_code_to_str
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
model_data_t
Definition: t35.c:71
country_code_t
Definition: t35.c:97
nsf_data_t::known_models
const model_data_t * known_models
Definition: t35.c:92
t38_terminal_set_tep_mode
void t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_tep)
Select whether TEP time will be allowed for.
Definition: t38_terminal.c:1405
t38_terminal_get_t38_core_state
t38_core_state_t * t38_terminal_get_t38_core_state(t38_terminal_state_t *s)
Get a pointer to the T.38 core IFP packet engine associated with a T.38 context.
Definition: t38_terminal.c:1433
nsf_data_t::vendor_name
const char * vendor_name
Definition: t35.c:88
g1050_state_t
Definition: g1050.h:249
t31_state_s
Definition: private/t31.h:137
t38_core_get_logging_state
logging_state_t * t38_core_get_logging_state(t38_core_state_t *s)
Get a pointer to the logging context associated with a T.38 context.
Definition: t38_core.c:1076
AT_MODEM_CONTROL_DTR
@ AT_MODEM_CONTROL_DTR
Definition: at_interpreter.h:73
T30_SUPPORT_V29
@ T30_SUPPORT_V29
Definition: t30.h:344
t38_terminal_state_s
Definition: private/t38_terminal.h:111
country_code_t::vendors
const nsf_data_t * vendors
Definition: t35.c:101
t30_get_logging_state
logging_state_t * t30_get_logging_state(t30_state_t *s)
Get a pointer to the logging context associated with a T.30 context.
Definition: t30_api.c:784
T30_SUPPORT_V27TER
@ T30_SUPPORT_V27TER
Definition: t30.h:342
bit_operations.h
t35_country_code_to_str
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
fax_state_s
Definition: private/fax.h:36
t38_terminal_init
t38_terminal_state_t * t38_terminal_init(t38_terminal_state_t *s, int calling_party, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data)
Initialise a termination mode T.38 context.
Definition: t38_terminal.c:1509
span_log
int span_log(logging_state_t *s, int level, const char *format,...)
Generate a log entry.
Definition: logging.c:84
t35_decode
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
AT_MODEM_CONTROL_DSR
@ AT_MODEM_CONTROL_DSR
Definition: at_interpreter.h:83
nsf_data_t::vendor_id_len
int vendor_id_len
Definition: t35.c:86
t38_core_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition: private/t38_core.h:132
t30_set_phase_d_handler
void t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data)
Set a callback function for T.30 phase D handling.
Definition: t30_api.c:756
at_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition: private/at_interpreter.h:124
t30_set_tx_file
void t30_set_tx_file(t30_state_t *s, const char *file, int start_page, int stop_page)
Set next transmit file name.
Definition: t30_api.c:622
spandsp-sim.h
t38_terminal_release
int t38_terminal_release(t38_terminal_state_t *s)
Release a T.38 context.
Definition: t38_terminal.c:1549
t30_state_s
Definition: private/t30.h:36
AT_MODEM_CONTROL_HANGUP
@ AT_MODEM_CONTROL_HANGUP
Definition: at_interpreter.h:67
t30_set_phase_b_handler
void t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data)
Set a callback function for T.30 phase B handling.
Definition: t30_api.c:749
t38_terminal_set_config
void t38_terminal_set_config(t38_terminal_state_t *s, int config)
Set configuration options.
Definition: t38_terminal.c:1354
t35_real_country_code_to_str
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
fax_get_t30_state
t30_state_t * fax_get_t30_state(fax_state_t *s)
Get a pointer to the T.30 engine associated with a FAX context.
Definition: fax.c:591
t30_set_phase_e_handler
void t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data)
Set a callback function for T.30 phase E handling.
Definition: t30_api.c:763
t31_get_logging_state
logging_state_t * t31_get_logging_state(t31_state_t *s)
Get a pointer to the logging context associated with a T.31 context.
Definition: t31.c:2560
country_code_t::name
const char * name
Definition: t35.c:99
t38_core_state_s::tx_seq_no
int tx_seq_no
The sequence number for the next packet to be transmitted.
Definition: private/t38_core.h:112
t38_terminal_get_t30_state
t30_state_t * t38_terminal_get_t30_state(t38_terminal_state_t *s)
Get a pointer to the T.30 engine associated with a T.38 context.
Definition: t38_terminal.c:1427
nsf_data_t::inverse_station_id_order
int inverse_station_id_order
Definition: t35.c:90
t30_set_supported_modems
int t30_set_supported_modems(t30_state_t *s, int supported_modems)
Specify supported modems.
Definition: t30_api.c:680
fax_get_logging_state
logging_state_t * fax_get_logging_state(fax_state_t *s)
Get a pointer to the logging context associated with a FAX context.
Definition: fax.c:597
T30_SUPPORT_V17
@ T30_SUPPORT_V17
Definition: t30.h:346
t30_fcf.h
model_data_t::model_id_size
int model_id_size
Definition: t35.c:73
at_state_s
Definition: private/at_interpreter.h:45
t30_set_tx_ident
int t30_set_tx_ident(t30_state_t *s, const char *id)
Set the transmitted identifier associated with a T.30 context.
Definition: t30_api.c:90
t35.h
logging_state_s
Definition: private/logging.h:34
t38_set_t38_version
void t38_set_t38_version(t38_core_state_t *s, int t38_version)
Definition: t38_core.c:1034
t38_terminal_get_logging_state
logging_state_t * t38_terminal_get_logging_state(t38_terminal_state_t *s)
Get a pointer to the logging context associated with a T.38 context.
Definition: t38_terminal.c:1494
AT_MODEM_CONTROL_CTS
@ AT_MODEM_CONTROL_CTS
Definition: at_interpreter.h:77