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
328 T30_FRONT_END_SEND_STEP_COMPLETE = 0,
333 T30_FRONT_END_SIGNAL_PRESENT,
334 T30_FRONT_END_SIGNAL_ABSENT,
335 T30_FRONT_END_CED_PRESENT,
336 T30_FRONT_END_CNG_PRESENT
413 T30_SUPPORT_215MM_WIDTH = 0x01,
414 T30_SUPPORT_255MM_WIDTH = 0x02,
415 T30_SUPPORT_303MM_WIDTH = 0x04,
417 T30_SUPPORT_UNLIMITED_LENGTH = 0x10000,
418 T30_SUPPORT_A4_LENGTH = 0x20000,
419 T30_SUPPORT_B4_LENGTH = 0x40000,
420 T30_SUPPORT_US_LETTER_LENGTH = 0x80000,
421 T30_SUPPORT_US_LEGAL_LENGTH = 0x100000
454 T30_IAF_MODE_T37 = 0x01,
455 T30_IAF_MODE_T38 = 0x02,
456 T30_IAF_MODE_FLOW_CONTROL = 0x04,
558#if defined(__cplusplus)
575SPAN_DECLARE(t30_state_t *)
t30_init(t30_state_t *s,
594SPAN_DECLARE(
int)
t30_free(t30_state_t *s);
665SPAN_DECLARE_NONSTD(
void) t30_hdlc_accept(
void *user_data,
const uint8_t msg[],
int len,
int ok);
691#if defined(__cplusplus)
uint8_t * nsf
Non-standard facilities (NSF).
Definition t30.h:488
int ira_type
Internet routing address (IRA).
Definition t30.h:501
int isp_type
Internet selective polling address (ISP).
Definition t30.h:509
uint8_t * nsc
Non-standard facilities command (NSC).
Definition t30.h:491
int cia_type
Calling subscriber internet address (CIA).
Definition t30.h:505
char polled_sub_address[20+1]
The polled sub-address (PSA).
Definition t30.h:482
char ident[20+1]
The identifier string (CSI, TSI, CIG).
Definition t30.h:476
int tsa_type
Transmitting subscriber internet address (TSA).
Definition t30.h:497
char sub_address[20+1]
The sub-address string (SUB).
Definition t30.h:478
uint8_t * nss
Non-standard facilities set-up (NSS).
Definition t30.h:494
char selective_polling_address[20+1]
The selective polling sub-address (SEP).
Definition t30.h:480
char password[20+1]
The password (PWD).
Definition t30.h:486
int csa_type
Called subscriber internet address (CSA).
Definition t30.h:513
char sender_ident[20+1]
The sender identification (SID).
Definition t30.h:484
Definition private/t30.h:36
t30_send_hdlc_handler_t * send_hdlc_handler
The transmitted HDLC frame handler.
Definition private/t30.h:132
int rtn_events
The number of RTN events.
Definition private/t30.h:303
int short_train
True if the short training sequence should be used.
Definition private/t30.h:166
void * set_tx_type_user_data
An opaque pointer passed to the handler for changes to the transmit mode.
Definition private/t30.h:129
int rtp_events
The number of RTP events.
Definition private/t30.h:301
t30_set_handler_t * set_rx_type_handler
The handler for changes to the receive mode.
Definition private/t30.h:123
int calling_party
True if behaving as the calling party.
Definition private/t30.h:47
void * send_hdlc_user_data
An opaque pointer passed to the transmitted HDLC frame handler.
Definition private/t30.h:134
void * set_rx_type_user_data
An opaque pointer passed to the handler for changes to the receive mode.
Definition private/t30.h:125
t30_set_handler_t * set_tx_type_handler
The handler for changes to the transmit mode.
Definition private/t30.h:127
int error_correcting_mode_retries
The number of HDLC frame retries, if error correcting mode is used.
Definition t30.h:547
int bit_rate
The current bit rate for image transfer.
Definition t30.h:521
int image_size
The size of the image, in bytes.
Definition t30.h:539
int current_status
Current status.
Definition t30.h:549
int width
The number of horizontal pixels in the most recent page.
Definition t30.h:535
int error_correcting_mode
TRUE if error correcting mode is used.
Definition t30.h:523
int longest_bad_row_run
The largest number of bad pixel rows in a block in the most recent page.
Definition t30.h:545
int y_resolution
The vertical row-to-row resolution of the most recent page, in pixels per metre.
Definition t30.h:533
int length
The number of vertical pixels in the most recent page.
Definition t30.h:537
int pages_in_file
The number of pages in the file (<0 if not known).
Definition t30.h:529
int pages_tx
The number of pages sent so far.
Definition t30.h:525
int encoding
The type of compression used between the FAX machines.
Definition t30.h:541
int x_resolution
The horizontal column-to-column resolution of the most recent page, in pixels per metre.
Definition t30.h:531
int bad_rows
The number of bad pixel rows in the most recent page.
Definition t30.h:543
int pages_rx
The number of pages received so far.
Definition t30.h:527
void t30_remote_interrupts_allowed(t30_state_t *s, int state)
Allow remote interrupts of FAX exchange.
Definition t30.c:6281
void t30_terminate(t30_state_t *s)
Cleanup a T.30 context if the call terminates.
Definition t30.c:6196
t30_state_t * t30_init(t30_state_t *s, int 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:6327
@ T30_FRONT_END_RECEIVE_COMPLETE
Definition t30.h:332
void t30_timer_update(t30_state_t *s, int samples)
Report the passage of time to the T.30 engine.
Definition t30.c:6127
int t30_release(t30_state_t *s)
Release a T.30 context.
Definition t30.c:6368
int t30_non_ecm_get_byte(void *user_data)
Get a byte of received non-ECM image data.
Definition t30.c:5573
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:5833
@ T30_SUPPORT_600_600_RESOLUTION
Definition t30.h:400
@ T30_SUPPORT_400_800_RESOLUTION
Definition t30.h:406
@ T30_SUPPORT_300_600_RESOLUTION
Definition t30.h:404
@ T30_SUPPORT_400_400_RESOLUTION
Definition t30.h:398
@ T30_SUPPORT_SUPERFINE_RESOLUTION
Definition t30.h:386
@ T30_SUPPORT_1200_1200_RESOLUTION
Definition t30.h:402
@ T30_SUPPORT_300_300_RESOLUTION
Definition t30.h:396
@ T30_SUPPORT_R8_RESOLUTION
Definition t30.h:391
@ T30_SUPPORT_R16_RESOLUTION
Definition t30.h:393
@ T30_SUPPORT_600_1200_RESOLUTION
Definition t30.h:408
@ T30_SUPPORT_STANDARD_RESOLUTION
Definition t30.h:382
@ T30_SUPPORT_FINE_RESOLUTION
Definition t30.h:384
@ T30_SUPPORT_R4_RESOLUTION
Definition t30.h:389
void t30_non_ecm_put_byte(void *user_data, int byte)
Process a byte of received non-ECM image data.
Definition t30.c:5457
int t30_call_active(t30_state_t *s)
Check if a T.30 call is still active.
Definition t30.c:6385
@ T30_SUPPORT_POLLED_SUB_ADDRESSING
Definition t30.h:431
@ T30_SUPPORT_INTERNET_ROUTING_ADDRESS
Definition t30.h:439
@ T30_SUPPORT_MULTIPLE_SELECTIVE_POLLING
Definition t30.h:433
@ T30_SUPPORT_TRANSMITTING_SUBSCRIBER_INTERNET_ADDRESS
Definition t30.h:437
@ T30_SUPPORT_IDENTIFICATION
Definition t30.h:427
@ T30_SUPPORT_CALLING_SUBSCRIBER_INTERNET_ADDRESS
Definition t30.h:441
@ T30_SUPPORT_COMMAND_REPEAT
Definition t30.h:449
@ T30_SUPPORT_SELECTIVE_POLLING
Definition t30.h:429
@ T30_SUPPORT_SUB_ADDRESSING
Definition t30.h:435
@ T30_SUPPORT_FIELD_NOT_VALID
Definition t30.h:447
@ T30_SUPPORT_CALLED_SUBSCRIBER_INTERNET_ADDRESS
Definition t30.h:445
@ T30_SUPPORT_INTERNET_SELECTIVE_POLLING_ADDRESS
Definition t30.h:443
@ T30_ERR_RX_T2EXPDCN
Definition t30.h:266
@ T30_ERR_NOSIZESUPPORT
Definition t30.h:245
@ T30_ERR_TX_PHBDEAD
Definition t30.h:255
@ T30_ERR_IRA_UNACCEPTABLE
Definition t30.h:301
@ T30_ERR_TX_INCAPABLE
Definition t30.h:243
@ T30_ERR_T0_EXPIRED
Definition t30.h:235
@ T30_ERR_RX_NOFAX
Definition t30.h:265
@ T30_ERR_ISP_UNACCEPTABLE
Definition t30.h:303
@ T30_ERR_CSA_UNACCEPTABLE
Definition t30.h:304
@ T30_ERR_CEDTONE
Definition t30.h:234
@ T30_ERR_RX_NOEOL
Definition t30.h:264
@ T30_ERR_NOPOLL
Definition t30.h:293
@ T30_ERR_PWD_UNACCEPTABLE
Definition t30.h:299
@ T30_ERR_RX_DCNNORTN
Definition t30.h:277
@ T30_ERR_SEP_UNACCEPTABLE
Definition t30.h:296
@ T30_ERR_INCOMPATIBLE
Definition t30.h:241
@ T30_ERR_TX_T5EXP
Definition t30.h:257
@ T30_ERR_NOPAGE
Definition t30.h:281
@ T30_ERR_RETRYDCN
Definition t30.h:289
@ T30_ERR_RX_DCNPHD
Definition t30.h:275
@ T30_ERR_BADTIFF
Definition t30.h:282
@ T30_ERR_FILEERROR
Definition t30.h:280
@ T30_ERR_NOMEM
Definition t30.h:286
@ T30_ERR_BADTIFFHDR
Definition t30.h:285
@ T30_ERR_TSA_UNACCEPTABLE
Definition t30.h:300
@ T30_ERR_BADTAG
Definition t30.h:284
@ T30_ERR_RX_DCNFAX
Definition t30.h:274
@ T30_ERR_UNEXPECTED
Definition t30.h:246
@ T30_ERR_SUB_UNACCEPTABLE
Definition t30.h:295
@ T30_ERR_HDLC_CARRIER
Definition t30.h:238
@ T30_ERR_RX_T2EXPD
Definition t30.h:267
@ T30_ERR_T1_EXPIRED
Definition t30.h:236
@ T30_ERR_RX_GOTDCS
Definition t30.h:261
@ T30_ERR_TX_PHDDEAD
Definition t30.h:256
@ T30_ERR_RX_T2EXPFAX
Definition t30.h:268
@ T30_ERR_RX_DCNWHY
Definition t30.h:272
@ T30_ERR_NORESSUPPORT
Definition t30.h:244
@ T30_ERR_TX_NODIS
Definition t30.h:254
@ T30_ERR_IDENT_UNACCEPTABLE
Definition t30.h:294
@ T30_ERR_RX_DCNDATA
Definition t30.h:273
@ T30_ERR_RX_T2EXPRR
Definition t30.h:270
@ T30_ERR_CANNOT_TRAIN
Definition t30.h:239
@ T30_ERR_TX_BADPG
Definition t30.h:250
@ T30_ERR_T3_EXPIRED
Definition t30.h:237
@ T30_ERR_CALLDROPPED
Definition t30.h:290
@ T30_ERR_SID_UNACCEPTABLE
Definition t30.h:298
@ T30_ERR_RX_NOCARRIER
Definition t30.h:263
@ T30_ERR_TX_BADDCS
Definition t30.h:249
@ T30_ERR_RX_ECMPHD
Definition t30.h:260
@ T30_ERR_TX_GOTDCN
Definition t30.h:252
@ T30_ERR_BADPAGE
Definition t30.h:283
@ T30_ERR_OPER_INT_FAIL
Definition t30.h:240
@ T30_ERR_RX_DCNRRD
Definition t30.h:276
@ T30_ERR_RX_T2EXPMPS
Definition t30.h:269
@ T30_ERR_TX_INVALRSP
Definition t30.h:253
@ T30_ERR_TX_ECMPHD
Definition t30.h:251
@ T30_ERR_RX_T2EXP
Definition t30.h:271
@ T30_ERR_RX_INVALCMD
Definition t30.h:262
@ T30_ERR_PSA_UNACCEPTABLE
Definition t30.h:297
@ T30_ERR_CIA_UNACCEPTABLE
Definition t30.h:302
@ T30_ERR_RX_INCAPABLE
Definition t30.h:242
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
#define T30_MAX_IDENT_LEN
Definition t30.h:144
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
@ T30_IAF_MODE_NO_FILL_BITS
Definition t30.h:465
@ T30_IAF_MODE_NO_INDICATORS
Definition t30.h:467
@ T30_IAF_MODE_CONTINUOUS_FLOW
Definition t30.h:459
@ T30_IAF_MODE_RELAXED_TIMERS
Definition t30.h:470
@ T30_IAF_MODE_NO_TCF
Definition t30.h:462
void t30_real_time_frame_handler_t(t30_state_t *s, void *user_data, int direction, const uint8_t msg[], int len)
T.30 real time frame handler.
Definition t30.h:191
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:215
@ T30_SUPPORT_V34HDX
Definition t30.h:348
@ T30_SUPPORT_IAF
Definition t30.h:350
@ T30_SUPPORT_V27TER
Definition t30.h:342
@ T30_SUPPORT_V17
Definition t30.h:346
@ T30_SUPPORT_V29
Definition t30.h:344
void t30_get_transfer_statistics(t30_state_t *s, t30_stats_t *t)
Get the current transfer statistics.
Definition t30.c:6229
SPAN_DECLARE_NONSTD(void) t30_non_ecm_put_bit(void *user_data
Process a bit of received non-ECM image data.
@ T30_SUPPORT_T4_1D_COMPRESSION
Definition t30.h:358
@ T30_SUPPORT_T4_2D_COMPRESSION
Definition t30.h:360
@ T30_SUPPORT_T45_COMPRESSION
Definition t30.h:370
@ T30_SUPPORT_T6_COMPRESSION
Definition t30.h:362
@ T30_SUPPORT_T81_COMPRESSION
Definition t30.h:372
@ T30_SUPPORT_T85_COMPRESSION
Definition t30.h:364
@ T30_SUPPORT_T85_L0_COMPRESSION
Definition t30.h:366
@ T30_SUPPORT_T88_COMPRESSION
Definition t30.h:376
@ T30_SUPPORT_SYCC_T81_COMPRESSION
Definition t30.h:374
@ T30_SUPPORT_T43_COMPRESSION
Definition t30.h:368
@ T30_SUPPORT_NO_COMPRESSION
Definition t30.h:356
void t30_send_hdlc_handler_t(void *user_data, const uint8_t msg[], int len)
T.30 send HDLC handler.
Definition t30.h:224
void t30_non_ecm_put_chunk(void *user_data, const uint8_t buf[], int len)
Process a chunk of received non-ECM image data.
Definition t30.c:5498
int t30_document_handler_t(t30_state_t *s, void *user_data, int status)
T.30 document handler.
Definition t30.h:204
int t30_free(t30_state_t *s)
Free a T.30 context.
Definition t30.c:6377
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
void t30_local_interrupt_request(t30_state_t *s, int state)
Request a local interrupt of FAX exchange.
Definition t30.c:6269
int t30_restart(t30_state_t *s)
Restart a T.30 context.
Definition t30.c:6287
int t30_non_ecm_get_chunk(void *user_data, uint8_t buf[], int max_len)
Get a bit of received non-ECM image data.
Definition t30.c:5608