Asterisk - The Open Source Telephony Project
21.4.1
|
UDPTL support for T.38 faxing. More...
#include "asterisk.h"
#include <sys/time.h>
#include <signal.h>
#include <fcntl.h>
#include "asterisk/module.h"
#include "asterisk/udptl.h"
#include "asterisk/frame.h"
#include "asterisk/channel.h"
#include "asterisk/acl.h"
#include "asterisk/config_options.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
#include "asterisk/netsock2.h"
#include "asterisk/cli.h"
#include "asterisk/unaligned.h"
Go to the source code of this file.
Data Structures | |
struct | ast_udptl |
Structure for an UDPTL session. More... | |
struct | udptl_config |
struct | udptl_fec_rx_buffer_t |
struct | udptl_fec_tx_buffer_t |
struct | udptl_global_options |
Macros | |
#define | DEFAULT_FAX_MAX_DATAGRAM 400 |
#define | DEFAULT_UDPTLEND 4999 |
#define | DEFAULT_UDPTLSTART 4000 |
#define | FALSE 0 |
#define | FAX_MAX_DATAGRAM_LIMIT 1400 |
#define | LOCAL_FAX_MAX_DATAGRAM 1400 |
#define | LOG_TAG(u) S_OR(u->tag, "no tag") |
#define | MAX_FEC_ENTRIES 5 |
#define | MAX_FEC_SPAN 5 |
#define | TRUE (!FALSE) |
#define | UDPTL_BUF_MASK 15 |
#define | UDPTL_MTU 1200 |
Functions | |
static void | __ast_udptl_reload (int reload) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static | AO2_GLOBAL_OBJ_STATIC (globals) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
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 *addr) |
struct ast_frame * | ast_udptl_read (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_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_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 *s, struct ast_frame *f) |
static void | calculate_far_max_ifp (struct ast_udptl *udptl) |
static void | calculate_local_max_datagram (struct ast_udptl *udptl) |
CONFIG_INFO_CORE ("udptl", cfg_info, globals, udptl_snapshot_alloc,.files=ACO_FILES(&udptl_conf),.pre_apply_config=udptl_pre_apply_config,) | |
static int | decode_length (uint8_t *buf, unsigned int limit, unsigned int *len, unsigned int *pvalue) |
static int | decode_open_type (uint8_t *buf, unsigned int limit, unsigned int *len, const uint8_t **p_object, unsigned int *p_num_octets) |
static unsigned int | encode_length (uint8_t *buf, unsigned int *len, unsigned int value) |
static int | encode_open_type (const struct ast_udptl *udptl, uint8_t *buf, unsigned int buflen, unsigned int *len, const uint8_t *data, unsigned int num_octets) |
static char * | handle_cli_show_config (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_udptl_set_debug (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static int | load_module (void) |
static int | reload_module (void) |
static int | removed_options_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static int | udptl_build_packet (struct ast_udptl *s, uint8_t *buf, unsigned int buflen, uint8_t *ifp, unsigned int ifp_len) |
static void | udptl_config_destructor (void *obj) |
static int | udptl_debug_test_addr (const struct ast_sockaddr *addr) |
static int | udptl_pre_apply_config (void) |
static int | udptl_rx_packet (struct ast_udptl *s, uint8_t *buf, unsigned int len) |
static void * | udptl_snapshot_alloc (void) |
static int | udptlread (int *id, int fd, short events, void *cbdata) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "UDPTL" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "da6642af068ee5e6490c5b1d2cc1d238" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload_module, .load_pri = AST_MODPRI_CORE, .requires = "extconfig", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_cli_entry | cli_udptl [] |
static struct aco_type | general_option |
static struct aco_type * | general_options [] = ACO_TYPES(&general_option) |
static struct aco_file | udptl_conf |
static int | udptldebug |
static struct ast_sockaddr | udptldebugaddr |
UDPTL support for T.38 faxing.
Definition in file udptl.c.
unsigned int ast_udptl_get_far_max_ifp | ( | struct ast_udptl * | udptl | ) |
retrieves far max ifp
0 | if 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().
unsigned int ast_udptl_get_local_max_datagram | ( | struct ast_udptl * | udptl | ) |
retrieves local_max_datagram.
0 | if no value is present |
Definition at line 982 of file udptl.c.
References ast_udptl::local_max_datagram.
Referenced by create_outgoing_sdp_stream().
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.
Definition at line 1110 of file udptl.c.
References ast_vasprintf.
Referenced by t38_change_state().
|
static |
|
static |
|
static |