spandsp  0.0.6
t30_api.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <fcntl.h>
#include <time.h>
#include "floating_fudge.h"
#include <tiffio.h>
#include "spandsp/telephony.h"
#include "spandsp/logging.h"
#include "spandsp/bit_operations.h"
#include "spandsp/queue.h"
#include "spandsp/power_meter.h"
#include "spandsp/complex.h"
#include "spandsp/tone_generate.h"
#include "spandsp/async.h"
#include "spandsp/hdlc.h"
#include "spandsp/fsk.h"
#include "spandsp/v29rx.h"
#include "spandsp/v29tx.h"
#include "spandsp/v27ter_rx.h"
#include "spandsp/v27ter_tx.h"
#include "spandsp/timezone.h"
#include "spandsp/t4_rx.h"
#include "spandsp/t4_tx.h"
#include "spandsp/t4_t6_decode.h"
#include "spandsp/t4_t6_encode.h"
#include "spandsp/t30_fcf.h"
#include "spandsp/t35.h"
#include "spandsp/t30.h"
#include "spandsp/t30_api.h"
#include "spandsp/t30_logging.h"
#include "spandsp/private/logging.h"
#include "spandsp/private/timezone.h"
#include "spandsp/private/t4_t6_decode.h"
#include "spandsp/private/t4_t6_encode.h"
#include "spandsp/private/t4_rx.h"
#include "spandsp/private/t4_tx.h"
#include "spandsp/private/t30.h"
#include "t30_local.h"

Functions

int t30_set_tx_ident (t30_state_t *s, const char *id)
 Set the transmitted identifier associated with a T.30 context. More...
 
const char * t30_get_tx_ident (t30_state_t *s)
 Set the transmitted identifier associated with a T.30 context. More...
 
const char * t30_get_rx_ident (t30_state_t *s)
 Set the transmitted identifier associated with a T.30 context. More...
 
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. More...
 
const char * t30_get_tx_sub_address (t30_state_t *s)
 Get the received sub-address associated with a T.30 context. More...
 
const char * t30_get_rx_sub_address (t30_state_t *s)
 Get the received sub-address associated with a T.30 context. More...
 
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. More...
 
const char * t30_get_tx_selective_polling_address (t30_state_t *s)
 Get the received selective polling address associated with a T.30 context. More...
 
const char * t30_get_rx_selective_polling_address (t30_state_t *s)
 Get the received selective polling address associated with a T.30 context. More...
 
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. More...
 
const char * t30_get_tx_polled_sub_address (t30_state_t *s)
 Get the received polled sub-address associated with a T.30 context. More...
 
const char * t30_get_rx_polled_sub_address (t30_state_t *s)
 Get the received polled sub-address associated with a T.30 context. More...
 
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. More...
 
const char * t30_get_tx_sender_ident (t30_state_t *s)
 Get the received sender ident associated with a T.30 context. More...
 
const char * t30_get_rx_sender_ident (t30_state_t *s)
 Get the received sender ident associated with a T.30 context. More...
 
int t30_set_tx_password (t30_state_t *s, const char *password)
 Set the transmitted password associated with a T.30 context. More...
 
const char * t30_get_tx_password (t30_state_t *s)
 Get the received password associated with a T.30 context. More...
 
const char * t30_get_rx_password (t30_state_t *s)
 Get the received password associated with a T.30 context. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int t30_set_tx_page_header_overlays_image (t30_state_t *s, int header_overlays_image)
 Set page header overlay mode. More...
 
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. More...
 
size_t t30_get_tx_page_header_info (t30_state_t *s, char *info)
 Get the header information associated with a T.30 context. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void t30_set_rx_file (t30_state_t *s, const char *file, int stop_page)
 Set next receive file name. More...
 
void t30_set_tx_file (t30_state_t *s, const char *file, int start_page, int stop_page)
 Set next transmit file name. More...
 
void t30_set_iaf_mode (t30_state_t *s, int iaf)
 Set Internet aware FAX (IAF) mode. More...
 
int t30_set_ecm_capability (t30_state_t *s, int enabled)
 Select ECM capability. More...
 
int t30_set_rx_encoding (t30_state_t *s, int encoding)
 Specify the output encoding for TIFF files created during FAX reception. More...
 
int t30_set_minimum_scan_line_time (t30_state_t *s, int min_time)
 Specify minimum scan line time. More...
 
int t30_set_supported_modems (t30_state_t *s, int supported_modems)
 Specify supported modems. More...
 
int t30_set_supported_compressions (t30_state_t *s, int supported_compressions)
 Specify supported compression types. More...
 
int t30_set_supported_resolutions (t30_state_t *s, int supported_resolutions)
 Specify supported resolutions. More...
 
