spandsp 3.0.0
|
Go to the source code of this file.
Classes | |
struct | channel_parms_t |
Typedefs | |
typedef int(* | sprt_tx_packet_handler_t) (void *user_data, const uint8_t pkt[], int len) |
typedef int(* | sprt_rx_delivery_handler_t) (void *user_data, int channel, int seq_no, const uint8_t msg[], int len) |
typedef span_timestamp_t(* | sprt_timer_handler_t) (void *user_data, span_timestamp_t timeout) |
typedef struct sprt_state_s | sprt_state_t |
Functions | |
const char * | sprt_transmission_channel_to_str (int channel) |
Find the name of an SPRT channel. | |
int | sprt_timer_expired (sprt_state_t *s, span_timestamp_t now) |
int | sprt_rx_packet (sprt_state_t *s, const uint8_t pkt[], int len) |
Process a packet arriving from the far end. If the packet validates as an SPRT packet 0 is returned. If the packet does not follow the structure of an SPRT packet, or its packet type field does not contain the expected value, -1 is returned. In a mixed packet environment, where things like RTP, T.38 and SPRT packets are mixed in the same stream, -1 should indicate than one of the other packet sinks should be tried. | |
int | sprt_tx (sprt_state_t *s, int channel, const uint8_t buf[], int len) |
Send a message to a SPRT channel. | |
int | sprt_set_local_tc_windows_size (sprt_state_t *s, int channel, int size) |
int | sprt_get_local_tc_windows_size (sprt_state_t *s, int channel) |
int | sprt_set_local_tc_payload_bytes (sprt_state_t *s, int channel, int max_len) |
int | sprt_get_local_tc_payload_bytes (sprt_state_t *s, int channel) |
int | sprt_set_local_tc_max_tries (sprt_state_t *s, int channel, int max_tries) |
int | sprt_get_local_tc_max_tries (sprt_state_t *s, int channel) |
int | sprt_set_far_tc_payload_bytes (sprt_state_t *s, int channel, int max_len) |
int | sprt_get_far_tc_payload_bytes (sprt_state_t *s, int channel) |
int | sprt_set_far_tc_windows_size (sprt_state_t *s, int channel, int size) |
int | sprt_get_far_tc_windows_size (sprt_state_t *s, int channel) |
int | sprt_set_tc_timeout (sprt_state_t *s, int channel, int timer, int timeout) |
int | sprt_get_tc_timeout (sprt_state_t *s, int channel, int timer) |
int | sprt_set_local_busy (sprt_state_t *s, int channel, bool busy) |
Test if local end of SPRT context is busy. | |
bool | sprt_get_far_busy_status (sprt_state_t *s, int channel) |
Test if far end of SPRT context is busy. | |
logging_state_t * | sprt_get_logging_state (sprt_state_t *s) |
Get the logging context associated with an SPRT context. | |
sprt_state_t * | sprt_init (sprt_state_t *s, uint8_t subsession_id, uint8_t rx_payload_type, uint8_t tx_payload_type, channel_parms_t parms[4], sprt_tx_packet_handler_t tx_packet_handler, void *tx_user_data, sprt_rx_delivery_handler_t rx_delivery_handler, void *rx_user_data, sprt_timer_handler_t timer_handler, void *timer_user_data, span_modem_status_func_t status_handler, void *status_user_data) |
Initialise an SPRT context. | |
int | sprt_release (sprt_state_t *s) |
Release an SPRT context. | |
int | sprt_free (sprt_state_t *s) |
Free an SPRT context. | |
int sprt_free | ( | sprt_state_t * | s | ) |
Free an SPRT context.
s | The SPRT context. |
References sprt_free(), and sprt_release().
Referenced by sprt_free().
bool sprt_get_far_busy_status | ( | sprt_state_t * | s, |
int | channel ) |
Test if far end of SPRT context is busy.
Test whether the far end of the specified channel of the SPRT context is currently busy.
s | The SPRT context. |
channel | The SPRT channel number. |
References sprt_get_far_busy_status().
Referenced by sprt_get_far_busy_status().
logging_state_t * sprt_get_logging_state | ( | sprt_state_t * | s | ) |
Get the logging context associated with an SPRT context.
Get the logging context associated with an SPRT context.
s | The SPRT context. |
References sprt_state_s::logging, and sprt_get_logging_state().
Referenced by sprt_get_logging_state().
sprt_state_t * sprt_init | ( | sprt_state_t * | s, |
uint8_t | subsession_id, | ||
uint8_t | rx_payload_type, | ||
uint8_t | tx_payload_type, | ||
channel_parms_t | parms[4], | ||
sprt_tx_packet_handler_t | tx_packet_handler, | ||
void * | tx_user_data, | ||
sprt_rx_delivery_handler_t | rx_delivery_handler, | ||
void * | rx_user_data, | ||
sprt_timer_handler_t | timer_handler, | ||
void * | timer_user_data, | ||
span_modem_status_func_t | status_handler, | ||
void * | status_user_data ) |
Initialise an SPRT context.
s | The SPRT context. |
subsession_id | The subsession ID for transmitted SPRT headers |
rx_payload_type | The payload type expected in received SPRT headers |
tx_payload_type | The payload type sent in transmitted SPRT headers |
parms | The parameter set for sizing the SPRT instance. NULL means use the defaults. |
tx_packet_handler | The callback function, used to send assembled packets. |
tx_user_data | An opaque pointer supplied to tx_packet_handler. |
rx_delivery_handler | The callback function, used to report arriving packets. |
rx_user_data | An opaque pointer supplied to rx_delivery_handler. |
timer_handler | The callback function, used to control the timers used by SPRT. |
timer_user_data | An opaque pointer supplied to timer_handler. |
status_handler | The callback function, used to report status events. |
status_user_data | An opaque pointer supplied to status_handler. |
References sprt_state_s::logging, and sprt_init().
Referenced by sprt_init().
int sprt_release | ( | sprt_state_t * | s | ) |
Release an SPRT context.
s | The SPRT context. |
References sprt_release().
Referenced by sprt_free(), and sprt_release().
int sprt_rx_packet | ( | sprt_state_t * | s, |
const uint8_t | pkt[], | ||
int | len ) |
Process a packet arriving from the far end. If the packet validates as an SPRT packet 0 is returned. If the packet does not follow the structure of an SPRT packet, or its packet type field does not contain the expected value, -1 is returned. In a mixed packet environment, where things like RTP, T.38 and SPRT packets are mixed in the same stream, -1 should indicate than one of the other packet sinks should be tried.
s | The SPRT context. |
pkt | The SPRT packet buffer. |
len | The length of the packet. |
References sprt_state_s::logging, span_log(), span_log_buf(), and sprt_rx_packet().
Referenced by sprt_rx_packet().
int sprt_set_local_busy | ( | sprt_state_t * | s, |
int | channel, | ||
bool | busy ) |
Test if local end of SPRT context is busy.
Set whether the local end of the specified channel of the SPRT context is currently busy.
s | The SPRT context. |
channel | The SPRT channel number. |
busy | true for busy. |
References sprt_set_local_busy().
Referenced by sprt_set_local_busy().
const char * sprt_transmission_channel_to_str | ( | int | channel | ) |
Find the name of an SPRT channel.
channel | The number of the SPRT channel (0 to 3). |
References sprt_transmission_channel_to_str().
Referenced by sprt_transmission_channel_to_str().
int sprt_tx | ( | sprt_state_t * | s, |
int | channel, | ||
const uint8_t | buf[], | ||
int | len ) |
Send a message to a SPRT channel.
s | The SPRT context. |
channel | The SPRT channel. |
buf | The message. |
len | The length of the message. |
References sprt_state_s::logging, span_log(), and sprt_tx().
Referenced by sprt_tx().