v18.h File Reference

Go to the source code of this file.

Typedefs

typedef v18_state_s v18_state_t

Enumerations

enum  {
  V18_MODE_NONE = 0, V18_MODE_5BIT_45 = 1, V18_MODE_5BIT_50 = 2, V18_MODE_DTMF = 3,
  V18_MODE_EDT = 4, V18_MODE_BELL103 = 5, V18_MODE_V23VIDEOTEX = 6, V18_MODE_V21TEXTPHONE = 7,
  V18_MODE_V18TEXTPHONE = 8
}

Functions

logging_state_tv18_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.
 SPAN_DECLARE_NONSTD (int) v18_tx(v18_state_t *s
 Get the next bit of data from a T.38 rate adapting non-ECM buffer context.
int v18_put (v18_state_t *s, const char msg[], int len)
 Put a string to a V.18 context's input buffer.
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)
const char * v18_mode_to_str (int mode)
 Return a short name for an V.18 mode.

Variables

int16_t amp []
int16_t int max_len
const int16_t amp []
const int16_t int len


Detailed Description


Function Documentation

SPAN_DECLARE_NONSTD ( int   ) 

Get the next bit of data from a T.38 rate adapting non-ECM buffer context.

Generate a block of V.18 audio samples.

Parameters:
s The V.18 context.
amp The audio sample buffer.
max_len The number of samples to be generated.
Returns:
The number of samples actually generated.

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.

Parameters:
s The V.18 context.
msg The resulting test string.
dtmf The DTMF string to be converted.
Returns:
The length of the text string.

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.

Parameters:
s The V.18 context.
dtmf The resulting DTMF string.
msg The text string to be converted.
Returns:
The length of the DTMF string.

int v18_free ( v18_state_t *  s  ) 

Release a V.18 context.

Free a V.18 context.

Parameters:
s The V.18 context.
Returns:
0 for OK.

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.

Parameters:
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.
Returns:
A pointer to the V.18 context, or NULL if there was a problem.

const char* v18_mode_to_str ( int  mode  ) 

Return a short name for an V.18 mode.

Parameters:
mode The code for the V.18 mode.
Returns:
A pointer to the name.

int v18_put ( v18_state_t *  s,
const char  msg[],
int  len 
)

Put a string to a V.18 context's input buffer.

Parameters:
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.
Returns:
The number of characters actually added. This may be less than the length of the digit string, if the buffer fills up. If the string is invalid, this function will return -1.

int v18_release ( v18_state_t *  s  ) 

Release a V.18 context.

Release a V.18 context.

Parameters:
s The V.18 context.
Returns:
0 for OK.


Generated on Thu Oct 18 15:28:03 2012 for spandsp by  doxygen 1.4.7