Asterisk - The Open Source Telephony Project  21.4.1
Typedefs | Enumerations | Functions
udptl.h File Reference

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_udptlast_udptl_new_with_bindaddr (struct ast_sched_context *sched, struct io_context *io, int callbackmode, struct ast_sockaddr *in)
 
struct ast_frameast_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.
 
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)
 

Detailed Description

UDPTL support for T.38.

Author
Steve Underwood steve.nosp@m.u@co.nosp@m.ppice.nosp@m..org udptl.c
Todo:
add doxygen documentation to this file!

Definition in file udptl.h.

Function Documentation

unsigned int ast_udptl_get_far_max_ifp ( struct ast_udptl udptl)

retrieves far max ifp

Returns
positive value representing max ifp size
Return values
0if no value is present

Definition at line 1014 of file udptl.c.

References ast_udptl::far_max_ifp.

Referenced by t38_change_state(), and t38_interpret_parameters().

1015 {
1016  if (udptl->far_max_ifp == -1) {
1017  calculate_far_max_ifp(udptl);
1018  }
1019 
1020  if (udptl->far_max_ifp < 0) {
1021  return 0;
1022  }
1023  return udptl->far_max_ifp;
1024 }
int far_max_ifp
Definition: udptl.c:203
unsigned int ast_udptl_get_local_max_datagram ( struct ast_udptl udptl)

retrieves local_max_datagram.

Returns
positive value representing max datagram size.
Return values
0if no value is present

Definition at line 982 of file udptl.c.

References ast_udptl::local_max_datagram.

Referenced by create_outgoing_sdp_stream().

983 {
984  if (udptl->local_max_datagram == -1) {
985  calculate_local_max_datagram(udptl);
986  }
987 
988  /* this function expects a unsigned value in return. */
989  if (udptl->local_max_datagram < 0) {
990  return 0;
991  }
992  return udptl->local_max_datagram;
993 }
int local_max_datagram
Definition: udptl.c:195
void ast_udptl_set_tag ( struct ast_udptl udptl,
const char *  format,
  ... 
)

Associates a character string 'tag' with a UDPTL session.

Parameters
udptlThe UDPTL session.
formatprintf-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.

Definition at line 1110 of file udptl.c.

References ast_vasprintf.

Referenced by t38_change_state().

1111 {
1112  va_list ap;
1113 
1114  ast_free(udptl->tag);
1115  udptl->tag = NULL;
1116  va_start(ap, format);
1117  if (ast_vasprintf(&udptl->tag, format, ap) == -1) {
1118  udptl->tag = NULL;
1119  }
1120  va_end(ap);
1121 }
const char * format
Definition: translate.h:143
#define ast_vasprintf(ret, fmt, ap)
A wrapper for vasprintf()
Definition: astmm.h:278