spandsp 0.0.6
v8.h File Reference

Go to the source code of this file.

Classes

struct  v8_parms_s

Typedefs

typedef struct v8_parms_s v8_parms_t
typedef void(* v8_result_handler_t) (void *user_data, v8_parms_t *result)
typedef struct v8_state_s v8_state_t

Enumerations

enum  v8_call_function_e {
  V8_CALL_TBS = 0 , V8_CALL_H324 = 1 , V8_CALL_V18 = 2 , V8_CALL_T101 = 3 ,
  V8_CALL_T30_TX = 4 , V8_CALL_T30_RX = 5 , V8_CALL_V_SERIES = 6 , V8_CALL_FUNCTION_EXTENSION = 7
}
enum  v8_modulation_e {
  V8_MOD_V17 = (1 << 0) , V8_MOD_V21 = (1 << 1) , V8_MOD_V22 = (1 << 2) , V8_MOD_V23HDX = (1 << 3) ,
  V8_MOD_V23 = (1 << 4) , V8_MOD_V26BIS = (1 << 5) , V8_MOD_V26TER = (1 << 6) , V8_MOD_V27TER = (1 << 7) ,
  V8_MOD_V29 = (1 << 8) , V8_MOD_V32 = (1 << 9) , V8_MOD_V34HDX = (1 << 10) , V8_MOD_V34 = (1 << 11) ,
  V8_MOD_V90 = (1 << 12) , V8_MOD_V92 = (1 << 13)
}
enum  v8_protocol_e { V8_PROTOCOL_NONE = 0 , V8_PROTOCOL_LAPM_V42 = 1 , V8_PROTOCOL_EXTENSION = 7 }
enum  v8_pstn_access_e { V8_PSTN_ACCESS_CALL_DCE_CELLULAR = 0x01 , V8_PSTN_ACCESS_ANSWER_DCE_CELLULAR = 0x02 , V8_PSTN_ACCESS_DCE_ON_DIGITAL = 0x04 }
enum  v8_pcm_modem_availability_e { V8_PSTN_PCM_MODEM_V90_V92_ANALOGUE = 0x01 , V8_PSTN_PCM_MODEM_V90_V92_DIGITAL = 0x02 , V8_PSTN_PCM_MODEM_V91 = 0x04 }
enum  v8_status_e {
  V8_STATUS_IN_PROGRESS = 0 , V8_STATUS_V8_OFFERED = 1 , V8_STATUS_V8_CALL = 2 , V8_STATUS_NON_V8_CALL = 3 ,
  V8_STATUS_FAILED = 4
}

Functions

int v8_restart (v8_state_t *s, int calling_party, v8_parms_t *parms)
v8_state_t * v8_init (v8_state_t *s, int calling_party, v8_parms_t *parms, v8_result_handler_t result_handler, void *user_data)
 Initialise a V.8 context.
int v8_release (v8_state_t *s)
 Release a V.8 context.
int v8_free (v8_state_t *s)
 Release a V.8 context.
logging_state_tv8_get_logging_state (v8_state_t *s)
 SPAN_DECLARE_NONSTD (int) v8_tx(v8_state_t *s
 Generate a block of V.8 audio samples.
void v8_log_supported_modulations (v8_state_t *s, int modulation_schemes)
 Log the list of supported modulations.
const char * v8_call_function_to_str (int call_function)
const char * v8_modulation_to_str (int modulation_scheme)
const char * v8_protocol_to_str (int protocol)
const char * v8_pstn_access_to_str (int pstn_access)
const char * v8_nsf_to_str (int nsf)
const char * v8_pcm_modem_availability_to_str (int pcm_modem_availability)
const char * v8_t66_to_str (int t66)

Variables

int16_t * amp
int16_t int max_len
const int16_t int len

Enumeration Type Documentation

◆ v8_status_e

Enumerator
V8_STATUS_IN_PROGRESS 

V.8 negotiation is in progress.

V8_STATUS_V8_OFFERED 

V.8 has been offered by the other (calling) party.

V8_STATUS_V8_CALL 

V.8 has been successfully negotiated. Note that this only means the V.8 message exchange has successfully completed. The actual exchanged parameters must be checked, to see if the call can proceed properly.

V8_STATUS_NON_V8_CALL 

A non-V.8 is being received.

V8_STATUS_FAILED 

V.8 negotiation failed.

Function Documentation

◆ SPAN_DECLARE_NONSTD()

SPAN_DECLARE_NONSTD ( int )

Generate a block of V.8 audio samples.

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.

Parameters
sThe V.8 context.
ampThe audio sample buffer.
max_lenThe number of samples to be generated.
Returns
The number of samples actually generated.

Process a block of received V.8 audio samples.

Parameters
sThe V.8 context.
ampThe audio sample buffer.
lenThe number of samples in the buffer.

Apply T.30 receive processing to a block of audio samples.

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.

Process a received T.38 IFP packet from a reliable stream (e.g. TCP).

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.

Get the next bit of a transmitted serial bit stream.

Parameters
user_dataAn opaque point which must point to a transmitter context.
Returns
the next bit, or PUTBIT_END_OF_DATA to indicate the data stream has ended.

Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).

