#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <assert.h>
#include <tiffio.h>
#include "spandsp/telephony.h"
#include "spandsp/logging.h"
#include "spandsp/queue.h"
#include "spandsp/dc_restore.h"
#include "spandsp/bit_operations.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/silence_gen.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/v17rx.h"
#include "spandsp/v17tx.h"
#include "spandsp/t4.h"
#include "spandsp/t30_fcf.h"
#include "spandsp/t35.h"
#include "spandsp/t30.h"
#include "spandsp/t38_core.h"
#include "spandsp/t38_gateway.h"
Defines | |
#define | MS_PER_TX_CHUNK 30 |
#define | INDICATOR_TX_COUNT 3 |
#define | DATA_TX_COUNT 1 |
#define | DATA_END_TX_COUNT 1 |
#define | DISBIT1 0x01 |
#define | DISBIT2 0x02 |
#define | DISBIT3 0x04 |
#define | DISBIT4 0x08 |
#define | DISBIT5 0x10 |
#define | DISBIT6 0x20 |
#define | DISBIT7 0x40 |
#define | DISBIT8 0x80 |
Enumerations | |
enum | { T38_NONE, T38_V27TER_RX, T38_V29_RX, T38_V17_RX } |
enum | { HDLC_FLAG_FINISHED = 0x01, HDLC_FLAG_CORRUPT_CRC = 0x02, HDLC_FLAG_PROCEED_WITH_OUTPUT = 0x04, HDLC_FLAG_MISSING_DATA = 0x08 } |
Functions | |
int | t38_gateway_rx (t38_gateway_state_t *s, int16_t amp[], int len) |
Process a block of received FAX audio samples. | |
int | t38_gateway_tx (t38_gateway_state_t *s, int16_t amp[], int max_len) |
Generate a block of FAX audio samples. | |
void | t38_gateway_set_ecm_capability (t38_gateway_state_t *s, int ecm_allowed) |
Control whether error correcting mode (ECM) is allowed. | |
void | t38_gateway_set_transmit_on_idle (t38_gateway_state_t *s, int transmit_on_idle) |
void | t38_gateway_set_supported_modems (t38_gateway_state_t *s, int supported_modems) |
void | t38_gateway_set_nsx_suppression (t38_gateway_state_t *s, int suppress_nsx) |
t38_gateway_state_t * | t38_gateway_init (t38_gateway_state_t *s, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data) |
Initialise a gateway mode T.38 context. |
t38_gateway_state_t* t38_gateway_init | ( | t38_gateway_state_t * | s, | |
t38_tx_packet_handler_t * | tx_packet_handler, | |||
void * | tx_packet_user_data | |||
) |
Initialise a gateway mode T.38 context.
s | The T.38 context. | |
tx_packet_handler | A callback routine to encapsulate and transmit T.38 packets. | |
tx_packet_user_data | An opaque pointer passed to the tx_packet_handler routine. |
int t38_gateway_rx | ( | t38_gateway_state_t * | s, | |
int16_t | amp[], | |||
int | len | |||
) |
Process a block of received FAX audio samples.
Process a block of received FAX audio samples.
s | The T.38 context. | |
amp | The audio sample buffer. | |
len | The number of samples in the buffer. |
void t38_gateway_set_ecm_capability | ( | t38_gateway_state_t * | s, | |
int | ecm_allowed | |||
) |
Control whether error correcting mode (ECM) is allowed.
Control whether error correcting mode (ECM) is allowed.
s | The T.38 context. | |
ecm_allowed | TRUE is ECM is to be allowed. |
int t38_gateway_tx | ( | t38_gateway_state_t * | s, | |
int16_t | amp[], | |||
int | max_len | |||
) |
Generate a block of FAX audio samples.
Generate a block of FAX audio samples.
s | The T.38 context. | |
amp | The audio sample buffer. | |
max_len | The number of samples to be generated. |