#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <fcntl.h>
#include <time.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/t4.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 "t30_local.h"
Defines | |
#define | MAX_MESSAGE_TRIES 3 |
#define | ms_to_samples(t) (((t)*SAMPLE_RATE)/1000) |
#define | DEFAULT_TIMER_T0 60000 |
#define | DEFAULT_TIMER_T1 35000 |
#define | DEFAULT_TIMER_T2 7000 |
#define | DEFAULT_TIMER_T3 15000 |
#define | DEFAULT_TIMER_T4 3450 |
#define | DEFAULT_TIMER_T5 65000 |
#define | DEFAULT_TIMER_T6 5000 |
#define | DEFAULT_TIMER_T7 6000 |
#define | DEFAULT_TIMER_T8 10000 |
#define | FINAL_FLUSH_TIME 1000 |
#define | PPR_LIMIT_BEFORE_CTC_OR_EOR 4 |
#define | T30_V17_FALLBACK_START 0 |
#define | T30_V29_FALLBACK_START 3 |
#define | T30_V27TER_FALLBACK_START 6 |
#define | test_ctrl_bit(s, bit) ((s)[3 + ((bit - 1)/8)] & (1 << ((bit - 1)%8))) |
#define | set_ctrl_bit(s, bit) (s)[3 + ((bit - 1)/8)] |= (1 << ((bit - 1)%8)) |
#define | set_ctrl_bits(s, val, bit) (s)[3 + ((bit - 1)/8)] |= ((val) << ((bit - 1)%8)) |
#define | clr_ctrl_bit(s, bit) (s)[3 + ((bit - 1)/8)] &= ~(1 << ((bit - 1)%8)) |
Enumerations | |
enum | { T30_PHASE_IDLE = 0, T30_PHASE_A_CED, T30_PHASE_A_CNG, T30_PHASE_B_RX, T30_PHASE_B_TX, T30_PHASE_C_NON_ECM_RX, T30_PHASE_C_NON_ECM_TX, T30_PHASE_C_ECM_RX, T30_PHASE_C_ECM_TX, T30_PHASE_D_RX, T30_PHASE_D_TX, T30_PHASE_E, T30_PHASE_CALL_FINISHED } |
enum | { T30_STATE_ANSWERING = 1, T30_STATE_B, T30_STATE_C, T30_STATE_D, T30_STATE_D_TCF, T30_STATE_D_POST_TCF, T30_STATE_F_TCF, T30_STATE_F_CFR, T30_STATE_F_FTT, T30_STATE_F_DOC_NON_ECM, T30_STATE_F_POST_DOC_NON_ECM, T30_STATE_F_DOC_ECM, T30_STATE_F_POST_DOC_ECM, T30_STATE_F_POST_RCP_MCF, T30_STATE_F_POST_RCP_PPR, T30_STATE_F_POST_RCP_RNR, T30_STATE_R, T30_STATE_T, T30_STATE_I, T30_STATE_II, T30_STATE_II_Q, T30_STATE_III_Q_MCF, T30_STATE_III_Q_RTP, T30_STATE_III_Q_RTN, T30_STATE_IV, T30_STATE_IV_PPS_NULL, T30_STATE_IV_PPS_Q, T30_STATE_IV_PPS_RNR, T30_STATE_IV_CTC, T30_STATE_IV_EOR, T30_STATE_IV_EOR_RNR, T30_STATE_CALL_FINISHED } |
enum | { T30_MIN_SCAN_20MS = 0, T30_MIN_SCAN_5MS = 1, T30_MIN_SCAN_10MS = 2, T30_MIN_SCAN_40MS = 4, T30_MIN_SCAN_0MS = 7 } |
enum | { T30_MODE_SEND_DOC = 1, T30_MODE_RECEIVE_DOC } |
enum | { T30_COPY_QUALITY_GOOD = 0, T30_COPY_QUALITY_POOR, T30_COPY_QUALITY_BAD } |
enum | { DISBIT1 = 0x01, DISBIT2 = 0x02, DISBIT3 = 0x04, DISBIT4 = 0x08, DISBIT5 = 0x10, DISBIT6 = 0x20, DISBIT7 = 0x40, DISBIT8 = 0x80 } |
enum | { OPERATION_IN_PROGRESS_NONE = 0, OPERATION_IN_PROGRESS_T4_RX, OPERATION_IN_PROGRESS_T4_TX } |
Functions | |
int | t30_build_dis_or_dtc (t30_state_t *s) |
void | t30_non_ecm_put_bit (void *user_data, int bit) |
Process a bit of received non-ECM image data. | |
void | t30_non_ecm_put_byte (void *user_data, int byte) |
Process a byte of received non-ECM image data. | |
void | t30_non_ecm_put_chunk (void *user_data, const uint8_t buf[], int len) |
Process a chunk of received non-ECM image data. | |
int | t30_non_ecm_get_bit (void *user_data) |
Get a bit of received non-ECM image data. | |
int | t30_non_ecm_get_byte (void *user_data) |
Get a byte of received non-ECM image data. | |
int | t30_non_ecm_get_chunk (void *user_data, uint8_t buf[], int max_len) |
Get a bit of received non-ECM image data. | |
void | t30_hdlc_accept (void *user_data, const uint8_t *msg, int len, int ok) |
Process a received HDLC frame. | |
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, etc.). | |
void | t30_timer_update (t30_state_t *s, int samples) |
Report the passage of time to the T.30 engine. | |
void | t30_terminate (t30_state_t *s) |
Cleanup a T.30 context if the call terminates. | |
void | t30_get_transfer_statistics (t30_state_t *s, t30_stats_t *t) |
Get the current transfer statistics. | |
void | t30_local_interrupt_request (t30_state_t *s, int state) |
Request a local interrupt of FAX exchange. | |
int | t30_restart (t30_state_t *s) |
Restart a T.30 context. | |
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. | |
int | t30_release (t30_state_t *s) |
Release a T.30 context. | |
int | t30_free (t30_state_t *s) |
Free a T.30 context. |
|
Free a T.30 context. Free a T.30 context.
|
|
Inform the T.30 engine of a status change in the front end (end of tx, rx signal change, etc.). Inform the T.30 engine of a status change in the front end (end of tx, rx signal change, etc.).
|
|
Get the current transfer statistics. Get the current transfer statistics for the file being sent or received.
|
|
Process a received HDLC frame. Process a received HDLC frame.
|
|
Initialise a T.30 context. Initialise a T.30 context.
|
|
Request a local interrupt of FAX exchange. Request a local interrupt of FAX exchange.
|
|
Get a bit of received non-ECM image data. Get a bit of received non-ECM image data.
|
|
Get a byte of received non-ECM image data. Get a byte of received non-ECM image data.
|
|
Get a bit of received non-ECM image data. Get a chunk of received non-ECM image data.
|
|
Process a bit of received non-ECM image data. Process a bit of received non-ECM image data.
|
|
Process a byte of received non-ECM image data. Process a byte of received non-ECM image data.
|
|
Process a chunk of received non-ECM image data. Process a chunk of received non-ECM image data.
|
|
Release a T.30 context. Release a T.30 context.
|
|
Restart a T.30 context. Restart a T.30 context.
|
|
Cleanup a T.30 context if the call terminates. Cleanup a T.30 context if the call terminates.
|
|
Report the passage of time to the T.30 engine. Report the passage of time to the T.30 engine.
|