Parameters
sThe FAX context.
lenThe number of samples to fake.
Returns
The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply T.30 transmit processing to generate a block of audio samples.

Parameters
sThe FAX context.
ampThe audio sample buffer.
max_lenThe number of samples to be generated.
Returns
The number of samples actually generated. This will be zero when there is nothing to send.

Process a block of received FSK modem audio samples.

Parameters
sThe modem context.
ampThe audio sample buffer.
lenThe number of samples in the buffer.
Returns
The number of samples unprocessed.

Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss).

Parameters
sThe modem context.
lenThe number of samples to fake.
Returns
The number of samples unprocessed.
Parameters
sA pointer to an HDLC transmitter context.
Returns
The next byte for transmission.
Parameters
sA pointer to an HDLC transmitter context.
bufThe buffer for the data.
max_lenThe number of bytes to get.
Returns
The number of bytes actually got.
Parameters
sThe context.
ampAn array of signal samples.
lenThe number of samples in the array.
Returns
The number of unprocessed samples.

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.

Parameters
user_dataThe context.
ampThe signal.buffer
lenThe length of the signal buffer
Returns
0.

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.

Parameters
user_dataThe context.
lenThe length of the signal buffer
Returns
0.

Fake processing of a missing block of received T.31 modem audio samples (e.g due to packet loss).

Parameters
sThe T.31 modem context.
lenThe number of samples to fake.
Returns
The number of samples unprocessed.

Generate a block of T.31 modem audio samples.

Parameters
sThe T.31 modem context.
ampThe audio sample buffer.
max_lenThe number of samples to be generated.
Returns
The number of samples actually generated.
Parameters
sThe T.38 context.
bufThe packet contents.
lenThe length of the packet contents.
seq_noThe packet sequence number, used for logging purposes.
Returns
The length of the packet processed, or -1 if there is an error in the packet, or too few bytes of data to complete it.

Apply fake processing when a block of audio samples is missing (e.g due to packet loss).

Parameters
sThe T.38 context.
lenThe number of samples to fake.
Returns
The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Generate a block of FAX audio samples.

Parameters
sThe T.38 context.
ampThe audio sample buffer.
max_lenThe number of samples to be generated.
Returns
The number of samples actually generated.

Fake processing of a missing block of received V.17 modem audio samples. (e.g due to packet loss).

Parameters
sThe modem context.
lenThe number of samples to fake.
Returns
The number of samples unprocessed.

Process a block of received V.18 audio samples.

Parameters
sThe V.18 context.
ampThe audio sample buffer.
lenThe 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).

Parameters
sThe modem context.
lenThe number of samples to fake.
Returns
The number of samples unprocessed.

Generate a block of V.22bis modem audio samples.

Parameters
sThe modem context.
ampThe audio sample buffer.
lenThe number of samples to be generated.
Returns
The number of samples actually generated.

Fake processing of a missing block of received V.27ter modem audio samples. (e.g due to packet loss).

Parameters
sThe modem context.
lenThe number of samples to fake.
Returns
The number of samples unprocessed.

Fake processing of a missing block of received V.29 modem audio samples. (e.g due to packet loss).

Parameters
sThe modem context.
lenThe number of samples to fake.
Returns
The number of samples unprocessed.

Process a block of received V.8 audio samples.

Parameters
sThe V.8 context.
ampThe audio sample buffer.
lenThe 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.

Parameters
sThe FAX context.
ampThe audio sample buffer.
lenThe number of samples in the buffer.
Returns
The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss).

Parameters
sThe FAX context.
lenThe number of samples to fake.
Returns
The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

Apply T.30 transmit processing to generate a block of audio samples.

Parameters
sThe FAX context.
ampThe audio sample buffer.
max_lenThe number of samples to be generated.
Returns
The number of samples actually generated. This will be zero when there is nothing to send.

◆ v8_free()

int v8_free ( v8_state_t * s)

Release a V.8 context.

Free a V.8 context.

Parameters
sThe V.8 context.
Returns
0 for OK.

References queue_free().

◆ v8_init()

v8_state_t * v8_init ( v8_state_t * s,
int calling_party,
v8_parms_t * parms,
v8_result_handler_t result_handler,
void * user_data )

Initialise a V.8 context.

Initialise a V.8 context.

Parameters
sThe V.8 context.
calling_partyTRUE if caller mode, else answerer mode.
parmsThe allowed parameters for the call.
result_handlerThe callback routine used to handle the results of negotiation.
user_dataAn opaque pointer passed to the result_handler routine.
Returns
A pointer to the V.8 context, or NULL if there was a problem.

References v8_state_s::logging, v8_state_s::result_handler, and v8_state_s::result_handler_user_data.

Referenced by fax_init(), and t31_init().

◆ v8_log_supported_modulations()

void v8_log_supported_modulations ( v8_state_t * s,
int modulation_schemes )

Log the list of supported modulations.

Log the list of supported modulations.

Parameters
sThe V.8 context.
modulation_schemesThe list of supported modulations.

References v8_state_s::logging, and span_log().

◆ v8_release()

int v8_release ( v8_state_t * s)

Release a V.8 context.

Release a V.8 context.

Parameters
sThe V.8 context.
Returns
0 for OK.

References queue_free().