int t30_set_supported_image_sizes (t30_state_t *s, int supported_image_sizes)
 Specify supported image sizes. More...
 
int t30_set_supported_t30_features (t30_state_t *s, int supported_t30_features)
 Specify supported T.30 features. More...
 
void t30_set_status (t30_state_t *s, int status)
 Set T.30 status. More...
 
int t30_set_receiver_not_ready (t30_state_t *s, int count)
 Specify a period of responding with receiver not ready. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
logging_state_tt30_get_logging_state (t30_state_t *s)
 Get a pointer to the logging context associated with a T.30 context. More...
 

Function Documentation

◆ 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.

Get a pointer to the logging context associated with a T.30 context.

Parameters
sThe T.30 context.
Returns
A pointer to the logging context, or NULL.

References t30_state_s::logging.

◆ t30_get_rx_cia()

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.

Get the received CIA associated with a T.30 context.

Parameters
sThe T.30 context.
typeThe type of address.
addressA pointer to the address.
Returns
0 for OK, else -1.

◆ t30_get_rx_country()

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.

Get the country of origin of the remote FAX machine associated with a T.30 context.

Parameters
sThe T.30 context.
Returns
a pointer to the country name, or NULL if the country is not known.

References t30_state_s::country.

◆ t30_get_rx_csa()

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.

Get the received CSA associated with a T.30 context.

Parameters
sThe T.30 context.
typeThe type of address.
addressA pointer to the address.
Returns
0 for OK, else -1.

◆ t30_get_rx_ident()

const char* t30_get_rx_ident ( t30_state_t s)

Set the transmitted identifier associated with a T.30 context.

Get the transmitted identifier associated with a T.30 context.

Parameters
sThe T.30 context.
Returns
A pointer to the identifier.

References t30_exchanged_info_t::ident, and t30_state_s::rx_info.

◆ t30_get_rx_ira()

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.

Get the received IRA associated with a T.30 context.

Parameters
sThe T.30 context.
typeThe type of address.
addressA pointer to the address.
Returns
The length of the address.

◆ t30_get_rx_isp()

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.

Get the received ISP associated with a T.30 context.

Parameters
sThe T.30 context.
typeThe type of address.
addressA pointer to the address.
Returns
0 for OK, else -1.

◆ t30_get_rx_model()

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.

Get the name of the model of the remote FAX machine associated with a T.30 context.

Parameters
sThe T.30 context.
Returns
a pointer to the model name, or NULL if the model is not known.

References t30_state_s::model.

◆ t30_get_rx_nsc()

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.

Get an NSC frame to be associated with a T.30 context.

Parameters
sThe T.30 context.
nscA pointer to the frame.
Returns
the length of the NSC message.

References t30_exchanged_info_t::nsc, and t30_state_s::rx_info.

◆ t30_get_rx_nsf()

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.

Get an NSF frame to be associated with a T.30 context.

Parameters
sThe T.30 context.
nsfA pointer to the frame.
Returns
the length of the NSF message.

References t30_exchanged_info_t::nsf, and t30_state_s::rx_info.

◆ t30_get_rx_nss()

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.

Get an NSS frame to be associated with a T.30 context.

Parameters
sThe T.30 context.
nssA pointer to the frame.
Returns
the length of the NSS message.

References t30_exchanged_info_t::nss, and t30_state_s::rx_info.

◆ t30_get_rx_password()

const char* t30_get_rx_password ( t30_state_t s)

Get the received password associated with a T.30 context.

Get the received password (i.e. the one we will send to the far end) associated with a T.30 context.

Parameters
sThe T.30 context.
Returns
A pointer to the password.

References t30_exchanged_info_t::password, and t30_state_s::rx_info.

◆ t30_get_rx_polled_sub_address()

const char* t30_get_rx_polled_sub_address ( t30_state_t s)

Get the received polled sub-address associated with a T.30 context.

Get the received polled sub-address (i.e. the one we will send to the far end) associated with a T.30 context.

Parameters
sThe T.30 context.
Returns
A pointer to the polled sub-address.

References t30_exchanged_info_t::polled_sub_address, and t30_state_s::rx_info.

◆ t30_get_rx_selective_polling_address()

const char* t30_get_rx_selective_polling_address ( t30_state_t s)

Get the received selective polling address associated with a T.30 context.

Get the received selective polling address (i.e. the one we will send to the far end) associated with a T.30 context.

Parameters
sThe T.30 context.
Returns
A pointer to the selective polling address.

References t30_state_s::rx_info, and t30_exchanged_info_t::selective_polling_address.

◆ t30_get_rx_sender_ident()