28#if !defined(_SPANDSP_T30_H_)
29#define _SPANDSP_T30_H_
142#define T30_MAX_DIS_DTC_DCS_LEN 22
144#define T30_MAX_IDENT_LEN 20
146#define T30_MAX_PAGE_HEADER_INFO 50
356 T30_FRONT_END_SEND_STEP_COMPLETE = 0,
361 T30_FRONT_END_SIGNAL_PRESENT,
362 T30_FRONT_END_SIGNAL_ABSENT,
363 T30_FRONT_END_CED_PRESENT,
364 T30_FRONT_END_CNG_PRESENT
397 T30_IAF_MODE_T37 = 0x01,
398 T30_IAF_MODE_T38 = 0x02,
399 T30_IAF_MODE_FLOW_CONTROL = 0x04,
511#if defined(__cplusplus)
528SPAN_DECLARE(t30_state_t *)
t30_init(t30_state_t *s,
547SPAN_DECLARE(
int)
t30_free(t30_state_t *s);
587SPAN_DECLARE(
int)
t30_non_ecm_get(
void *user_data, uint8_t buf[],
int max_len);
600SPAN_DECLARE(
void)
t30_non_ecm_put(
void *user_data,
const uint8_t buf[],
int len);
608SPAN_DECLARE(
void)
t30_hdlc_accept(
void *user_data,
const uint8_t msg[],
int len,
int ok);
634#if defined(__cplusplus)
uint8_t * nsf
Non-standard facilities (NSF).
Definition t30.h:431
int ira_type
Internet routing address (IRA).
Definition t30.h:444
int isp_type
Internet selective polling address (ISP).
Definition t30.h:452
uint8_t * nsc
Non-standard facilities command (NSC).
Definition t30.h:434
int cia_type
Calling subscriber internet address (CIA).
Definition t30.h:448
char polled_sub_address[20+1]
The polled sub-address (PSA).
Definition t30.h:425
char ident[20+1]
The identifier string (CSI, TSI, CIG).
Definition t30.h:419
int tsa_type
Transmitting subscriber internet address (TSA).
Definition t30.h:440
char sub_address[20+1]
The sub-address string (SUB).
Definition t30.h:421
uint8_t * nss
Non-standard facilities set-up (NSS).
Definition t30.h:437
char selective_polling_address[20+1]
The selective polling sub-address (SEP).
Definition t30.h:423
char password[20+1]
The password (PWD).
Definition t30.h:429
int csa_type
Called subscriber internet address (CSA).
Definition t30.h:456
char sender_ident[20+1]
The sender identification (SID).
Definition t30.h:427
Definition private/t30.h:36
t30_set_handler_t set_tx_type_handler
The handler for changes to the transmit mode.
Definition private/t30.h:136
void * set_tx_type_user_data
An opaque pointer passed to the handler for changes to the transmit mode.
Definition private/t30.h:138
bool short_train
True if the short training sequence should be used.
Definition private/t30.h:182
bool calling_party
True if behaving as the calling party.
Definition private/t30.h:47
t30_send_hdlc_handler_t send_hdlc_handler
The transmitted HDLC frame handler.
Definition private/t30.h:141
void * send_hdlc_user_data
An opaque pointer passed to the transmitted HDLC frame handler.
Definition private/t30.h:143
void * set_rx_type_user_data
An opaque pointer passed to the handler for changes to the receive mode.
Definition private/t30.h:134
t30_set_handler_t set_rx_type_handler
The handler for changes to the receive mode.
Definition private/t30.h:132
int error_correcting_mode_retries
The number of HDLC frame retries, if error correcting mode is used.
Definition t30.h:502
int bit_rate
The current bit rate for image transfer.
Definition t30.h:464
int image_size
The size of the image, in bytes.
Definition t30.h:494
int current_status
Current status.
Definition t30.h:504
int width
The number of horizontal pixels in the most recent exchanged page.
Definition t30.h:490
int image_width
The number of horizontal pixels in the most recent file page.
Definition t30.h:480
int type
The type of image of the most recent exchanged page.
Definition t30.h:484
int image_type
The type of image of the most recent file page.
Definition t30.h:474
int error_correcting_mode
True if error correcting mode is used.
Definition t30.h:466
int longest_bad_row_run
The largest number of bad pixel rows in a block in the most recent page.
Definition t30.h:500
int y_resolution
The vertical row-to-row resolution of the most recent exchanged page, in pixels per metre.
Definition t30.h:488
int length
The number of vertical pixels in the most recent exchanged page.
Definition t30.h:492
int pages_in_file
The number of pages in the file (<0 if not known).
Definition t30.h:472
int rtn_events
The number of RTN events in this call.
Definition t30.h:508
int pages_tx
The number of pages sent so far.
Definition t30.h:468
int image_length
The number of vertical pixels in the most recent file page.
Definition t30.h:482
int image_x_resolution
The horizontal column-to-column resolution of the most recent file page, in pixels per metre.
Definition t30.h:476
int x_resolution
The horizontal column-to-column resolution of the most recent exchanged page, in pixels per metre.
Definition t30.h:486
int bad_rows
The number of bad pixel rows in the most recent page.
Definition t30.h:498
int compression
The type of compression used between the FAX machines.
Definition t30.h:496
int pages_rx
The number of pages received so far.
Definition t30.h:470
int image_y_resolution
The vertical row-to-row resolution of the most recent file page, in pixels per metre.
Definition t30.h:478
int rtp_events
The number of RTP events in this call.
Definition t30.h:506
void t30_remote_interrupts_allowed(t30_state_t *s, int state)
Allow remote interrupts of FAX exchange.
Definition t30.c:7290
void t30_terminate(t30_state_t *s)
Cleanup a T.30 context if the call terminates.
Definition t30.c:7193
@ T30_IAF_MODE_NO_FILL_BITS
Definition t30.h:408
@ T30_IAF_MODE_NO_INDICATORS
Definition t30.h:410
@ T30_IAF_MODE_CONTINUOUS_FLOW
Definition t30.h:402
@ T30_IAF_MODE_RELAXED_TIMERS
Definition t30.h:413
@ T30_IAF_MODE_NO_TCF
Definition t30.h:405
@ T30_ERR_RX_T2EXPDCN
Definition t30.h:280
@ T30_ERR_NOSIZESUPPORT
Definition t30.h:259
@ T30_ERR_TX_PHBDEAD
Definition t30.h:269
@ T30_ERR_IRA_UNACCEPTABLE
Definition t30.h:315
@ T30_ERR_TX_INCAPABLE
Definition t30.h:257
@ T30_ERR_T0_EXPIRED
Definition t30.h:249
@ T30_ERR_RX_NOFAX
Definition t30.h:279
@ T30_ERR_ISP_UNACCEPTABLE
Definition t30.h:317
@ T30_ERR_CSA_UNACCEPTABLE
Definition t30.h:318
@ T30_ERR_CEDTONE
Definition t30.h:248
@ T30_ERR_RX_NOEOL
Definition t30.h:278
@ T30_ERR_NOPOLL
Definition t30.h:307
@ T30_ERR_PWD_UNACCEPTABLE
Definition t30.h:313
@ T30_ERR_RX_DCNNORTN
Definition t30.h:291
@ T30_ERR_SEP_UNACCEPTABLE
Definition t30.h:310
@ T30_ERR_INCOMPATIBLE
Definition t30.h:255
@ T30_ERR_TX_T5EXP
Definition t30.h:271
@ T30_ERR_NOPAGE
Definition t30.h:295
@ T30_ERR_RETRYDCN
Definition t30.h:303
@ T30_ERR_RX_DCNPHD
Definition t30.h:289
@ T30_ERR_BADTIFF
Definition t30.h:296
@ T30_ERR_FILEERROR
Definition t30.h:294
@ T30_ERR_NOMEM
Definition t30.h:300
@ T30_ERR_BADTIFFHDR
Definition t30.h:299
@ T30_ERR_TSA_UNACCEPTABLE
Definition t30.h:314
@ T30_ERR_BADTAG
Definition t30.h:298
@ T30_ERR_RX_DCNFAX
Definition t30.h:288
@ T30_ERR_UNEXPECTED
Definition t30.h:260
@ T30_ERR_SUB_UNACCEPTABLE
Definition t30.h:309
@ T30_ERR_HDLC_CARRIER
Definition t30.h:252
@ T30_ERR_RX_T2EXPD
Definition t30.h:281
@ T30_ERR_T1_EXPIRED
Definition t30.h:250
@ T30_ERR_RX_GOTDCS
Definition t30.h:275
@ T30_ERR_TX_PHDDEAD
Definition t30.h:270
@ T30_ERR_RX_T2EXPFAX
Definition t30.h:282
@ T30_ERR_RX_DCNWHY
Definition t30.h:286
@ T30_ERR_NORESSUPPORT
Definition t30.h:258
@ T30_ERR_TX_NODIS
Definition t30.h:268
@ T30_ERR_IDENT_UNACCEPTABLE
Definition t30.h:308
@ T30_ERR_RX_DCNDATA
Definition t30.h:287
@ T30_ERR_RX_T2EXPRR
Definition t30.h:284
@ T30_ERR_CANNOT_TRAIN
Definition t30.h:253
@ T30_ERR_TX_BADPG
Definition t30.h:264
@ T30_ERR_T3_EXPIRED
Definition t30.h:251
@ T30_ERR_CALLDROPPED
Definition t30.h:304
@ T30_ERR_SID_UNACCEPTABLE
Definition t30.h:312
@ T30_ERR_RX_NOCARRIER
Definition t30.h:277
@ T30_ERR_TX_BADDCS
Definition t30.h:263
@ T30_ERR_RX_ECMPHD
Definition t30.h:274
@ T30_ERR_TX_GOTDCN
Definition t30.h:266
@ T30_ERR_BADPAGE
Definition t30.h:297
@ T30_ERR_OPER_INT_FAIL
Definition t30.h:254
@ T30_ERR_RX_DCNRRD
Definition t30.h:290
@ T30_ERR_RX_T2EXPMPS
Definition t30.h:283
@ T30_ERR_TX_INVALRSP
Definition t30.h:267
@ T30_ERR_TX_ECMPHD
Definition t30.h:265
@ T30_ERR_RX_T2EXP
Definition t30.h:285
@ T30_ERR_RX_INVALCMD
Definition t30.h:276
@ T30_ERR_PSA_UNACCEPTABLE
Definition t30.h:311
@ T30_ERR_CIA_UNACCEPTABLE
Definition t30.h:316
@ T30_ERR_RX_INCAPABLE
Definition t30.h:256
void t30_timer_update(t30_state_t *s, int samples)
Report the passage of time to the T.30 engine.
Definition t30.c:7114
int t30_release(t30_state_t *s)
Release a T.30 context.
Definition t30.c:7388
int t30_restart(t30_state_t *s, bool calling_party)
Restart a T.30 context.
Definition t30.c:7296
void t30_front_end_status(void *user_data, int status)
Inform the T.30 engine of a status change in the front end (end of tx, rx signal change,...
Definition t30.c:6799
int t30_call_active(t30_state_t *s)
Check if a T.30 call is still active.
Definition t30.c:7405
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
#define T30_MAX_IDENT_LEN
Definition t30.h:144
t30_state_t * t30_init(t30_state_t *s, bool calling_party, t30_set_handler_t set_rx_type_handler, void *set_rx_type_user_data, t30_set_handler_t set_tx_type_handler, void *set_tx_type_user_data, t30_send_hdlc_handler_t send_hdlc_handler, void *send_hdlc_user_data)
Initialise a T.30 context.
Definition t30.c:7338
void t30_non_ecm_put_bit(void *user_data, int bit)
Process a bit of received non-ECM image data.
Definition t30.c:6416
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
void t30_get_transfer_statistics(t30_state_t *s, t30_stats_t *t)
Get the current transfer statistics.
Definition t30.c:7229
int t30_non_ecm_get_bit(void *user_data)
Get a bit of received non-ECM image data.
Definition t30.c:6514
void(* t30_send_hdlc_handler_t)(void *user_data, const uint8_t msg[], int len)
T.30 send HDLC handler.
Definition t30.h:218
int(* t30_phase_b_handler_t)(void *user_data, int result)
T.30 phase B callback handler.
Definition t30.h:160
@ T30_FRONT_END_RECEIVE_COMPLETE
Definition t30.h:360
void(* t30_set_handler_t)(void *user_data, int type, int bit_rate, int short_train, int use_hdlc)
T.30 set a receive or transmit type handler.
Definition t30.h:209
int t30_free(t30_state_t *s)
Free a T.30 context.
Definition t30.c:7397
void t30_non_ecm_put(void *user_data, const uint8_t buf[], int len)
Process a chunk of received non-ECM image data.
Definition t30.c:6465
void t30_hdlc_accept(void *user_data, const uint8_t msg[], int len, int ok)
Process a received HDLC frame.
@ T30_SUPPORT_POLLED_SUB_ADDRESSING
Definition t30.h:374
@ T30_SUPPORT_INTERNET_ROUTING_ADDRESS
Definition t30.h:382
@ T30_SUPPORT_MULTIPLE_SELECTIVE_POLLING
Definition t30.h:376
@ T30_SUPPORT_TRANSMITTING_SUBSCRIBER_INTERNET_ADDRESS
Definition t30.h:380
@ T30_SUPPORT_IDENTIFICATION
Definition t30.h:370
@ T30_SUPPORT_CALLING_SUBSCRIBER_INTERNET_ADDRESS
Definition t30.h:384
@ T30_SUPPORT_COMMAND_REPEAT
Definition t30.h:392
@ T30_SUPPORT_SELECTIVE_POLLING
Definition t30.h:372
@ T30_SUPPORT_SUB_ADDRESSING
Definition t30.h:378
@ T30_SUPPORT_FIELD_NOT_VALID
Definition t30.h:390
@ T30_SUPPORT_CALLED_SUBSCRIBER_INTERNET_ADDRESS
Definition t30.h:388
@ T30_SUPPORT_INTERNET_SELECTIVE_POLLING_ADDRESS
Definition t30.h:386
void t30_local_interrupt_request(t30_state_t *s, int state)
Request a local interrupt of FAX exchange.
Definition t30.c:7277
int t30_non_ecm_get(void *user_data, uint8_t buf[], int max_len)
Get a bit of received non-ECM image data.
Definition t30.c:6551
int(* t30_document_get_handler_t)(void *user_data, uint8_t msg[], int len)
T.30 send document handler.
Definition t30.h:228
@ T30_SUPPORT_V34HDX
Definition t30.h:349
@ T30_SUPPORT_IAF
Definition t30.h:351
@ T30_SUPPORT_V27TER
Definition t30.h:343
@ T30_SUPPORT_V17
Definition t30.h:347
@ T30_SUPPORT_V29
Definition t30.h:345
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