Asterisk - The Open Source Telephony Project
18.5.0
|
TTY/TDD Generation support. More...
Go to the source code of this file.
Macros | |
#define | TDD_BYTES_PER_CHAR 2700 |
Typedefs | |
typedef struct tdd_state | TDDSTATE |
Functions | |
int | ast_tdd_gen_ecdisa (unsigned char *outbuf, int len) |
int | tdd_feed (struct tdd_state *tdd, unsigned char *ubuf, int samples) |
void | tdd_free (struct tdd_state *tdd) |
int | tdd_gen_holdtone (unsigned char *outbuf) |
int | tdd_generate (struct tdd_state *tdd, unsigned char *buf, const char *string) |
void | tdd_init (void) |
struct tdd_state * | tdd_new (void) |
TTY/TDD Generation support.
Definition in file tdd.h.
#define TDD_BYTES_PER_CHAR 2700 |
Definition at line 27 of file tdd.h.
Referenced by dahdi_sendtext().
int ast_tdd_gen_ecdisa | ( | unsigned char * | outbuf, |
int | len | ||
) |
Generate Echo Canceller disable tone (2100HZ)
outbuf | This is the buffer to receive the tone data |
len | This is the length (in samples) of the tone data to generate Returns 0 if no error, and -1 if error. |
Definition at line 148 of file tdd.c.
References ecdisa, len(), and tdd_state::pos.
Referenced by dahdi_setoption().
int tdd_feed | ( | struct tdd_state * | tdd, |
unsigned char * | ubuf, | ||
int | samples | ||
) |
Read samples into the state machine, and return character (if any).
tdd | Which state machine to act upon |
ubuf | containing your samples |
samples | number of samples contained within the buffer. |
Send received audio to the TDD demodulator. Returns -1 on error, 0 for "needs more samples", and > 0 (the character) if reception of a character is complete.
Definition at line 161 of file tdd.c.
References ast_calloc, ast_free, ast_log, AST_MULAW, b, buf, c, fsk_serial(), tdd_state::fskd, len(), LOG_ERROR, LOG_NOTICE, LOG_WARNING, tdd_state::mode, tdd_state::oldlen, tdd_state::oldstuff, and tdd_decode_baudot().
Referenced by dahdi_read().
void tdd_free | ( | struct tdd_state * | tdd | ) |
Free a TDD state machine
Definition at line 218 of file tdd.c.
References ast_free.
Referenced by dahdi_setoption().
int tdd_gen_holdtone | ( | unsigned char * | buf | ) |
Generate hold tone
outbuf | This is the buffer to receive the tone data |
Generate TDD hold tone
outbuf,buf | Result buffer |
Definition at line 286 of file tdd.c.
References PUT_AUDIO_SAMPLE, tdd_getcarrier(), and tddsb.
int tdd_generate | ( | struct tdd_state * | tdd, |
unsigned char * | buf, | ||
const char * | string | ||
) |
Generates a CallerID FSK stream in ulaw format suitable for transmission.
tdd | tdd structure |
buf | Buffer to use. This needs to be large enough to accomodate all the generated samples. |
string | This is the string to send. This function creates a stream of TDD data in ulaw format. It returns the size (in bytes) of the data (if it returns a size of 0, there is probably an error) |
Baudot letters
Baudot figures
Definition at line 297 of file tdd.c.
References c, tdd_state::charnum, tdd_state::mode, and PUT_TDD.
Referenced by dahdi_sendtext().
void tdd_init | ( | void | ) |
struct tdd_state* tdd_new | ( | void | ) |
Create a TDD state machine This function returns a malloc'd instance of the tdd_state data structure. Returns a pointer to a malloc'd tdd_state structure, or NULL on error.
Definition at line 103 of file tdd.c.
References ast_calloc, ast_log, fsk_data::bw, tdd_state::charnum, fsk_data::cont, fsk_data::f_mark_idx, fsk_data::f_space_idx, tdd_state::fskd, fskmodem_init(), fsk_data::hdlc, fsk_data::instop, fsk_data::ispb, LOG_WARNING, tdd_state::mode, fsk_data::nbit, fsk_data::nstop, fsk_data::parity, fsk_data::pcola, fsk_data::pllids, fsk_data::pllispb, fsk_data::pllispb2, tdd_state::pos, fsk_data::spb, fsk_data::state, fsk_data::x0, and fsk_data::xi0.
Referenced by dahdi_setoption().