#include <inttypes.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <memory.h>#include <tgmath.h>#include <math.h>#include "floating_fudge.h"#include "spandsp/telephony.h"#include "spandsp/logging.h"#include "spandsp/queue.h"#include "spandsp/async.h"#include "spandsp/complex.h"#include "spandsp/dds.h"#include "spandsp/tone_detect.h"#include "spandsp/tone_generate.h"#include "spandsp/super_tone_rx.h"#include "spandsp/power_meter.h"#include "spandsp/fsk.h"#include "spandsp/dtmf.h"#include "spandsp/modem_connect_tones.h"#include "spandsp/v8.h"#include "spandsp/v18.h"#include "spandsp/private/logging.h"#include "spandsp/private/queue.h"#include "spandsp/private/tone_generate.h"#include "spandsp/private/async.h"#include "spandsp/private/fsk.h"#include "spandsp/private/dtmf.h"#include "spandsp/private/modem_connect_tones.h"#include "spandsp/private/v18.h"Classes | |
| struct | dtmf_to_ascii_s |
Defines | |
| #define | BAUDOT_FIGURE_SHIFT 0x1B |
| #define | BAUDOT_LETTER_SHIFT 0x1F |
Functions | |
| int | v18_encode_dtmf (v18_state_t *s, char dtmf[], const char msg[]) |
| Convert a text string to a V.18 DTMF string. | |
| int | v18_decode_dtmf (v18_state_t *s, char msg[], const char dtmf[]) |
| Convert a V.18 DTMF string to a text string. | |
| uint16_t | v18_encode_baudot (v18_state_t *s, uint8_t ch) |
| uint8_t | v18_decode_baudot (v18_state_t *s, uint8_t ch) |
| SPAN_DECLARE_NONSTD (int) | |
| Get the next bit of a transmitted serial bit stream. | |
| int | v18_put (v18_state_t *s, const char msg[], int len) |
| Put a string to a V.18 context's input buffer. | |
| logging_state_t * | v18_get_logging_state (v18_state_t *s) |
| v18_state_t * | v18_init (v18_state_t *s, int calling_party, int mode, put_msg_func_t put_msg, void *user_data) |
| Initialise a V.18 context. | |
| int | v18_release (v18_state_t *s) |
| Release a V.18 context. | |
| int | v18_free (v18_state_t *s) |
| Release a V.18 context. | |
| const char * | v18_mode_to_str (int mode) |
| Return a short name for an V.18 mode. | |
| #define BAUDOT_FIGURE_SHIFT 0x1B |
The baudot code to shift from alpha to digits and symbols
| #define BAUDOT_LETTER_SHIFT 0x1F |
The baudot code to shift from digits and symbols to alpha
| SPAN_DECLARE_NONSTD | ( | int | ) |
Get the next bit of a transmitted serial bit stream.
Get the next bit of data from a T.38 rate adapting non-ECM buffer context.
Get a bit of received non-ECM image data.
Get the next bit of a transmitted serial bit stream.
| user_data | An opaque point which must point to a transmitter context. |
Get the next bit of a transmitted serial bit stream.
Process a block of received V.8 audio samples.
Fake processing of a missing block of received V.29 modem audio samples.
Fake processing of a missing block of received V.27ter modem audio samples.
Generate a block of V.22bis modem audio samples.
Fake processing of a missing block of received V.22bis modem audio samples.
Process a block of received V.18 audio samples.
Fake processing of a missing block of received V.17 modem audio samples.
Generate a block of FAX audio samples.
Apply fake received audio processing.
Generate a block of T.31 modem audio samples.
Fake processing of a missing block of received T.31 modem audio samples.
Dummy receive fillin callback.
Dummy receive callback.
Process a block of samples through an instance of the modem connect tones detector.
Get the next sequence of bytes for transmission.
Get the next byte for transmission.
Fake processing of a missing block of received FSK modem audio samples.
Process a block of received FSK modem audio samples.
Apply T.30 transmit processing to generate a block of audio samples.
Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).
| s | The FAX context. | |
| len | The number of samples to fake. |
Apply T.30 transmit processing to generate a block of audio samples.
| s | The FAX context. | |
| amp | The audio sample buffer. | |
| max_len | The number of samples to be generated. |
Process a block of received FSK modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss).
| s | The modem context. | |
| len | The number of samples to fake. |
| s | A pointer to an HDLC transmitter context. |
| s | A pointer to an HDLC transmitter context. | |
| buf | The buffer for the data. | |
| max_len | The number of bytes to get. |
| s | The context. | |
| amp | An array of signal samples. | |
| len | The number of samples in the array. |
A dummy routine to use as a receive callback, when we aren't really trying to process what is received. It just absorbs and ignores the data.
| user_data | The context. | |
| amp | The signal.buffer | |
| len | The length of the signal buffer |
A dummy routine to use as a receive fillin callback, when we aren't really trying to process what is received. It just absorbs and ignores the request.
| user_data | The context. | |
| len | The length of the signal buffer |
Fake processing of a missing block of received T.31 modem audio samples (e.g due to packet loss).
| s | The T.31 modem context. | |
| len | The number of samples to fake. |
Generate a block of T.31 modem audio samples.
| s | The T.31 modem context. | |
| amp | The audio sample buffer. | |
| max_len | The number of samples to be generated. |
Apply fake processing when a block of audio samples is missing (e.g due to packet loss).
| s | The T.38 context. | |
| len | The number of samples to fake. |
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. |
Fake processing of a missing block of received V.17 modem audio samples. (e.g due to packet loss).
| s | The modem context. | |
| len | The number of samples to fake. |
Process a block of received V.18 audio samples.
| s | The V.18 context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Fake processing of a missing block of received V.22bis modem audio samples. (e.g due to packet loss).
| s | The modem context. | |
| len | The number of samples to fake. |
Generate a block of V.22bis modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples to be generated. |
Fake processing of a missing block of received V.27ter modem audio samples. (e.g due to packet loss).
| s | The modem context. | |
| len | The number of samples to fake. |
Fake processing of a missing block of received V.29 modem audio samples. (e.g due to packet loss).
| s | The modem context. | |
| len | The number of samples to fake. |
Process a block of received V.8 audio samples.
| s | The V.8 context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Get the next bit of a transmitted serial bit stream.
Apply T.30 transmit processing to generate a block of audio samples.
Apply fake T.30 receive processing.
Apply T.30 receive processing to a block of audio samples.
| s | The FAX context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).
| s | The FAX context. | |
| len | The number of samples to fake. |
Apply T.30 transmit processing to generate a block of audio samples.
| s | The FAX context. | |
| amp | The audio sample buffer. | |
| max_len | The number of samples to be generated. |
Get the next bit of a transmitted serial bit stream.
Fake processing of a missing block of received FSK modem audio samples.
Process a block of received FSK modem audio samples.
Generate a block of FSK modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples to be generated. |
Process a block of received FSK modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss).
| s | The modem context. | |
| len | The number of samples to fake. |
Get the next bit of a transmitted serial bit stream.
Get the next sequence of bytes for transmission.
Get the next byte for transmission.
| s | A pointer to an HDLC transmitter context. |
| s | A pointer to an HDLC transmitter context. |
| s | A pointer to an HDLC transmitter context. | |
| buf | The buffer for the data. | |
| max_len | The number of bytes to get. |
Get the next bit of a transmitted serial bit stream.
Process a block of samples through an instance of the modem connect tones detector.
| s | The context. | |
| amp | An array of signal samples. | |
| len | The number of samples to generate. |
| s | The context. | |
| amp | An array of signal samples. | |
| len | The number of samples in the array. |
Get the next bit of a transmitted serial bit stream.
Dummy receive fillin callback.
Dummy receive callback.
Generate a block of silent audio samples.
| s | The silence generator context. | |
| amp | The audio sample buffer. | |
| max_len | The number of samples to be generated. |
A dummy routine to use as a receive callback, when we aren't really trying to process what is received. It just absorbs and ignores the data.
| user_data | The context. | |
| amp | The signal.buffer | |
| len | The length of the signal buffer |
A dummy routine to use as a receive fillin callback, when we aren't really trying to process what is received. It just absorbs and ignores the request.
| user_data | The context. | |
| len | The length of the signal buffer |
Get the next bit of a transmitted serial bit stream.
Generate a block of T.31 modem audio samples.
Fake processing of a missing block of received T.31 modem audio samples.
Process a block of received T.31 modem audio samples.
| s | The T.31 modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Fake processing of a missing block of received T.31 modem audio samples (e.g due to packet loss).
| s | The T.31 modem context. | |
| len | The number of samples to fake. |
Generate a block of T.31 modem audio samples.
| s | The T.31 modem context. | |
| amp | The audio sample buffer. | |
| max_len | The number of samples to be generated. |
Get the next bit of a transmitted serial bit stream.
Generate a block of FAX audio samples.
Apply fake received audio processing.
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. |
Apply fake processing when a block of audio samples is missing (e.g due to packet loss).
| s | The T.38 context. | |
| len | The number of samples to fake. |
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. |
Get the next bit of a transmitted serial bit stream.
Fake processing of a missing block of received V.17 modem audio samples.
Process a block of received V.17 modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Fake processing of a missing block of received V.17 modem audio samples. (e.g due to packet loss).
| s | The modem context. | |
| len | The number of samples to fake. |
Get the next bit of a transmitted serial bit stream.
Generate a block of V.17 modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples to be generated. |
Get the next bit of a transmitted serial bit stream.
Process a block of received V.18 audio samples.
Generate a block of V.18 audio samples.
| s | The V.18 context. | |
| amp | The audio sample buffer. | |
| max_len | The number of samples to be generated. |
Process a block of received V.18 audio samples.
| s | The V.18 context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Get the next bit of a transmitted serial bit stream.
Generate a block of V.22bis modem audio samples.
Fake processing of a missing block of received V.22bis modem audio samples.
Process a block of received V.22bis modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Fake processing of a missing block of received V.22bis modem audio samples. (e.g due to packet loss).
| s | The modem context. | |
| len | The number of samples to fake. |
Generate a block of V.22bis modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples to be generated. |
Get the next bit of a transmitted serial bit stream.
Fake processing of a missing block of received V.27ter modem audio samples.
Process a block of received V.27ter modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Fake processing of a missing block of received V.27ter modem audio samples. (e.g due to packet loss).
| s | The modem context. | |
| len | The number of samples to fake. |
Get the next bit of a transmitted serial bit stream.
Generate a block of V.27ter modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples to be generated. |
Get the next bit of a transmitted serial bit stream.
Fake processing of a missing block of received V.29 modem audio samples.
Process a block of received V.29 modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
Fake processing of a missing block of received V.29 modem audio samples. (e.g due to packet loss).
| s | The modem context. | |
| len | The number of samples to fake. |
Get the next bit of a transmitted serial bit stream.
Generate a block of V.29 modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples to be generated. |
Get the next bit of a transmitted serial bit stream.
Process a block of received V.8 audio samples.
Generate a block of V.8 audio samples.
| s | The V.8 context. | |
| amp | The audio sample buffer. | |
| max_len | The number of samples to be generated. |
Process a block of received V.8 audio samples.
| s | The V.8 context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
References dtmf_rx().
| int v18_decode_dtmf | ( | v18_state_t * | s, | |
| char | msg[], | |||
| const char | dtmf[] | |||
| ) |
Convert a V.18 DTMF string to a text string.
Convert a V.18 DTMF string to a text string.
| s | The V.18 context. | |
| msg | The resulting test string. | |
| dtmf | The DTMF string to be converted. |
| int v18_encode_dtmf | ( | v18_state_t * | s, | |
| char | dtmf[], | |||
| const char | msg[] | |||
| ) |
Convert a text string to a V.18 DTMF string.
Convert a text string to a V.18 DTMF string.
| s | The V.18 context. | |
| dtmf | The resulting DTMF string. | |
| msg | The text string to be converted. |
| int v18_free | ( | v18_state_t * | s | ) |
Release a V.18 context.
Free a V.18 context.
| s | The V.18 context. |
| v18_state_t* v18_init | ( | v18_state_t * | s, | |
| int | calling_party, | |||
| int | mode, | |||
| put_msg_func_t | put_msg, | |||
| void * | user_data | |||
| ) |
Initialise a V.18 context.
Initialise a V.18 context.
| s | The V.18 context. | |
| calling_party | TRUE if caller mode, else answerer mode. | |
| mode | Mode of operation. | |
| put_msg | A callback routine called to deliver the received text to the application. | |
| user_data | An opaque pointer for the callback routine. |
References ASYNC_PARITY_NONE, async_tx_init(), dtmf_rx_init(), dtmf_tx_init(), fsk_rx_init(), fsk_tx_init(), queue_init(), QUEUE_READ_ATOMIC, and QUEUE_WRITE_ATOMIC.
| const char* v18_mode_to_str | ( | int | mode | ) |
Return a short name for an V.18 mode.
| mode | The code for the V.18 mode. |
| int v18_put | ( | v18_state_t * | s, | |
| const char | msg[], | |||
| int | len | |||
| ) |
Put a string to a V.18 context's input buffer.
| s | The V.18 context. | |
| msg | The string to be added. | |
| len | The length of the string. If negative, the string is assumed to be a NULL terminated string. |
References queue_write().
| int v18_release | ( | v18_state_t * | s | ) |
Release a V.18 context.
Release a V.18 context.
| s | The V.18 context. |
1.6.1