53#define T38_AUTOMATIC_REJECTION_SECONDS 5
136 if (old_state == new_state) {
141 ast_debug(2,
"T.38 state changed to '%u' from '%u' on channel '%s'\n",
142 new_state, old_state,
147 ast_debug(2,
"Automatic T.38 rejection on channel '%s' terminated\n",
160 ast_log(
LOG_WARNING,
"Scheduling of automatic T.38 rejection for channel '%s' failed\n",
164 parameters =
state->their_parms;
173 parameters =
state->their_parms;
211 ast_debug(2,
"Automatically rejecting T.38 request on channel '%s'\n",
238 return datastore->data;
247 state = datastore->data;
261 if (session_media->
udptl) {
267 ast_debug(5,
"Endpoint %s: Binding UDPTL media to %s\n",
269 session->endpoint->media.address);
270 media_address = &temp_media_address;
272 ast_debug(5,
"Endpoint %s: UDPTL media address invalid: %s\n",
274 session->endpoint->media.address);
286 char hoststr[PJ_INET6_ADDRSTRLEN];
288 pj_sockaddr_print(&trans_state->
host, hoststr,
sizeof(hoststr), 0);
290 ast_debug(5,
"Transport %s bound to %s: Using it for UDPTL media.\n",
291 session->endpoint->transport, hoststr);
292 media_address = &temp_media_address;
294 ast_debug(5,
"Transport %s bound to %s: Invalid for UDPTL media.\n",
295 session->endpoint->transport, hoststr);
333 struct pjsip_status_line
status = rdata->msg_info.msg->line.status;
337 if (
status.code / 100 <= 1) {
344 ast_debug(3,
"Received %d response to T.38 re-invite on '%s' but already had a final response (T.38 state:%d)\n",
353 ast_log(
LOG_WARNING,
"Received %d response to T.38 re-invite on '%s' but state unavailable\n",
359 if (
status.code / 100 == 2) {
369 if (session_media && !session_media->
udptl) {
370 session_media =
NULL;
373 if (!session_media) {
374 ast_log(
LOG_WARNING,
"Received %d response to T.38 re-invite on '%s' but no active session media\n",
455 if (!session_media) {
488 }
else if (data->session->t38state ==
T38_ENABLED) {
496 state->our_parms = *parameters;
500 if (!
state->their_parms.fill_bit_removal) {
501 state->our_parms.fill_bit_removal = 0;
503 if (!
state->their_parms.transcoding_mmr) {
504 state->our_parms.transcoding_mmr = 0;
506 if (!
state->their_parms.transcoding_jbig) {
507 state->our_parms.transcoding_jbig = 0;
510 state->our_parms.rate_management =
state->their_parms.rate_management;
512 if (!session_media) {
513 ast_log(
LOG_ERROR,
"Failed to negotiate parameters for reinvite on channel '%s' (No pending session media).\n",
514 data->session->channel ?
ast_channel_name(data->session->channel) :
"unknown channel");
520 }
else if ((data->session->t38state !=
T38_ENABLED) ||
529 state->our_parms = *parameters;
531 if (!session_media) {
532 ast_log(
LOG_ERROR,
"Failed to negotiate parameters on channel '%s' (No default session media).\n",
533 data->session->channel ?
ast_channel_name(data->session->channel) :
"unknown channel");
548 }
else if (data->session->t38state ==
T38_ENABLED) {
559 if (!session_media) {
560 ast_log(
LOG_ERROR,
"Failed to request parameters for reinvite on channel '%s' (No pending session media).\n",
561 data->session->channel ?
ast_channel_name(data->session->channel) :
"unknown channel");
609 ast_debug(2,
"T.38 support not enabled on %s, refusing T.38 negotiation\n",
612 &rsp_refused,
sizeof(rsp_refused));
615 ast_debug(2,
"T.38 support not enabled on %s, 'terminating' T.38 session\n",
618 &rsp_terminated,
sizeof(rsp_terminated));
646 .
type =
"T38 framehook",
680 if (framehook_id < 0) {
681 ast_log(
LOG_WARNING,
"Could not attach T.38 Frame hook, T.38 will be unavailable on '%s'\n",
689 ast_log(
LOG_ERROR,
"Could not alloc T.38 Frame hook datastore, T.38 will be unavailable on '%s'\n",
744 const struct pjmedia_sdp_media *stream)
748 for (attr_i = 0; attr_i < stream->attr_count; attr_i++) {
749 pjmedia_sdp_attr *attr = stream->attr[attr_i];
751 if (!pj_stricmp2(&attr->name,
"t38faxmaxbuffer")) {
753 }
else if (!pj_stricmp2(&attr->name,
"t38maxbitrate") || !pj_stricmp2(&attr->name,
"t38faxmaxrate")) {
754 switch (pj_strtoul(&attr->value)) {
774 }
else if (!pj_stricmp2(&attr->name,
"t38faxversion")) {
775 state->their_parms.version = pj_strtoul(&attr->value);
776 }
else if (!pj_stricmp2(&attr->name,
"t38faxmaxdatagram") || !pj_stricmp2(&attr->name,
"t38maxdatagram")) {
777 if (!
session->endpoint->media.t38.maxdatagram) {
780 }
else if (!pj_stricmp2(&attr->name,
"t38faxfillbitremoval")) {
781 state->their_parms.fill_bit_removal = 1;
782 }
else if (!pj_stricmp2(&attr->name,
"t38faxtranscodingmmr")) {
783 state->their_parms.transcoding_mmr = 1;
784 }
else if (!pj_stricmp2(&attr->name,
"t38faxtranscodingjbig")) {
785 state->their_parms.transcoding_jbig = 1;
786 }
else if (!pj_stricmp2(&attr->name,
"t38faxratemanagement")) {
787 if (!pj_stricmp2(&attr->value,
"localTCF")) {
789 }
else if (!pj_stricmp2(&attr->value,
"transferredTCF")) {
792 }
else if (!pj_stricmp2(&attr->name,
"t38faxudpec")) {
795 if (!pj_stricmp2(&attr->value,
"t38UDPFEC")) {
797 }
else if (!pj_stricmp2(&attr->value,
"t38UDPRedundancy")) {
803 if (!pj_stricmp2(&attr->value,
"t38UDPRedundancy")) {
812 if (!pj_stricmp2(&attr->value,
"t38UDPRedundancy")) {
814 }
else if (!pj_stricmp2(&attr->value,
"t38UDPFEC")) {
828 const struct pjmedia_sdp_session *sdp,
const struct pjmedia_sdp_media *stream)
832 if (!
session->endpoint->media.t38.enabled) {
861 int index,
struct ast_stream *asterisk_stream)
864 char host[NI_MAXHOST];
865 pjmedia_sdp_media *stream = sdp->media[index];
868 if (!
session->endpoint->media.t38.enabled) {
869 ast_debug(3,
"Declining; T.38 not enabled on session\n");
878 ast_debug(3,
"Declining; T.38 state is rejected or declined\n");
883 ast_copy_pj_str(host, stream->conn ? &stream->conn->addr : &sdp->conn->addr,
sizeof(host));
888 ast_debug(3,
"Declining; provided host is invalid\n");
896 ast_debug(3,
"Declining, provided host does not match configured address family\n");
905 struct pjmedia_sdp_session *sdp,
const struct pjmedia_sdp_session *remote,
struct ast_stream *stream)
907 pj_pool_t *pool =
session->inv_session->pool_prov;
908 static const pj_str_t STR_IN = {
"IN", 2 };
909 static const pj_str_t STR_IP4 = {
"IP4", 3};
910 static const pj_str_t STR_IP6 = {
"IP6", 3};
911 static const pj_str_t STR_UDPTL = {
"udptl", 5 };
912 static const pj_str_t STR_T38 = {
"t38", 3 };
913 static const pj_str_t STR_TRANSFERREDTCF = {
"transferredTCF", 14 };
914 static const pj_str_t STR_LOCALTCF = {
"localTCF", 8 };
915 static const pj_str_t STR_T38UDPFEC = {
"t38UDPFEC", 9 };
916 static const pj_str_t STR_T38UDPREDUNDANCY = {
"t38UDPRedundancy", 16 };
918 pjmedia_sdp_media *media;
919 const char *hostip =
NULL;
924 if (!
session->endpoint->media.t38.enabled) {
925 ast_debug(3,
"Not creating outgoing SDP stream: T.38 not enabled\n");
929 ast_debug(3,
"Not creating outgoing SDP stream: T.38 not enabled\n");
934 ast_debug(3,
"Not creating outgoing SDP stream: Failed to initialize T.38 session\n");
938 if (!(media = pj_pool_zalloc(pool,
sizeof(
struct pjmedia_sdp_media))) ||
939 !(media->conn = pj_pool_zalloc(pool,
sizeof(
struct pjmedia_sdp_conn)))) {
944 media->desc.transport = STR_UDPTL;
949 hostip =
session->endpoint->media.address;
953 ast_debug(3,
"Not creating outgoing SDP stream: no known host IP\n");
957 media->conn->net_type = STR_IN;
958 media->conn->addr_type =
session->endpoint->media.t38.ipv6 ? STR_IP6 : STR_IP4;
959 pj_strdup2(pool, &media->conn->addr, hostip);
962 media->desc.port_count = 1;
963 media->desc.fmt[media->desc.fmt_count++] = STR_T38;
965 snprintf(
tmp,
sizeof(
tmp),
"%u",
state->our_parms.version);
966 media->attr[media->attr_count++] = pjmedia_sdp_attr_create(pool,
"T38FaxVersion", pj_cstr(&stmp,
tmp));
969 media->attr[media->attr_count++] = pjmedia_sdp_attr_create(pool,
"T38MaxBitRate", pj_cstr(&stmp,
tmp));
971 if (
state->our_parms.fill_bit_removal) {
972 media->attr[media->attr_count++] = pjmedia_sdp_attr_create(pool,
"T38FaxFillBitRemoval",
NULL);
975 if (
state->our_parms.transcoding_mmr) {
976 media->attr[media->attr_count++] = pjmedia_sdp_attr_create(pool,
"T38FaxTranscodingMMR",
NULL);
979 if (
state->our_parms.transcoding_jbig) {
980 media->attr[media->attr_count++] = pjmedia_sdp_attr_create(pool,
"T38FaxTranscodingJBIG",
NULL);
983 switch (
state->our_parms.rate_management) {
985 media->attr[media->attr_count++] = pjmedia_sdp_attr_create(pool,
"T38FaxRateManagement", &STR_TRANSFERREDTCF);
988 media->attr[media->attr_count++] = pjmedia_sdp_attr_create(pool,
"T38FaxRateManagement", &STR_LOCALTCF);
993 media->attr[media->attr_count++] = pjmedia_sdp_attr_create(pool,
"T38FaxMaxDatagram", pj_cstr(&stmp,
tmp));
999 media->attr[media->attr_count++] = pjmedia_sdp_attr_create(pool,
"T38FaxUdpEC", &STR_T38UDPFEC);
1002 media->attr[media->attr_count++] = pjmedia_sdp_attr_create(pool,
"T38FaxUdpEC", &STR_T38UDPREDUNDANCY);
1006 sdp->media[sdp->media_count++] = media;
1015 if (!session_media->
udptl) {
1031 if (!session_media->
udptl) {
1041 const struct pjmedia_sdp_session *remote,
int index,
struct ast_stream *asterisk_stream)
1044 pjmedia_sdp_media *remote_stream = remote->media[index];
1045 char host[NI_MAXHOST];
1048 if (!session_media->
udptl) {
1049 ast_debug(3,
"Not applying negotiated SDP stream: no UDTPL session\n");
1057 ast_copy_pj_str(host, remote_stream->conn ? &remote_stream->conn->addr : &remote->conn->addr,
sizeof(host));
1062 ast_debug(3,
"Not applying negotiated SDP stream: failed to resolve remote stream host\n");
1082 char host[NI_MAXHOST];
1086 if (!stream->conn || !transport_state) {
1107 if (session_media->
udptl) {
1154 ast_log(
LOG_ERROR,
"Unable to register SDP handler for image stream type\n");
1170 .
requires =
"res_pjsip,res_pjsip_session,udptl",
Access Control of various sorts.
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_mansession session
#define ast_calloc(num, len)
A wrapper for calloc()
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc(data_size, destructor_fn)
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
void * ast_channel_tech_pvt(const struct ast_channel *chan)
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
#define ast_channel_lock(chan)
int ast_queue_control_data(struct ast_channel *chan, enum ast_control_frame_type control, const void *data, size_t datalen)
Queue a control frame with payload.
void ast_channel_set_unbridged(struct ast_channel *chan, int value)
Sets the unbridged flag and queues a NULL frame on the channel to trigger a check by bridge_channel_w...
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
#define ast_channel_unlock(chan)
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
const char * ast_codec_media_type2str(enum ast_media_type type)
Conversion function to take a media type and turn it into a string.
#define ast_datastore_alloc(info, uid)
int ast_framehook_attach(struct ast_channel *chan, struct ast_framehook_interface *i)
Attach an framehook onto a channel for frame interception.
ast_framehook_event
These are the types of events that the framehook's event callback can receive.
@ AST_FRAMEHOOK_EVENT_WRITE
int ast_framehook_detach(struct ast_channel *chan, int framehook_id)
Detach an framehook from a channel.
#define AST_FRAMEHOOK_INTERFACE_VERSION
int ast_sip_push_task(struct ast_taskprocessor *serializer, int(*sip_task)(void *), void *task_data)
Pushes a task to SIP servants.
@ AST_T38_REQUEST_TERMINATE
@ AST_T38_REQUEST_NEGOTIATE
#define ast_frdup(fr)
Copies a frame.
@ AST_T38_RATE_MANAGEMENT_LOCAL_TCF
@ AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF
ast_frame_type
Frame types.
@ AST_CONTROL_T38_PARAMETERS
struct ast_frame ast_null_frame
#define ast_debug(level,...)
Log a DEBUG message.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODPRI_CHANNEL_DRIVER
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
#define ast_sockaddr_port(addr)
Get the port number of a socket address.
int ast_sockaddr_is_ipv6(const struct ast_sockaddr *addr)
Determine if this is an IPv6 address.
int ast_sockaddr_resolve(struct ast_sockaddr **addrs, const char *str, int flags, int family)
Parses a string with an IPv4 or IPv6 address and place results into an array.
int ast_sockaddr_parse(struct ast_sockaddr *addr, const char *str, int flags)
Parse an IPv4 or IPv6 address string.
#define ast_sockaddr_set_port(addr, port)
Sets the port number of a socket address.
int ast_sockaddr_is_ipv4(const struct ast_sockaddr *addr)
Determine if the address is an IPv4 address.
static char * ast_sockaddr_stringify_addr_remote(const struct ast_sockaddr *addr)
Wrapper around ast_sockaddr_stringify_fmt() to return an address only.
const char * ast_sip_get_host_ip_string(int af)
Retrieve the local host address in string form.
pjsip_endpoint * ast_sip_get_pjsip_endpoint(void)
Get a pointer to the PJSIP endpoint.
@ AST_SIP_SUPPLEMENT_PRIORITY_CHANNEL
void ast_copy_pj_str(char *dest, const pj_str_t *src, size_t size)
Copy a pj_str_t into a standard character buffer.
#define ast_sip_transport_is_nonlocal(transport_state, addr)
struct ast_sip_transport_state * ast_sip_get_transport_state(const char *transport_id)
Retrieve transport state.
struct ast_sorcery * ast_sip_get_sorcery(void)
Get a pointer to the SIP sorcery structure.
@ AST_SIP_SESSION_REFRESH_METHOD_INVITE
void ast_sip_session_unregister_sdp_handler(struct ast_sip_session_sdp_handler *handler, const char *stream_type)
Unregister an SDP handler.
int ast_sip_session_register_sdp_handler(struct ast_sip_session_sdp_handler *handler, const char *stream_type)
Register an SDP handler.
struct ast_datastore * ast_sip_session_get_datastore(struct ast_sip_session *session, const char *name)
Retrieve a session datastore.
struct ast_sip_session_media_state * ast_sip_session_media_state_clone(const struct ast_sip_session_media_state *media_state)
Clone a media state.
ast_sip_session_t38state
T.38 states for a session.
struct ast_sip_session_media_state * ast_sip_session_media_state_alloc(void)
Allocate a session media state structure.
int ast_sip_session_media_add_read_callback(struct ast_sip_session *session, struct ast_sip_session_media *session_media, int fd, ast_sip_session_media_read_cb callback)
Set a read callback for a media session with a specific file descriptor.
int ast_sip_session_add_datastore(struct ast_sip_session *session, struct ast_datastore *datastore)
Add a datastore to a SIP session.
void ast_sip_session_media_state_free(struct ast_sip_session_media_state *media_state)
Free a session media state structure.
#define ast_sip_session_register_supplement(supplement)
struct ast_datastore * ast_sip_session_alloc_datastore(const struct ast_datastore_info *info, const char *uid)
Alternative for ast_datastore_alloc()
void ast_sip_session_unregister_supplement(struct ast_sip_session_supplement *supplement)
Unregister a an supplement to SIP session processing.
struct ast_sip_session_media * ast_sip_session_media_state_add(struct ast_sip_session *session, struct ast_sip_session_media_state *media_state, enum ast_media_type type, int position)
Allocate an ast_session_media and add it to the media state's vector.
ast_sip_session_sdp_stream_defer
@ AST_SIP_SESSION_SDP_DEFER_NEEDED
@ AST_SIP_SESSION_SDP_DEFER_NOT_HANDLED
@ AST_SIP_SESSION_SDP_DEFER_NOT_NEEDED
@ AST_SIP_SESSION_SDP_DEFER_ERROR
void ast_sip_session_resume_reinvite(struct ast_sip_session *session)
Resumes processing of a deferred incoming re-invite.
void ast_sip_session_media_state_reset(struct ast_sip_session_media_state *media_state)
Reset a media state to a clean state.
int ast_sip_session_refresh(struct ast_sip_session *session, ast_sip_session_request_creation_cb on_request_creation, ast_sip_session_sdp_creation_cb on_sdp_creation, ast_sip_session_response_cb on_response, enum ast_sip_session_refresh_method method, int generate_new_sdp, struct ast_sip_session_media_state *media_state)
Send a reinvite or UPDATE on a session.
int ast_sip_session_media_set_write_callback(struct ast_sip_session *session, struct ast_sip_session_media *session_media, ast_sip_session_media_write_cb callback)
Set a write callback for a media session.
static const struct ast_datastore_info t38_framehook_datastore
static void t38_automatic_reject_timer_cb(pj_timer_heap_t *timer_heap, struct pj_timer_entry *entry)
Timer entry callback which queues a task to reject a T.38 re-invite and resume handling it.
static struct ast_sockaddr address
Address for UDPTL.
static int t38_incoming_invite_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
Function called when an INVITE arrives.
static int t38_reinvite_sdp_cb(struct ast_sip_session *session, pjmedia_sdp_session *sdp)
Callback for when T.38 reinvite SDP is created.
static const struct ast_datastore_info t38_datastore
Datastore for attaching T.38 state information.
static void t38_change_state(struct ast_sip_session *session, struct ast_sip_session_media *session_media, struct t38_state *state, enum ast_sip_session_t38state new_state)
Helper function for changing the T.38 state.
static int negotiate_incoming_sdp_stream(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, int index, struct ast_stream *asterisk_stream)
Function which negotiates an incoming media stream.
static int t38_reinvite_response_cb(struct ast_sip_session *session, pjsip_rx_data *rdata)
Callback for when a response is received for a T.38 re-invite.
static int t38_consume(void *data, enum ast_frame_type type)
static int media_session_udptl_write_callback(struct ast_sip_session *session, struct ast_sip_session_media *session_media, struct ast_frame *frame)
static int t38_automatic_reject(void *obj)
Task function which rejects a T.38 re-invite and resumes handling it.
static int apply_negotiated_sdp_stream(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *local, const struct pjmedia_sdp_session *remote, int index, struct ast_stream *asterisk_stream)
Function which applies a negotiated stream.
static void t38_attach_framehook(struct ast_sip_session *session)
Function called to attach T.38 framehook to channel when appropriate.
static int t38_initialize_session(struct ast_sip_session *session, struct ast_sip_session_media *session_media)
Initializes UDPTL support on a session, only done when actually needed.
static struct ast_sip_session_media_state * t38_create_media_state(struct ast_sip_session *session)
Helper function which creates a media state for strictly T.38.
static int t38_interpret_parameters(void *obj)
Task for reacting to T.38 control frame.
static void t38_masq(void *data, int framehook_id, struct ast_channel *old_chan, struct ast_channel *new_chan)
static struct ast_frame * media_session_udptl_read_callback(struct ast_sip_session *session, struct ast_sip_session_media *session_media)
static void t38_outgoing_invite_request(struct ast_sip_session *session, struct pjsip_tx_data *tdata)
Function called when an INVITE is sent.
#define T38_AUTOMATIC_REJECTION_SECONDS
The number of seconds after receiving a T.38 re-invite before automatically rejecting it.
static void t38_parameters_task_data_destroy(void *obj)
Destructor for T.38 data.
static void stream_destroy(struct ast_sip_session_media *session_media)
Function which destroys the UDPTL instance when session ends.
static void change_outgoing_sdp_stream_media_address(pjsip_tx_data *tdata, struct pjmedia_sdp_media *stream, struct ast_sip_transport *transport)
Function which updates the media stream with external media address, if applicable.
static struct t38_state * t38_state_get_or_alloc(struct ast_sip_session *session)
Helper function which retrieves or allocates a T.38 state information datastore.
static void t38_interpret_sdp(struct t38_state *state, struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_media *stream)
Parse a T.38 image stream and store the attribute information.
static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct ast_sip_session_media *session_media, struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_session *remote, struct ast_stream *stream)
Function which creates an outgoing stream.
static struct ast_frame * t38_framehook(struct ast_channel *chan, struct ast_frame *f, enum ast_framehook_event event, void *data)
Frame hook callback for T.38 related stuff.
static unsigned int t38_get_rate(enum ast_control_t38_rate rate)
Get Max T.38 Transmission rate from T38 capabilities.
static struct t38_parameters_task_data * t38_parameters_task_data_alloc(struct ast_sip_session *session, struct ast_frame *frame)
Allocator for T.38 data.
static enum ast_sip_session_sdp_stream_defer defer_incoming_sdp_stream(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream)
Function which defers an incoming media stream.
static int load_module(void)
Load the module.
static struct ast_sip_session_sdp_handler image_sdp_handler
SDP handler for 'image' media stream.
static void t38_state_destroy(void *obj)
Destructor for T.38 state information.
static int unload_module(void)
Unloads the SIP T.38 module from Asterisk.
static struct ast_sip_session_supplement t38_supplement
Supplement for adding framehook to session channel.
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
void * ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *type, const char *id)
Retrieve an object using its unique identifier.
struct ast_stream_topology * ast_stream_topology_alloc(void)
Create a stream topology.
struct ast_stream * ast_stream_alloc(const char *name, enum ast_media_type type)
Create a new media stream representation.
int ast_stream_topology_set_stream(struct ast_stream_topology *topology, unsigned int position, struct ast_stream *stream)
Set a specific position in a topology.
@ AST_STREAM_STATE_SENDRECV
Set when the stream is sending and receiving media.
void ast_stream_set_state(struct ast_stream *stream, enum ast_stream_state state)
Set the state of a stream.
void ast_stream_set_formats(struct ast_stream *stream, struct ast_format_cap *caps)
Set the current negotiated formats of a stream.
void ast_stream_free(struct ast_stream *stream)
Destroy a media stream representation.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Main Channel structure associated with a channel.
enum ast_control_t38 request_response
Structure for a data store type.
Structure for a data store object.
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
union ast_frame::@226 data
enum ast_frame_type frametype
A structure which contains a channel implementation and session.
struct ast_sip_session * session
Pointer to session.
struct ast_sip_endpoint_media_configuration media
A handler for SDPs in SIP sessions.
void(* stream_stop)(struct ast_sip_session_media *session_media)
Stop a session_media created by this handler but do not destroy resources.
A supplement to SIP message processing.
A structure describing a SIP session.
struct ast_sip_endpoint * endpoint
struct ast_taskprocessor * serializer
Structure for SIP transport information.
struct pjsip_transport * transport
Transport itself.
Socket address structure.
Structure for T.38 parameters task data.
struct ast_sip_session * session
Session itself.
struct ast_frame * frame
T.38 control frame.
enum ast_sip_session_t38state state
Current state.
struct ast_sip_session_media_state * media_state
struct ast_control_t38_parameters their_parms
Their T.38 parameters.
struct ast_control_t38_parameters our_parms
Our T.38 parameters.
pj_timer_entry timer
Timer entry for automatically rejecting an inbound re-invite.
userdata associated with baseline taskprocessor test
void ast_udptl_destroy(struct ast_udptl *udptl)
enum ast_t38_ec_modes ast_udptl_get_error_correction_scheme(const struct ast_udptl *udptl)
int ast_udptl_fd(const struct ast_udptl *udptl)
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.
void ast_udptl_set_local_max_ifp(struct ast_udptl *udptl, unsigned int max_ifp)
unsigned int ast_udptl_get_far_max_ifp(struct ast_udptl *udptl)
retrieves far max ifp
void ast_udptl_setnat(struct ast_udptl *udptl, int nat)
void ast_udptl_get_us(const struct ast_udptl *udptl, struct ast_sockaddr *us)
struct ast_frame * ast_udptl_read(struct ast_udptl *udptl)
struct ast_udptl * ast_udptl_new_with_bindaddr(struct ast_sched_context *sched, struct io_context *io, int callbackmode, struct ast_sockaddr *in)
int ast_udptl_write(struct ast_udptl *udptl, struct ast_frame *f)
unsigned int ast_udptl_get_local_max_datagram(struct ast_udptl *udptl)
retrieves local_max_datagram.
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 val...
void ast_udptl_set_error_correction_scheme(struct ast_udptl *udptl, enum ast_t38_ec_modes ec)
@ UDPTL_ERROR_CORRECTION_FEC
@ UDPTL_ERROR_CORRECTION_NONE
@ UDPTL_ERROR_CORRECTION_REDUNDANCY
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
int ast_check_ipv6(void)
Test that an OS supports IPv6 Networking.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.