Asterisk - The Open Source Telephony Project
18.5.0
|
UDPTL support for T.38. More...
#include "asterisk/network.h"
#include "asterisk/frame.h"
#include "asterisk/io.h"
#include "asterisk/sched.h"
#include "asterisk/channel.h"
#include "asterisk/netsock2.h"
Go to the source code of this file.
Typedefs | |
typedef int(* | ast_udptl_callback) (struct ast_udptl *udptl, struct ast_frame *f, void *data) |
Enumerations | |
enum | ast_t38_ec_modes { UDPTL_ERROR_CORRECTION_NONE, UDPTL_ERROR_CORRECTION_FEC, UDPTL_ERROR_CORRECTION_REDUNDANCY } |
Functions | |
void | ast_udptl_destroy (struct ast_udptl *udptl) |
int | ast_udptl_fd (const struct ast_udptl *udptl) |
enum ast_t38_ec_modes | ast_udptl_get_error_correction_scheme (const struct ast_udptl *udptl) |
unsigned int | ast_udptl_get_far_max_datagram (const struct ast_udptl *udptl) |
unsigned int | ast_udptl_get_far_max_ifp (struct ast_udptl *udptl) |
retrieves far max ifp More... | |
unsigned int | ast_udptl_get_local_max_datagram (struct ast_udptl *udptl) |
retrieves local_max_datagram. More... | |
void | ast_udptl_get_peer (const struct ast_udptl *udptl, struct ast_sockaddr *them) |
void | ast_udptl_get_us (const struct ast_udptl *udptl, struct ast_sockaddr *us) |
struct ast_udptl * | ast_udptl_new_with_bindaddr (struct ast_sched_context *sched, struct io_context *io, int callbackmode, struct ast_sockaddr *in) |
struct ast_frame * | ast_udptl_read (struct ast_udptl *udptl) |
void | ast_udptl_reset (struct ast_udptl *udptl) |
void | ast_udptl_set_callback (struct ast_udptl *udptl, ast_udptl_callback callback) |
void | ast_udptl_set_data (struct ast_udptl *udptl, void *data) |
void | ast_udptl_set_error_correction_scheme (struct ast_udptl *udptl, enum ast_t38_ec_modes ec) |
void | ast_udptl_set_far_max_datagram (struct ast_udptl *udptl, unsigned int max_datagram) |
sets far max datagram size. If max_datagram is = 0, the far max datagram size is set to a default value. More... | |
void | ast_udptl_set_local_max_ifp (struct ast_udptl *udptl, unsigned int max_ifp) |
void | ast_udptl_set_m_type (struct ast_udptl *udptl, unsigned int pt) |
void | ast_udptl_set_peer (struct ast_udptl *udptl, const struct ast_sockaddr *them) |
void | ast_udptl_set_tag (struct ast_udptl *udptl, const char *format,...) |
Associates a character string 'tag' with a UDPTL session. More... | |
void | ast_udptl_set_udptlmap_type (struct ast_udptl *udptl, unsigned int pt, char *mimeType, char *mimeSubtype) |
void | ast_udptl_setnat (struct ast_udptl *udptl, int nat) |
int | ast_udptl_setqos (struct ast_udptl *udptl, unsigned int tos, unsigned int cos) |
void | ast_udptl_stop (struct ast_udptl *udptl) |
int | ast_udptl_write (struct ast_udptl *udptl, struct ast_frame *f) |
enum ast_t38_ec_modes |
Enumerator | |
---|---|
UDPTL_ERROR_CORRECTION_NONE | |
UDPTL_ERROR_CORRECTION_FEC | |
UDPTL_ERROR_CORRECTION_REDUNDANCY |
void ast_udptl_destroy | ( | struct ast_udptl * | udptl | ) |
Definition at line 1150 of file udptl.c.
References ast_free, ast_io_remove(), ast_udptl::fd, ast_udptl::io, ast_udptl::ioid, and ast_udptl::tag.
Referenced by ooh323_destroy(), sip_pvt_dtor(), and stream_destroy().
int ast_udptl_fd | ( | const struct ast_udptl * | udptl | ) |
Definition at line 730 of file udptl.c.
References ast_udptl::fd.
Referenced by apply_negotiated_sdp_stream(), configure_local_rtp(), initialize_udptl(), and sip_new().
enum ast_t38_ec_modes ast_udptl_get_error_correction_scheme | ( | const struct ast_udptl * | udptl | ) |
Definition at line 940 of file udptl.c.
References ast_udptl::error_correction_scheme.
Referenced by add_sdp(), and create_outgoing_sdp_stream().
unsigned int ast_udptl_get_far_max_datagram | ( | const struct ast_udptl * | udptl | ) |
Definition at line 1008 of file udptl.c.
References ast_udptl::far_max_datagram.
Referenced by process_sdp().
unsigned int ast_udptl_get_far_max_ifp | ( | struct ast_udptl * | udptl | ) |
retrieves far max ifp
positive | value representing max ifp size |
0 | if no value is present |
Definition at line 1016 of file udptl.c.
References calculate_far_max_ifp(), and ast_udptl::far_max_ifp.
Referenced by change_t38_state(), interpret_t38_parameters(), onModeChanged(), ooh323_indicate(), setup_udptl_connection(), t38_change_state(), and t38_interpret_parameters().
unsigned int ast_udptl_get_local_max_datagram | ( | struct ast_udptl * | udptl | ) |
retrieves local_max_datagram.
positive | value representing max datagram size. |
0 | if no value is present |
Definition at line 984 of file udptl.c.
References calculate_local_max_datagram(), and ast_udptl::local_max_datagram.
Referenced by add_sdp(), and create_outgoing_sdp_stream().
void ast_udptl_get_peer | ( | const struct ast_udptl * | udptl, |
struct ast_sockaddr * | them | ||
) |
Definition at line 1135 of file udptl.c.
References ast_sockaddr_copy(), and ast_udptl::them.
void ast_udptl_get_us | ( | const struct ast_udptl * | udptl, |
struct ast_sockaddr * | us | ||
) |
Definition at line 1140 of file udptl.c.
References ast_sockaddr_copy(), and ast_udptl::us.
Referenced by add_sdp(), configure_local_rtp(), and create_outgoing_sdp_stream().
struct ast_udptl* ast_udptl_new_with_bindaddr | ( | struct ast_sched_context * | sched, |
struct io_context * | io, | ||
int | callbackmode, | ||
struct ast_sockaddr * | in | ||
) |
Definition at line 1028 of file udptl.c.
References ao2_cleanup, ao2_global_obj_ref, ast_bind(), ast_calloc, ast_free, ast_io_add(), AST_IO_IN, ast_log, ast_random(), ast_sockaddr_copy(), ast_sockaddr_is_ipv6(), ast_sockaddr_set_port, ast_socket_nonblock, udptl_fec_tx_buffer_t::buf_len, udptl_fec_rx_buffer_t::buf_len, errno, ast_udptl::error_correction_entries, ast_udptl::error_correction_span, ast_udptl::far_max_datagram, ast_udptl::far_max_ifp, ast_udptl::fd, globals, ast_udptl::io, io, ast_udptl::ioid, ast_udptl::local_max_datagram, ast_udptl::local_max_ifp, LOG_ERROR, LOG_WARNING, NULL, RAII_VAR, ast_udptl::rx, ast_udptl::sched, sched, ast_udptl::tx, UDPTL_BUF_MASK, udptlread(), and ast_udptl::us.
Referenced by configure_local_rtp(), initialize_udptl(), and t38_initialize_session().
Definition at line 762 of file udptl.c.
References ast_assert, ast_debug, AST_FRIENDLY_OFFSET, ast_log, ast_null_frame, ast_recvfrom(), ast_sockaddr_cmp(), ast_sockaddr_copy(), ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_verb, buf, errno, ast_udptl::f, ast_udptl::fd, LOG_TAG, LOG_WARNING, ast_udptl::nat, NULL, ast_udptl::rawdata, ast_udptl::tag, ast_udptl::them, udptl_debug_test_addr(), and udptl_rx_packet().
Referenced by media_session_udptl_read_callback(), ooh323_rtp_read(), sip_rtp_read(), skinny_rtp_read(), and udptlread().
void ast_udptl_reset | ( | struct ast_udptl * | udptl | ) |
void ast_udptl_set_callback | ( | struct ast_udptl * | udptl, |
ast_udptl_callback | callback | ||
) |
void ast_udptl_set_data | ( | struct ast_udptl * | udptl, |
void * | data | ||
) |
Definition at line 735 of file udptl.c.
References ast_udptl::data.
void ast_udptl_set_error_correction_scheme | ( | struct ast_udptl * | udptl, |
enum ast_t38_ec_modes | ec | ||
) |
Definition at line 945 of file udptl.c.
References ast_udptl::error_correction_entries, ast_udptl::error_correction_scheme, ast_udptl::error_correction_span, ast_udptl::far_max_ifp, ast_udptl::local_max_datagram, UDPTL_ERROR_CORRECTION_FEC, and UDPTL_ERROR_CORRECTION_REDUNDANCY.
Referenced by process_sdp(), process_sdp_a_image(), set_t38_capabilities(), t38_initialize_session(), and t38_interpret_sdp().
void ast_udptl_set_far_max_datagram | ( | struct ast_udptl * | udptl, |
unsigned int | max_datagram | ||
) |
sets far max datagram size. If max_datagram is = 0, the far max datagram size is set to a default value.
Definition at line 997 of file udptl.c.
References DEFAULT_FAX_MAX_DATAGRAM, ast_udptl::far_max_datagram, ast_udptl::far_max_ifp, and FAX_MAX_DATAGRAM_LIMIT.
Referenced by configure_local_rtp(), onModeChanged(), process_sdp(), process_sdp_a_image(), t38_initialize_session(), and t38_interpret_sdp().
void ast_udptl_set_local_max_ifp | ( | struct ast_udptl * | udptl, |
unsigned int | max_ifp | ||
) |
Definition at line 973 of file udptl.c.
References ast_udptl::local_max_datagram, and ast_udptl::local_max_ifp.
Referenced by interpret_t38_parameters(), and t38_interpret_parameters().
void ast_udptl_set_m_type | ( | struct ast_udptl * | udptl, |
unsigned int | pt | ||
) |
void ast_udptl_set_peer | ( | struct ast_udptl * | udptl, |
const struct ast_sockaddr * | them | ||
) |
Definition at line 1130 of file udptl.c.
References ast_sockaddr_copy(), and ast_udptl::them.
Referenced by apply_negotiated_sdp_stream(), process_sdp(), and setup_udptl_connection().
void ast_udptl_set_tag | ( | struct ast_udptl * | udptl, |
const char * | format, | ||
... | |||
) |
Associates a character string 'tag' with a UDPTL session.
udptl | The UDPTL session. |
format | printf-style format string used to construct the tag |
This function formats a tag for the specified UDPTL session, so that any log messages generated by the UDPTL stack related to that session will include the tag and the reader of the messages will be able to identify which endpoint caused them to be generated.
none |
Definition at line 1112 of file udptl.c.
References ast_free, ast_vasprintf, NULL, and ast_udptl::tag.
Referenced by change_t38_state(), setup_udptl_connection(), and t38_change_state().
void ast_udptl_set_udptlmap_type | ( | struct ast_udptl * | udptl, |
unsigned int | pt, | ||
char * | mimeType, | ||
char * | mimeSubtype | ||
) |
void ast_udptl_setnat | ( | struct ast_udptl * | udptl, |
int | nat | ||
) |
Definition at line 745 of file udptl.c.
References ast_udptl::nat, and nat.
Referenced by do_setnat(), initialize_udptl(), and t38_initialize_session().
int ast_udptl_setqos | ( | struct ast_udptl * | udptl, |
unsigned int | tos, | ||
unsigned int | cos | ||
) |
Definition at line 1125 of file udptl.c.
References ast_set_qos(), and ast_udptl::fd.
Referenced by initialize_udptl().
void ast_udptl_stop | ( | struct ast_udptl * | udptl | ) |
Definition at line 1145 of file udptl.c.
References ast_sockaddr_setnull(), and ast_udptl::them.
Referenced by process_sdp(), and stop_media_flows().
Definition at line 1161 of file udptl.c.
References AST_FRAME_MODEM, ast_log, AST_MODEM_T38, ast_sendto(), ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_verb, buf, ast_frame::data, ast_frame::datalen, DEFAULT_FAX_MAX_DATAGRAM, errno, ast_udptl::far_max_datagram, ast_udptl::far_max_ifp, ast_udptl::fd, ast_frame::frametype, ast_frame_subclass::integer, ast_sockaddr::len, LOG_NOTICE, LOG_TAG, LOG_WARNING, ast_frame::ptr, seq, ast_frame::subclass, ast_udptl::them, ast_udptl::tx_seq_no, udptl_build_packet(), and udptl_debug_test_addr().
Referenced by media_session_udptl_write_callback(), ooh323_write(), and sip_write().