Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Generic FAX Resource for FAX technology resource modules. More...
#include "asterisk.h"
#include "asterisk/io.h"
#include "asterisk/file.h"
#include "asterisk/logger.h"
#include "asterisk/module.h"
#include "asterisk/app.h"
#include "asterisk/lock.h"
#include "asterisk/options.h"
#include "asterisk/strings.h"
#include "asterisk/cli.h"
#include "asterisk/utils.h"
#include "asterisk/config.h"
#include "asterisk/astobj2.h"
#include "asterisk/res_fax.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/dsp.h"
#include "asterisk/indications.h"
#include "asterisk/ast_version.h"
#include "asterisk/translate.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/smoother.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | ast_fax_debug_info |
struct | debug_info_history |
struct | fax_detect |
used for fax detect framehook More... | |
struct | fax_gateway |
used for gateway framehook More... | |
struct | fax_module |
registered FAX technology modules are put into this list More... | |
struct | fax_options |
struct | faxmodules |
Macros | |
#define | FAX_DETECT_MODE_BOTH (FAX_DETECT_MODE_CNG | FAX_DETECT_MODE_T38) |
#define | FAX_DETECT_MODE_CNG (1 << 0) |
FAX Detect flags. More... | |
#define | FAX_DETECT_MODE_T38 (1 << 1) |
#define | FAX_GATEWAY_TIMEOUT RES_FAX_TIMEOUT |
#define | FAX_MAXBUCKETS 10 |
maximum buckets for res_fax ao2 containers More... | |
#define | GENERIC_FAX_EXEC_ERROR(fax, chan, errorstr, reason) |
#define | GENERIC_FAX_EXEC_ERROR_QUIET(fax, chan, errorstr, reason) |
#define | GENERIC_FAX_EXEC_SET_VARS(fax, chan, errorstr, reason) |
#define | RES_FAX_MAXRATE 14400 |
#define | RES_FAX_MINRATE 4800 |
#define | RES_FAX_MODEM (AST_FAX_MODEM_V17 | AST_FAX_MODEM_V27TER | AST_FAX_MODEM_V29) |
#define | RES_FAX_STATUSEVENTS 0 |
#define | RES_FAX_T38TIMEOUT 5000 |
#define | RES_FAX_TIMEOUT 10000 |
Enumerations | |
enum | { OPT_CALLEDMODE = (1 << 0) , OPT_CALLERMODE = (1 << 1) , OPT_DEBUG = (1 << 2) , OPT_STATUS = (1 << 3) , OPT_ALLOWAUDIO = (1 << 5) , OPT_REQUEST_T38 = (1 << 6) , OPT_FORCE_AUDIO = (1 << 7) } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | acf_faxopt_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
FAXOPT read function returns the contents of a FAX option. More... | |
static int | acf_faxopt_write (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
FAXOPT write function modifies the contents of a FAX option. More... | |
static char * | ast_fax_caps_to_str (enum ast_fax_capabilities caps, char *buf, size_t bufsize) |
void | ast_fax_log (int level, const char *file, const int line, const char *function, const char *msg) |
Log message at FAX or recommended level. More... | |
unsigned int | ast_fax_maxrate (void) |
get the maxiumum supported fax rate More... | |
unsigned int | ast_fax_minrate (void) |
get the minimum supported fax rate More... | |
static int | ast_fax_modem_to_str (enum ast_fax_modems bits, char *tbuf, size_t bufsize) |
const char * | ast_fax_session_operation_str (struct ast_fax_session *s) |
get string representation of a FAX session's operation More... | |
const char * | ast_fax_state_to_str (enum ast_fax_state state) |
convert a ast_fax_state to a string More... | |
int | ast_fax_tech_register (struct ast_fax_tech *tech) |
register a FAX technology module More... | |
void | ast_fax_tech_unregister (struct ast_fax_tech *tech) |
unregister a FAX technology module More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | check_modem_rate (enum ast_fax_modems modems, unsigned int rate) |
static char * | cli_fax_set_debug (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
enable FAX debugging More... | |
static char * | cli_fax_show_capabilities (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
display registered FAX capabilities More... | |
static char * | cli_fax_show_session (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
display details of a specified fax session More... | |
static char * | cli_fax_show_sessions (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
display fax sessions More... | |
static char * | cli_fax_show_settings (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
display global defaults and settings More... | |
static char * | cli_fax_show_stats (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
display fax stats More... | |
static char * | cli_fax_show_version (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static void | debug_check_frame_for_silence (struct ast_fax_session *s, unsigned int c2s, struct ast_frame *frame) |
static void | destroy_callback (void *data) |
static void | destroy_faxdetect (void *data) |
destroy a FAX detect structure More... | |
static void | destroy_gateway (void *data) |
destroy a FAX gateway session structure More... | |
static void | destroy_session (void *session) |
destroy a FAX session structure More... | |
static void | destroy_session_details (void *details) |
destroy a FAX session details structure More... | |
static void | destroy_v21_sessions (struct fax_gateway *gateway) |
destroy the v21 detection parts of a fax gateway session More... | |
static int | disable_t38 (struct ast_channel *chan) |
static int | fax_detect_attach (struct ast_channel *chan, int timeout, int flags) |
Attach a faxdetect framehook object to a channel. More... | |
static struct ast_frame * | fax_detect_framehook (struct ast_channel *chan, struct ast_frame *f, enum ast_framehook_event event, void *data) |
Fax Detect Framehook. More... | |
static void | fax_detect_framehook_destroy (void *data) |
Deref the faxdetect data structure when the faxdetect framehook is detached. More... | |
static struct fax_detect * | fax_detect_new (struct ast_channel *chan, int timeout, int flags) |
Create a new fax detect object. More... | |
static int | fax_gateway_attach (struct ast_channel *chan, struct ast_fax_session_details *details) |
Attach a gateway framehook object to a channel. More... | |
static struct ast_frame * | fax_gateway_detect_t38 (struct fax_gateway *gateway, struct ast_channel *chan, struct ast_channel *peer, struct ast_channel *active, struct ast_frame *f) |
T38 Gateway Negotiate t38 parameters. More... | |
static struct ast_frame * | fax_gateway_detect_v21 (struct fax_gateway *gateway, struct ast_channel *chan, struct ast_channel *peer, struct ast_channel *active, struct ast_frame *f) |
static struct ast_frame * | fax_gateway_framehook (struct ast_channel *chan, struct ast_frame *f, enum ast_framehook_event event, void *data) |
T.30<->T.38 gateway framehook. More... | |
static void | fax_gateway_framehook_destroy (void *data) |
Destroy the gateway data structure when the framehook is detached. More... | |
static void | fax_gateway_indicate_t38 (struct ast_channel *chan, struct ast_channel *active, struct ast_control_t38_parameters *control_params) |
static struct fax_gateway * | fax_gateway_new (struct ast_channel *chan, struct ast_fax_session_details *details) |
Create a new fax gateway object. More... | |
static struct ast_frame * | fax_gateway_request_t38 (struct fax_gateway *gateway, struct ast_channel *chan) |
static int | fax_gateway_start (struct fax_gateway *gateway, struct ast_fax_session_details *details, struct ast_channel *chan) |
Create a fax session and start T.30<->T.38 gateway mode. More... | |
static unsigned int | fax_rate_str_to_int (const char *ratestr) |
convert a rate string to a rate More... | |
static struct ast_fax_session * | fax_session_new (struct ast_fax_session_details *details, struct ast_channel *chan, struct ast_fax_session *reserved, struct ast_fax_tech_token *token) |
create a FAX session More... | |
static void | fax_session_release (struct ast_fax_session *s, struct ast_fax_tech_token *token) |
Release a session token. More... | |
static struct ast_fax_session * | fax_session_reserve (struct ast_fax_session_details *details, struct ast_fax_tech_token **token) |
Reserve a fax session. More... | |
static char * | fax_session_tab_complete (struct ast_cli_args *a) |
fax session tab completion More... | |
static const char * | fax_session_type (struct ast_fax_session *s) |
static struct ast_fax_session * | fax_v21_session_new (struct ast_channel *chan) |
static struct ast_fax_session_details * | find_details (struct ast_channel *chan) |
returns a reference counted pointer to a fax datastore, if it exists More... | |
static struct ast_fax_session_details * | find_or_create_details (struct ast_channel *chan) |
returns a reference counted details structure from the channel's fax datastore. If the datastore does not exist it will be created More... | |
static void | fixup_callback (void *data, struct ast_channel *old_chan, struct ast_channel *new_chan) |
Copies fax detection and gateway framehooks during masquerades. More... | |
static struct ast_json * | generate_filenames_json (struct ast_fax_session_details *details) |
static char * | generate_filenames_string (struct ast_fax_session_details *details, char *prefix, char *separator) |
Generate a string of filenames using the given prefix and separator. More... | |
static int | generic_fax_exec (struct ast_channel *chan, struct ast_fax_session_details *details, struct ast_fax_session *reserved, struct ast_fax_tech_token *token) |
this is the generic FAX session handling function More... | |
static void | get_general_options (struct fax_options *options) |
static int | load_module (void) |
Load the module. More... | |
static int | manager_fax_session (struct mansession *s, const struct message *m) |
static int | manager_fax_sessions (struct mansession *s, const struct message *m) |
static int | manager_fax_sessions_entry (struct mansession *s, struct ast_fax_session *session, const char *id_text) |
static int | manager_fax_stats (struct mansession *s, const struct message *m) |
static int | receivefax_exec (struct ast_channel *chan, const char *data) |
initiate a receive FAX session More... | |
static int | receivefax_t38_init (struct ast_channel *chan, struct ast_fax_session_details *details) |
static int | reload_module (void) |
static int | report_fax_status (struct ast_channel *chan, struct ast_fax_session_details *details, const char *status) |
send a FAX status manager event More... | |
static int | report_receive_fax_status (struct ast_channel *chan, const char *filename) |
Report on the final state of a receive fax operation. More... | |
static int | report_send_fax_status (struct ast_channel *chan, struct ast_fax_session_details *details) |
Report on the status of a completed fax send attempt. More... | |
static int | sendfax_exec (struct ast_channel *chan, const char *data) |
initiate a send FAX session More... | |
static int | sendfax_t38_init (struct ast_channel *chan, struct ast_fax_session_details *details) |
static int | session_cmp_cb (void *obj, void *arg, int flags) |
compare callback for ao2 More... | |
static struct ast_fax_session_details * | session_details_new (void) |
create a FAX session details structure More... | |
static int | session_hash_cb (const void *obj, const int flags) |
hash callback for ao2 More... | |
static void | set_channel_variables (struct ast_channel *chan, struct ast_fax_session_details *details) |
Set fax related channel variables. More... | |
static int | set_config (int reload) |
configure res_fax More... | |
static int | set_fax_t38_caps (struct ast_channel *chan, struct ast_fax_session_details *details) |
static void | set_general_options (const struct fax_options *options) |
static int | set_t38timeout (const char *value, unsigned int *t38timeout) |
static void | t38_parameters_ast_to_fax (struct ast_fax_t38_parameters *dst, const struct ast_control_t38_parameters *src) |
static void | t38_parameters_fax_to_ast (struct ast_control_t38_parameters *dst, const struct ast_fax_t38_parameters *src) |
static int | unload_module (void) |
unload res_fax More... | |
static int | update_modem_bits (enum ast_fax_modems *bits, const char *value) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "Generic FAX Applications" , .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 = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload_module, .load_pri = AST_MODPRI_APP_DEPEND, } |
static struct ast_custom_function | acf_faxopt |
FAXOPT dialplan function. More... | |
static const char | app_receivefax [] = "ReceiveFAX" |
static const char | app_sendfax [] = "SendFAX" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const char * | config = "res_fax.conf" |
static const struct fax_options | default_options |
static struct ast_cli_entry | fax_cli [] |
static const struct ast_datastore_info | fax_datastore |
static const struct ast_app_option | fax_exec_options [128] = { [ 'a' ] = { .flag = OPT_CALLEDMODE }, [ 'c' ] = { .flag = OPT_CALLERMODE }, [ 'd' ] = { .flag = OPT_DEBUG }, [ 'f' ] = { .flag = OPT_ALLOWAUDIO }, [ 'F' ] = { .flag = OPT_FORCE_AUDIO }, [ 's' ] = { .flag = OPT_STATUS }, [ 'z' ] = { .flag = OPT_REQUEST_T38 }, } |
static int | fax_logger_level = -1 |
static struct faxmodules | faxmodules = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
struct { | |
int active_sessions | |
struct ao2_container * container | |
int fax_complete | |
int fax_failures | |
int fax_rx_attempts | |
int fax_tx_attempts | |
int nextsessionname | |
int reserved_sessions | |
} | faxregistry |
The faxregistry is used to manage information and statistics for all FAX sessions. More... | |
static struct fax_options | general_options |
static int | global_fax_debug = 0 |
static ast_rwlock_t | options_lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } |
static struct ast_control_t38_parameters | our_t38_parameters |
Generic FAX Resource for FAX technology resource modules.
A generic FAX resource module that provides SendFAX and ReceiveFAX applications. This module requires FAX technology modules, like res_fax_spandsp, to register with it so it can use the technology modules to perform the actual FAX transmissions.
Definition in file res_fax.c.
#define FAX_DETECT_MODE_BOTH (FAX_DETECT_MODE_CNG | FAX_DETECT_MODE_T38) |
#define FAX_GATEWAY_TIMEOUT RES_FAX_TIMEOUT |
#define FAX_MAXBUCKETS 10 |
#define GENERIC_FAX_EXEC_ERROR | ( | fax, | |
chan, | |||
errorstr, | |||
reason | |||
) |
#define GENERIC_FAX_EXEC_ERROR_QUIET | ( | fax, | |
chan, | |||
errorstr, | |||
reason | |||
) |
#define GENERIC_FAX_EXEC_SET_VARS | ( | fax, | |
chan, | |||
errorstr, | |||
reason | |||
) |
#define RES_FAX_MODEM (AST_FAX_MODEM_V17 | AST_FAX_MODEM_V27TER | AST_FAX_MODEM_V29) |
anonymous enum |
Enumerator | |
---|---|
OPT_CALLEDMODE | |
OPT_CALLERMODE | |
OPT_DEBUG | |
OPT_STATUS | |
OPT_ALLOWAUDIO | |
OPT_REQUEST_T38 | |
OPT_FORCE_AUDIO |
Definition at line 556 of file res_fax.c.
|
static |
FAXOPT read function returns the contents of a FAX option.
Definition at line 4525 of file res_fax.c.
References ao2_ref, ast_channel_name(), ast_copy_string(), ast_fax_modem_to_str(), ast_free, AST_LIST_EMPTY, AST_LIST_FIRST, ast_log, buf, ast_fax_session_details::documents, ast_fax_session_details::ecm, ast_fax_session_details::error, ast_fax_session_details::faxdetect_id, find_details(), ast_fax_session_details::gateway_id, generate_filenames_string(), ast_fax_session_details::headerinfo, ast_fax_session_details::id, len(), ast_fax_session_details::localstationid, LOG_ERROR, LOG_WARNING, ast_fax_session_details::maxrate, ast_fax_session_details::minrate, ast_fax_session_details::modems, ast_fax_session_details::negotiate_both, ast_fax_session_details::option, ast_fax_session_details::pages_transferred, ast_fax_session_details::remotestationid, ast_fax_session_details::resolution, ast_fax_session_details::result, ast_fax_session_details::resultstr, ast_fax_session_details::t38timeout, and ast_fax_session_details::transfer_rate.
|
static |
FAXOPT write function modifies the contents of a FAX option.
Definition at line 4600 of file res_fax.c.
References ao2_ref, ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_debug, ast_false(), ast_fax_maxrate(), ast_fax_minrate(), AST_FAX_OPTFLAG_FALSE, AST_FAX_OPTFLAG_TRUE, ast_framehook_detach(), ast_log, ast_skip_blanks(), ast_string_field_set, ast_true(), ast_fax_session_details::ecm, fax_detect_attach(), FAX_DETECT_MODE_BOTH, FAX_DETECT_MODE_CNG, FAX_DETECT_MODE_T38, fax_gateway_attach(), fax_rate_str_to_int(), ast_fax_session_details::faxdetect_id, fdtimeout, find_or_create_details(), ast_fax_session_details::gateway_id, ast_fax_session_details::gateway_timeout, ast_fax_session_details::headerinfo, ast_fax_session_details::localstationid, LOG_ERROR, LOG_WARNING, ast_fax_session_details::maxrate, ast_fax_session_details::minrate, ast_fax_session_details::modems, ast_fax_session_details::negotiate_both, ast_fax_session_details::option, set_t38timeout(), ast_fax_session_details::t38timeout, update_modem_bits(), and value.
|
static |
Definition at line 845 of file res_fax.c.
References ast_build_string(), AST_FAX_TECH_AUDIO, AST_FAX_TECH_GATEWAY, AST_FAX_TECH_MULTI_DOC, AST_FAX_TECH_RECEIVE, AST_FAX_TECH_SEND, AST_FAX_TECH_T38, AST_FAX_TECH_V21_DETECT, buf, first, and out.
Referenced by fax_session_new(), and fax_session_reserve().
void ast_fax_log | ( | int | level, |
const char * | file, | ||
const int | line, | ||
const char * | function, | ||
const char * | msg | ||
) |
Log message at FAX or recommended level.
The first four parameters can be represented with Asterisk's LOG_* levels. In other words, this function may be called like
ast_fax_log(LOG_DEBUG, msg);
Definition at line 1035 of file res_fax.c.
References ast_log, ast_log_dynamic_level, fax_logger_level, and make_ari_stubs::file.
Referenced by spandsp_log().
unsigned int ast_fax_maxrate | ( | void | ) |
get the maxiumum supported fax rate
Definition at line 795 of file res_fax.c.
References get_general_options(), and options.
Referenced by acf_faxopt_write().
unsigned int ast_fax_minrate | ( | void | ) |
get the minimum supported fax rate
Definition at line 803 of file res_fax.c.
References get_general_options(), and options.
Referenced by acf_faxopt_write().
|
static |
Definition at line 904 of file res_fax.c.
References AST_FAX_MODEM_V17, AST_FAX_MODEM_V27TER, AST_FAX_MODEM_V29, and AST_FAX_MODEM_V34.
Referenced by acf_faxopt_read(), cli_fax_show_settings(), receivefax_exec(), sendfax_exec(), and set_config().
const char * ast_fax_session_operation_str | ( | struct ast_fax_session * | s | ) |
get string representation of a FAX session's operation
Definition at line 4253 of file res_fax.c.
References AST_FAX_TECH_GATEWAY, AST_FAX_TECH_RECEIVE, AST_FAX_TECH_SEND, AST_FAX_TECH_V21_DETECT, ast_fax_session_details::caps, and ast_fax_session::details.
Referenced by cli_fax_show_sessions(), manager_fax_sessions_entry(), and spandsp_manager_fax_session().
const char * ast_fax_state_to_str | ( | enum ast_fax_state | state | ) |
convert a ast_fax_state to a string
convert an ast_fax_state to a string
Definition at line 1012 of file res_fax.c.
References AST_FAX_STATE_ACTIVE, AST_FAX_STATE_COMPLETE, AST_FAX_STATE_INACTIVE, AST_FAX_STATE_INITIALIZED, AST_FAX_STATE_OPEN, AST_FAX_STATE_RESERVED, AST_FAX_STATE_UNINITIALIZED, ast_log, and LOG_WARNING.
Referenced by cli_fax_show_sessions(), manager_fax_sessions_entry(), spandsp_fax_cli_show_session(), spandsp_fax_write(), and spandsp_manager_fax_session().
int ast_fax_tech_register | ( | struct ast_fax_tech * | tech | ) |
register a FAX technology module
register a fax technology
Definition at line 973 of file res_fax.c.
References ast_calloc, AST_RWLIST_INSERT_TAIL, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_verb, ast_fax_tech::description, fax_module::tech, and ast_fax_tech::type.
Referenced by load_module().
void ast_fax_tech_unregister | ( | struct ast_fax_tech * | tech | ) |
unregister a FAX technology module
unregister a fax technology
Definition at line 991 of file res_fax.c.
References ast_free, AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_verb, fax_module::tech, and ast_fax_tech::type.
Referenced by unload_module().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
|
static |
Definition at line 937 of file res_fax.c.
References AST_FAX_MODEM_V17, AST_FAX_MODEM_V27TER, AST_FAX_MODEM_V29, AST_FAX_MODEM_V34, and fax_options::modems.
Referenced by receivefax_exec(), sendfax_exec(), and set_config().
|
static |
enable FAX debugging
Definition at line 4002 of file res_fax.c.
References a, ast_cli_entry::args, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, global_fax_debug, NULL, and ast_cli_entry::usage.
|
static |
display registered FAX capabilities
Definition at line 4037 of file res_fax.c.
References a, ast_cli(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, ast_fax_tech::cli_show_capabilities, CLI_SUCCESS, ast_cli_entry::command, ast_fax_tech::description, NULL, fax_module::tech, ast_fax_tech::type, and ast_cli_entry::usage.
|
static |
display details of a specified fax session
Definition at line 4106 of file res_fax.c.
References a, ao2_find, ao2_ref, ast_cli(), ast_log, ast_fax_session::channame, CLI_GENERATE, CLI_INIT, ast_fax_tech::cli_show_session, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, fax_session_tab_complete(), faxregistry, LOG_ERROR, NULL, OBJ_POINTER, RESULT_SUCCESS, ast_fax_session::tech, tmp(), and ast_cli_entry::usage.
|
static |
display fax sessions
Definition at line 4272 of file res_fax.c.
References a, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_cli(), ast_fax_session_operation_str(), ast_fax_state_to_str(), ast_free, ast_fax_session::channame, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_fax_session::details, fax_session_type(), faxregistry, generate_filenames_string(), ast_fax_session::id, NULL, S_OR, session_count, ast_fax_session::state, ast_fax_session::tech, ast_fax_tech::type, and ast_cli_entry::usage.
|
static |
display global defaults and settings
Definition at line 4067 of file res_fax.c.
References a, ast_cli(), ast_fax_modem_to_str(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, ast_fax_tech::cli_show_settings, CLI_SUCCESS, ast_cli_entry::command, ast_fax_tech::description, get_general_options(), fax_options::modems, NULL, options, fax_module::tech, ast_fax_tech::type, and ast_cli_entry::usage.
|
static |
display fax stats
Definition at line 4180 of file res_fax.c.
References a, ast_cli(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, ast_fax_tech::cli_show_stats, CLI_SUCCESS, ast_cli_entry::command, faxregistry, NULL, fax_module::tech, and ast_cli_entry::usage.
|
static |
Definition at line 3970 of file res_fax.c.
References a, ast_cli(), ast_get_version(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_fax_tech::description, NULL, fax_module::tech, ast_cli_entry::usage, and ast_fax_tech::version.
|
static |
Definition at line 576 of file res_fax.c.
References ast_dsp_reset(), ast_dsp_silence(), ast_tvnow(), ast_tvsub(), ast_verb, ast_fax_debug_info::base_tv, ast_fax_session::channame, debug_info_history::consec_frames, debug_info_history::consec_ms, ast_fax_session::debug_info, ast_fax_debug_info::dsp, ast_fax_session::id, ast_fax_debug_info::s2c, ast_frame::samples, and debug_info_history::silence.
Referenced by generic_fax_exec().
|
static |
|
static |
destroy a FAX detect structure
Definition at line 3675 of file res_fax.c.
References ao2_cleanup, ast_dsp_free(), fax_detect::details, fax_detect::dsp, NULL, and fax_detect::orig_format.
Referenced by fax_detect_new().
|
static |
destroy a FAX gateway session structure
Definition at line 2838 of file res_fax.c.
References ao2_cleanup, ao2_ref, ao2_unlink, fax_gateway::chan_read_format, fax_gateway::chan_write_format, destroy_v21_sessions(), fax_session_release(), faxregistry, NULL, fax_gateway::peer_read_format, fax_gateway::peer_write_format, fax_gateway::s, and fax_gateway::token.
Referenced by fax_gateway_new().
|
static |
destroy a FAX session structure
Definition at line 1095 of file res_fax.c.
References ao2_ref, ast_atomic_fetchadd_int(), ast_dsp_free(), AST_FAX_STATE_INACTIVE, AST_FAX_TECH_GATEWAY, ast_free, ast_module_unref, ast_smoother_free(), ast_fax_session_details::caps, ast_fax_session::chan_uniqueid, ast_fax_session::channame, ast_fax_session::debug_info, ast_fax_tech::destroy_session, ast_fax_session::details, ast_fax_debug_info::dsp, fax_session_release(), faxregistry, ast_fax_tech::module, NULL, session, ast_fax_session::smoother, ast_fax_session::state, ast_fax_session::tech, and ast_fax_session::tech_pvt.
Referenced by fax_session_new(), and fax_session_reserve().
|
static |
destroy a FAX session details structure
Definition at line 683 of file res_fax.c.
References ast_free, AST_LIST_REMOVE_HEAD, ast_string_field_free_memory, d, and ast_fax_document::next.
Referenced by session_details_new().
|
static |
destroy the v21 detection parts of a fax gateway session
Definition at line 2820 of file res_fax.c.
References ao2_ref, ao2_unlink, fax_gateway::chan_v21_session, faxregistry, NULL, and fax_gateway::peer_v21_session.
Referenced by destroy_gateway(), fax_gateway_detect_v21(), and fax_gateway_start().
|
static |
Definition at line 1526 of file res_fax.c.
References ast_channel_name(), AST_CONTROL_T38_PARAMETERS, ast_debug, AST_FRAME_CONTROL, ast_frfree, ast_indicate_data(), ast_log, ast_read(), ast_remaining_ms(), AST_T38_REFUSED, AST_T38_REQUEST_TERMINATE, AST_T38_TERMINATED, ast_tvnow(), ast_waitfor(), ast_frame::data, ast_frame::datalen, ast_frame::frametype, ast_frame_subclass::integer, LOG_ERROR, LOG_WARNING, NULL, ast_frame::ptr, ast_control_t38_parameters::request_response, and ast_frame::subclass.
Referenced by receivefax_exec(), and sendfax_exec().
|
static |
Attach a faxdetect framehook object to a channel.
chan | the channel to attach to |
timeout | in ms to remove framehook in this time if not zero |
flags | required options |
-1 | error |
Definition at line 3888 of file res_fax.c.
References ao2_ref, ast_channel_lock, ast_channel_unlock, ast_framehook_attach(), AST_FRAMEHOOK_INTERFACE_VERSION, ast_log, ast_framehook_interface::data, fax_detect::details, fax_detect_framehook(), fax_detect_framehook_destroy(), fax_detect_new(), ast_fax_session_details::faxdetect_flags, ast_fax_session_details::faxdetect_id, ast_fax_session_details::faxdetect_timeout, find_or_create_details(), LOG_ERROR, and ast_framehook_interface::version.
Referenced by acf_faxopt_write(), and fixup_callback().
|
static |
Fax Detect Framehook.
Listen for fax tones in audio path and enable jumping to a extension when detected.
chan | channel |
f | frame to handle may be NULL |
event | framehook event |
data | framehook data (struct fax_detect *) |
Definition at line 3744 of file res_fax.c.
References ao2_cleanup, ao2_ref, ao2_replace, ast_async_goto(), ast_channel_bridge_peer(), ast_channel_caller(), ast_channel_context(), ast_channel_exten(), ast_channel_lock, ast_channel_make_compatible(), ast_channel_name(), ast_channel_readformat(), ast_channel_unlock, AST_CONTROL_T38_PARAMETERS, ast_debug, ast_dsp_process(), ast_exists_extension(), ast_format_alaw, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_slin, ast_format_ulaw, AST_FRAME_CONTROL, AST_FRAME_DTMF, AST_FRAME_VOICE, ast_framehook_detach(), AST_FRAMEHOOK_EVENT_ATTACHED, AST_FRAMEHOOK_EVENT_DETACHED, AST_FRAMEHOOK_EVENT_READ, ast_frfree, ast_log, ast_null_frame, ast_set_read_format(), AST_T38_NEGOTIATED, AST_T38_REQUEST_NEGOTIATE, ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), ast_verb, ast_frame::data, ast_frame::datalen, fax_detect::details, fax_detect::dsp, FAX_DETECT_MODE_T38, ast_fax_session_details::faxdetect_id, ast_fax_session_details::faxdetect_timeout, fax_detect::flags, ast_frame_subclass::format, ast_frame::frametype, ast_frame_subclass::integer, LOG_NOTICE, NULL, fax_detect::orig_format, pbx_builtin_setvar_helper(), ast_frame::ptr, RAII_VAR, ast_control_t38_parameters::request_response, result, S_COR, ast_frame::subclass, and fax_detect::timeout_start.
Referenced by fax_detect_attach().
|
static |
Deref the faxdetect data structure when the faxdetect framehook is detached.
data | framehook data (faxdetect data) |
Definition at line 3726 of file res_fax.c.
References ao2_ref.
Referenced by fax_detect_attach().
|
static |
Create a new fax detect object.
chan | the channel attaching to |
timeout | in ms to remove framehook in this time if not zero |
flags | required options |
Definition at line 3693 of file res_fax.c.
References ao2_alloc, ao2_ref, ast_dsp_new(), ast_dsp_set_faxmode(), ast_dsp_set_features(), ast_tvnow(), destroy_faxdetect(), fax_detect::dsp, DSP_FAXMODE_DETECT_CNG, DSP_FAXMODE_DETECT_SQUELCH, DSP_FEATURE_FAX_DETECT, FAX_DETECT_MODE_CNG, fax_detect::flags, NULL, and fax_detect::timeout_start.
Referenced by fax_detect_attach().
|
static |
Attach a gateway framehook object to a channel.
chan | the channel to attach to |
details | fax session details |
-1 | error |
Definition at line 3625 of file res_fax.c.
References ao2_ref, ast_channel_lock, ast_channel_unlock, AST_FAX_OPTFLAG_TRUE, ast_framehook_attach(), AST_FRAMEHOOK_INTERFACE_VERSION, ast_string_field_set, ast_framehook_interface::data, ast_fax_session_details::debug, error(), fax_gateway_framehook(), fax_gateway_framehook_destroy(), fax_gateway_new(), fax_gateway::framehook, global_fax_debug, ast_fax_session_details::is_t38_negotiated, ast_fax_session_details::option, report_fax_status(), result, set_channel_variables(), and ast_framehook_interface::version.
Referenced by acf_faxopt_write(), and fixup_callback().
|
static |
T38 Gateway Negotiate t38 parameters.
gateway | gateway object |
chan | channel running the gateway |
peer | channel im bridged too |
active | channel the frame originated on |
f | the control frame to process |
Definition at line 3108 of file res_fax.c.
References ao2_ref, ast_channel_get_t38_state(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_debug, ast_framehook_detach(), ast_log, ast_null_frame, ast_string_field_set, AST_T38_NEGOTIATED, AST_T38_REFUSED, AST_T38_REQUEST_NEGOTIATE, AST_T38_REQUEST_TERMINATE, AST_T38_TERMINATED, ast_tvnow(), ast_frame::data, ast_frame::datalen, error(), fax_gateway_indicate_t38(), fax_gateway_start(), FAX_GATEWAY_TIMEOUT, find_details(), fax_gateway::framehook, ast_fax_session_details::gateway_id, ast_fax_session_details::gateway_timeout, ast_fax_session_details::is_t38_negotiated, LOG_ERROR, LOG_WARNING, ast_fax_session_details::our_t38_parameters, ast_frame::ptr, report_fax_status(), ast_control_t38_parameters::request_response, result, ast_fax_session_details::resultstr, set_channel_variables(), t38_parameters_ast_to_fax(), t38_parameters_fax_to_ast(), fax_gateway::t38_state, T38_STATE_NEGOTIATED, T38_STATE_NEGOTIATING, T38_STATE_REJECTED, T38_STATE_UNAVAILABLE, T38_STATE_UNKNOWN, ast_fax_session_details::their_t38_parameters, and fax_gateway::timeout_start.
Referenced by fax_gateway_framehook().
|
static |
Definition at line 3011 of file res_fax.c.
References ao2_ref, ast_channel_get_t38_state(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_debug, ast_log, ast_write(), ast_fax_session::chan, fax_gateway::chan_v21_session, destroy_v21_sessions(), ast_fax_session::details, fax_gateway::detected_v21, fax_gateway_request_t38(), find_or_create_details(), if(), LOG_WARNING, ast_fax_session_details::negotiate_both, ast_fax_session_details::option, fax_gateway::peer_v21_session, T38_STATE_UNKNOWN, ast_fax_session::tech, ast_fax_session_details::v21_detected, and ast_fax_tech::write.
Referenced by fax_gateway_framehook().
|
static |
T.30<->T.38 gateway framehook.
Intercept packets on bridged channels and determine if a T.38 gateway is required. If a gateway is required, start a gateway and handle T.38 negotiation if necessary.
chan | channel running the gateway |
f | frame to handle may be NULL |
event | framehook event |
data | framehook data (struct fax_gateway *) |
Definition at line 3382 of file res_fax.c.
References ao2_cleanup, ao2_ref, ao2_replace, ast_channel_bridge_peer(), ast_channel_get_t38_state(), ast_channel_lock, ast_channel_lock_both, ast_channel_make_compatible(), ast_channel_name(), ast_channel_readformat(), ast_channel_readtrans(), ast_channel_unlock, ast_channel_writeformat(), ast_check_hangup(), AST_CONTROL_T38_PARAMETERS, ast_debug, AST_FAX_FRFLAG_GATEWAY, ast_format_alaw, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_slin, ast_format_ulaw, AST_FRAME_CONTROL, AST_FRAME_MODEM, AST_FRAME_VOICE, ast_framehook_detach(), AST_FRAMEHOOK_EVENT_ATTACHED, AST_FRAMEHOOK_EVENT_DETACHED, AST_FRAMEHOOK_EVENT_READ, AST_FRAMEHOOK_EVENT_WRITE, ast_frfree, ast_frisolate, ast_log, AST_MODEM_T38, ast_null_frame, ast_set_read_format(), ast_set_write_format(), ast_string_field_build, ast_string_field_set, ast_test_flag, ast_translate(), ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), fax_gateway::bridged, fax_gateway::chan_read_format, fax_gateway::chan_write_format, ast_fax_session::details, fax_gateway::detected_v21, error(), ast_trans_pvt::f, fax_gateway_detect_t38(), fax_gateway_detect_v21(), fax_v21_session_new(), find_details(), ast_frame_subclass::format, fax_gateway::framehook, ast_frame::frametype, ast_frame_subclass::integer, LOG_ERROR, LOG_WARNING, NULL, fax_gateway::peer_read_format, fax_gateway::peer_v21_session, fax_gateway::peer_write_format, RAII_VAR, result, fax_gateway::s, ast_frame::samples, set_channel_variables(), ast_frame::subclass, fax_gateway::t38_state, T38_STATE_NEGOTIATED, T38_STATE_REJECTED, T38_STATE_UNAVAILABLE, ast_fax_session::tech, ast_fax_session::tech_pvt, fax_gateway::timeout_start, and ast_fax_tech::write.
Referenced by fax_gateway_attach().
|
static |
Destroy the gateway data structure when the framehook is detached.
data | framehook data (gateway data) |
Definition at line 3344 of file res_fax.c.
References ao2_ref, AST_FAX_STATE_ACTIVE, AST_FAX_STATE_COMPLETE, AST_FAX_STATE_INITIALIZED, AST_FAX_STATE_OPEN, ast_fax_tech::cancel_session, fax_gateway::s, ast_fax_session::state, and ast_fax_session::tech.
Referenced by fax_gateway_attach().
|
static |
Definition at line 3084 of file res_fax.c.
References ast_channel_lock, ast_channel_unlock, AST_CONTROL_T38_PARAMETERS, ast_indicate_data(), and ast_queue_control_data().
Referenced by fax_gateway_detect_t38().
|
static |
Create a new fax gateway object.
chan | the channel the gateway object will be attached to |
details | the fax session details |
Definition at line 2879 of file res_fax.c.
References ao2_alloc, ao2_ref, ast_channel_name(), AST_FAX_TECH_GATEWAY, ast_log, ast_fax_session_details::caps, fax_gateway::chan_v21_session, destroy_gateway(), fax_session_reserve(), fax_v21_session_new(), fax_gateway::framehook, ast_fax_session_details::gateway_timeout, LOG_ERROR, NULL, fax_gateway::s, and fax_gateway::token.
Referenced by fax_gateway_attach().
|
static |
Definition at line 2971 of file res_fax.c.
References ao2_ref, ast_channel_name(), AST_CONTROL_T38_PARAMETERS, ast_debug, AST_FRAME_CONTROL, ast_framehook_detach(), ast_frisolate, ast_log, AST_T38_REQUEST_NEGOTIATE, ast_tvnow(), FAX_GATEWAY_TIMEOUT, find_details(), fax_gateway::framehook, ast_fax_session_details::gateway_timeout, ast_frame_subclass::integer, ast_fax_session_details::is_t38_negotiated, LOG_ERROR, NULL, ast_fax_session_details::our_t38_parameters, ast_control_t38_parameters::request_response, ast_frame::src, ast_frame::subclass, t38_parameters_fax_to_ast(), fax_gateway::t38_state, T38_STATE_NEGOTIATING, and fax_gateway::timeout_start.
Referenced by fax_gateway_detect_v21().
|
static |
Create a fax session and start T.30<->T.38 gateway mode.
gateway | a fax gateway object |
details | fax session details |
chan | active channel |
Definition at line 2916 of file res_fax.c.
References ao2_ref, ast_channel_lock, ast_channel_unlock, AST_FAX_STATE_INACTIVE, AST_FAX_STATE_RESERVED, ast_log, ast_string_field_set, ast_fax_session::chan, destroy_v21_sessions(), ast_fax_session::details, error(), fax_session_new(), ast_fax_session_details::is_t38_negotiated, LOG_ERROR, NULL, report_fax_status(), result, fax_gateway::s, set_channel_variables(), ast_fax_tech::start_session, ast_fax_session::state, ast_fax_session::tech, fax_gateway::timeout_start, and fax_gateway::token.
Referenced by fax_gateway_detect_t38().
|
static |
convert a rate string to a rate
Definition at line 1045 of file res_fax.c.
References ast_log, LOG_ERROR, and LOG_WARNING.
Referenced by acf_faxopt_write(), and set_config().
|
static |
create a FAX session
details | details for the session |
chan | the channel the session will run on |
reserved | a reserved session to base this session on (can be NULL) |
token | the token for a reserved session (can be NULL) |
Create a new fax session based on the given details structure.
Definition at line 1214 of file res_fax.c.
References ao2_alloc, ao2_link, ao2_ref, ao2_unlink, ast_atomic_fetchadd_int(), ast_calloc, ast_channel_name(), ast_channel_uniqueid(), ast_debug, ast_dsp_new(), ast_dsp_set_threshold(), ast_fax_caps_to_str(), AST_FAX_STATE_RESERVED, AST_FAX_STATE_UNINITIALIZED, AST_FAX_TECH_AUDIO, ast_free, ast_log, ast_module_running_ref, ast_module_unref, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_strdup, ast_fax_session_details::caps, ast_fax_tech::caps, ast_fax_session::chan, ast_fax_session::chan_uniqueid, ast_fax_session::channame, ast_fax_session_details::debug, ast_fax_session::debug_info, ast_fax_tech::description, destroy_session(), ast_fax_session::details, ast_fax_debug_info::dsp, fax_session_release(), faxregistry, ast_fax_session_details::id, ast_fax_session::id, LOG_ERROR, ast_fax_tech::module, ast_fax_tech::new_session, NULL, ast_fax_session_details::option, ast_fax_session::state, ast_fax_session::tech, fax_module::tech, and ast_fax_session::tech_pvt.
Referenced by fax_gateway_start(), fax_v21_session_new(), and generic_fax_exec().
|
static |
Release a session token.
s | a session returned from fax_session_reserve() |
token | a token generated from fax_session_reserve() |
This function releases the given token and marks the given session as no longer reserved. It is safe to call on a session that is not actually reserved and with a NULL token. This is so that sessions returned by technologies that do not support reserved sessions don't require extra logic to handle.
Definition at line 1082 of file res_fax.c.
References ast_atomic_fetchadd_int(), AST_FAX_STATE_INACTIVE, AST_FAX_STATE_RESERVED, faxregistry, ast_fax_tech::release_token, ast_fax_session::state, and ast_fax_session::tech.
Referenced by destroy_gateway(), destroy_session(), fax_session_new(), receivefax_exec(), and sendfax_exec().
|
static |
Reserve a fax session.
details | the fax session details |
token | a pointer to a place to store a token to be passed to fax_session_new() later |
This function reserves a fax session for use later. If the selected fax technology does not support reserving sessions a session will still be returned but token will not be set.
Definition at line 1145 of file res_fax.c.
References ao2_alloc, ao2_ref, ast_atomic_fetchadd_int(), ast_debug, ast_fax_caps_to_str(), AST_FAX_STATE_INACTIVE, AST_FAX_STATE_RESERVED, ast_log, ast_module_running_ref, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_fax_session_details::caps, ast_fax_tech::caps, ast_fax_tech::description, destroy_session(), ast_fax_session::details, faxregistry, LOG_ERROR, ast_fax_tech::module, NULL, ast_fax_tech::reserve_session, ast_fax_session::state, ast_fax_session::tech, and fax_module::tech.
Referenced by fax_gateway_new(), receivefax_exec(), and sendfax_exec().
|
static |
fax session tab completion
Definition at line 3942 of file res_fax.c.
References a, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_strdup, faxregistry, ast_fax_session::id, name, and NULL.
Referenced by cli_fax_show_session().
|
static |
Definition at line 4241 of file res_fax.c.
References AST_FAX_TECH_AUDIO, AST_FAX_TECH_T38, ast_fax_session_details::caps, and ast_fax_session::details.
Referenced by cli_fax_show_sessions(), and manager_fax_sessions_entry().
|
static |
Definition at line 2860 of file res_fax.c.
References ao2_ref, AST_FAX_TECH_V21_DETECT, ast_fax_session_details::caps, ast_fax_session::chan, fax_session_new(), NULL, and session_details_new().
Referenced by fax_gateway_framehook(), and fax_gateway_new().
|
static |
returns a reference counted pointer to a fax datastore, if it exists
Definition at line 661 of file res_fax.c.
References ao2_ref, ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_log, ast_datastore::data, fax_datastore, LOG_WARNING, and NULL.
Referenced by acf_faxopt_read(), fax_gateway_detect_t38(), fax_gateway_framehook(), fax_gateway_request_t38(), and find_or_create_details().
|
static |
returns a reference counted details structure from the channel's fax datastore. If the datastore does not exist it will be created
Definition at line 763 of file res_fax.c.
References ao2_ref, ast_channel_datastore_add(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_datastore_alloc, ast_log, ast_datastore::data, fax_datastore, find_details(), LOG_WARNING, NULL, ast_fax_session_details::our_t38_parameters, our_t38_parameters, session_details_new(), t38_parameters_ast_to_fax(), and ast_fax_session_details::their_t38_parameters.
Referenced by acf_faxopt_write(), fax_detect_attach(), fax_gateway_detect_v21(), fixup_callback(), receivefax_exec(), and sendfax_exec().
|
static |
Copies fax detection and gateway framehooks during masquerades.
Definition at line 635 of file res_fax.c.
References ao2_cleanup, ast_channel_datastore_find(), ast_channel_datastore_remove(), ast_datastore_free(), ast_framehook_detach(), fax_datastore, fax_detect_attach(), fax_gateway_attach(), ast_fax_session_details::faxdetect_flags, ast_fax_session_details::faxdetect_id, ast_fax_session_details::faxdetect_timeout, find_or_create_details(), ast_fax_session_details::gateway_id, ast_fax_session_details::is_t38_negotiated, and NULL.
|
static |
Definition at line 1329 of file res_fax.c.
References ast_json_array_append(), ast_json_array_create(), ast_json_ref(), ast_json_string_create(), ast_json_unref(), AST_LIST_EMPTY, AST_LIST_TRAVERSE, ast_fax_session_details::documents, ast_fax_document::filename, ast_fax_document::next, NULL, and RAII_VAR.
Referenced by report_fax_status(), and report_send_fax_status().
|
static |
Generate a string of filenames using the given prefix and separator.
details | the fax session details |
prefix | the prefix to each filename |
separator | the separator between filenames |
This function generates a string of filenames from the given details structure and using the given prefix and separator.
NULL | there was an error generating the string |
Definition at line 1369 of file res_fax.c.
References ast_build_string(), AST_LIST_EMPTY, AST_LIST_FIRST, AST_LIST_TRAVERSE, ast_malloc, ast_strdup, c, ast_fax_session_details::documents, ast_fax_document::filename, first, ast_fax_document::next, NULL, and prefix.
Referenced by acf_faxopt_read(), cli_fax_show_sessions(), manager_fax_sessions_entry(), and sendfax_exec().
|
static |
this is the generic FAX session handling function
Definition at line 1589 of file res_fax.c.
References ao2_bump, ao2_cleanup, ao2_ref, ao2_unlink, ast_atomic_fetchadd_int(), ast_channel_get_t38_state(), ast_channel_lock, ast_channel_name(), ast_channel_readformat(), ast_channel_unlock, ast_channel_writeformat(), AST_CONTROL_T38_PARAMETERS, ast_debug, AST_FAX_TECH_AUDIO, AST_FAX_TECH_T38, ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_slin, AST_FRAME_CONTROL, AST_FRAME_MODEM, AST_FRAME_VOICE, ast_frfree, ast_indicate_data(), ast_log, AST_MODEM_T38, ast_read(), ast_remaining_ms(), ast_set_read_format(), ast_set_write_format(), ast_smoother_feed, ast_smoother_free(), ast_smoother_new(), ast_smoother_read(), ast_string_field_set, ast_strlen_zero(), AST_T38_NEGOTIATED, AST_T38_REFUSED, AST_T38_REQUEST_NEGOTIATE, ast_tvnow(), ast_verb, ast_waitfor_nandfds(), ast_write(), ast_fax_debug_info::base_tv, c, ast_fax_tech::cancel_session, ast_fax_session_details::caps, chancount, ast_frame::data, ast_frame::datalen, debug_check_frame_for_silence(), ast_fax_session::debug_info, errno, error(), fax_session_new(), faxregistry, ast_fax_session::fd, ast_frame_subclass::format, ast_fax_session::frames_received, ast_fax_session::frames_sent, ast_frame::frametype, ast_fax_tech::generate_silence, GENERIC_FAX_EXEC_ERROR, GENERIC_FAX_EXEC_SET_VARS, ast_fax_session_details::headerinfo, ast_fax_session::id, ast_frame_subclass::integer, ast_fax_session_details::is_t38_negotiated, ast_fax_session_details::localstationid, LOG_ERROR, LOG_WARNING, NULL, ast_fax_session_details::our_t38_parameters, pbx_builtin_getvar_helper(), ast_frame::ptr, RAII_VAR, ast_fax_tech::read, report_fax_status(), ast_control_t38_parameters::request_response, RES_FAX_TIMEOUT, result, ast_fax_session_details::result, set_channel_variables(), ast_fax_session::smoother, ast_fax_tech::start_session, ast_frame::subclass, ast_fax_tech::switch_to_t38, t38_parameters_ast_to_fax(), t38_parameters_fax_to_ast(), T38_STATE_NEGOTIATED, ast_fax_session::tech, ast_fax_session_details::their_t38_parameters, and ast_fax_tech::write.
Referenced by receivefax_exec(), and sendfax_exec().
|
static |
Definition at line 4396 of file res_fax.c.
References ast_rwlock_rdlock, ast_rwlock_unlock, general_options, options, and options_lock.
Referenced by ast_fax_maxrate(), ast_fax_minrate(), cli_fax_show_settings(), and session_details_new().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 4787 of file res_fax.c.
References acf_faxopt, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_ref, app_receivefax, app_sendfax, ARRAY_LEN, ast_cli_register_multiple, ast_custom_function_register, ast_log, ast_logger_register_level(), ast_manager_register_xml, ast_manager_unregister(), AST_MODULE_LOAD_DECLINE, ast_register_application_xml, ast_unregister_application(), config, EVENT_FLAG_CALL, EVENT_FLAG_REPORTING, fax_cli, fax_logger_level, FAX_MAXBUCKETS, faxregistry, LOG_ERROR, LOG_WARNING, manager_fax_session(), manager_fax_sessions(), manager_fax_stats(), NULL, receivefax_exec(), sendfax_exec(), session_cmp_cb(), session_hash_cb(), and set_config().
|
static |
Definition at line 4142 of file res_fax.c.
References ao2_find, ao2_ref, ast_strlen_zero(), astman_get_header(), astman_send_ack(), astman_send_error(), faxregistry, find_session(), OBJ_POINTER, and session.
Referenced by load_module().
|
static |
Definition at line 4348 of file res_fax.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_strlen_zero(), astman_append(), astman_get_header(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), faxregistry, manager_fax_sessions_entry(), session, and session_count.
Referenced by load_module().
|
static |
Definition at line 4316 of file res_fax.c.
References ao2_lock, ao2_unlock, ast_fax_session_operation_str(), ast_fax_state_to_str(), ast_free, ast_log, astman_append(), fax_session_type(), generate_filenames_string(), LOG_ERROR, S_OR, and session.
Referenced by manager_fax_sessions().
|
static |
Definition at line 4212 of file res_fax.c.
References ast_strlen_zero(), astman_append(), astman_get_header(), astman_send_ack(), and faxregistry.
Referenced by load_module().
|
static |
initiate a receive FAX session
Definition at line 2081 of file res_fax.c.
References ao2_cleanup, app_receivefax, args, ast_answer(), AST_APP_ARG, ast_app_parse_options(), ast_atomic_fetchadd_int(), ast_calloc, ast_channel_get_t38_state(), ast_channel_name(), ast_debug, AST_DECLARE_APP_ARGS, ast_fax_modem_to_str(), AST_FAX_OPTFLAG_TRUE, AST_FAX_TECH_AUDIO, AST_FAX_TECH_RECEIVE, AST_FAX_TECH_T38, AST_LIST_INSERT_TAIL, ast_log, AST_LOG_ERROR, AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_strdupa, ast_string_field_set, ast_strlen_zero(), ast_test_flag, ast_verb, check_modem_rate(), disable_t38(), error(), fax_exec_options, fax_session_release(), fax_session_reserve(), faxregistry, ast_fax_document::filename, find_or_create_details(), generic_fax_exec(), global_fax_debug, LOG_ERROR, LOG_WARNING, NULL, OPT_ALLOWAUDIO, OPT_CALLEDMODE, OPT_CALLERMODE, OPT_DEBUG, OPT_FORCE_AUDIO, OPT_STATUS, options, pbx_builtin_setvar_helper(), RAII_VAR, receivefax_t38_init(), report_receive_fax_status(), result, set_channel_variables(), set_fax_t38_caps(), T38_STATE_NEGOTIATED, T38_STATE_REJECTED, and T38_STATE_UNAVAILABLE.
Referenced by load_module().
|
static |
Definition at line 1855 of file res_fax.c.
References ast_fax_session_details::allow_audio, ast_channel_get_t38_state(), ast_channel_name(), AST_CONTROL_T38_PARAMETERS, ast_debug, AST_FAX_OPTFLAG_TRUE, AST_FAX_TECH_AUDIO, AST_FAX_TECH_T38, AST_FRAME_CONTROL, ast_frfree, ast_indicate_data(), ast_log, ast_playtones_start(), ast_playtones_stop(), ast_read(), ast_remaining_ms(), AST_T38_NEGOTIATED, AST_T38_REFUSED, AST_T38_REQUEST_NEGOTIATE, ast_tvnow(), ast_waitfor(), ast_fax_session_details::caps, ast_frame::data, ast_frame::datalen, ast_frame::frametype, ast_frame_subclass::integer, LOG_ERROR, LOG_WARNING, NULL, ast_fax_session_details::option, ast_fax_session_details::our_t38_parameters, ast_frame::ptr, report_fax_status(), ast_control_t38_parameters::request_response, ast_frame::subclass, t38_parameters_ast_to_fax(), t38_parameters_fax_to_ast(), T38_STATE_NEGOTIATED, T38_STATE_NEGOTIATING, ast_fax_session_details::t38timeout, and ast_fax_session_details::their_t38_parameters.
Referenced by receivefax_exec().
|
static |
Definition at line 4853 of file res_fax.c.
References set_config().
|
static |
send a FAX status manager event
Definition at line 1406 of file res_fax.c.
References ao2_cleanup, ast_channel_blob_create_from_cache(), ast_channel_fax_type(), ast_channel_topic(), ast_channel_uniqueid(), AST_FAX_TECH_GATEWAY, AST_FAX_TECH_RECEIVE, ast_json_pack(), ast_json_unref(), AST_JSON_UTF8_VALIDATE, ast_fax_session_details::caps, generate_filenames_json(), ast_fax_session_details::localstationid, lock, NULL, ast_fax_session_details::option, RAII_VAR, SCOPED_CHANNELLOCK, stasis_publish(), status, and ast_fax_session_details::statusevents.
Referenced by fax_gateway_attach(), fax_gateway_detect_t38(), fax_gateway_start(), generic_fax_exec(), receivefax_t38_init(), and sendfax_t38_init().
|
static |
Report on the final state of a receive fax operation.
Definition at line 2017 of file res_fax.c.
References ao2_cleanup, ast_channel_blob_create_from_cache(), ast_channel_fax_type(), ast_channel_topic(), ast_channel_uniqueid(), ast_json_array_append(), ast_json_array_create(), ast_json_pack(), ast_json_ref(), ast_json_string_create(), ast_json_unref(), AST_JSON_UTF8_VALIDATE, ast_strdupa, ast_strlen_zero(), lock, NULL, pbx_builtin_getvar_helper(), RAII_VAR, S_OR, SCOPED_CHANNELLOCK, and stasis_publish().
Referenced by receivefax_exec().
|
static |
Report on the status of a completed fax send attempt.
Definition at line 2526 of file res_fax.c.
References ao2_cleanup, ast_channel_blob_create_from_cache(), ast_channel_fax_type(), ast_channel_topic(), ast_channel_uniqueid(), ast_json_pack(), ast_json_unref(), AST_JSON_UTF8_VALIDATE, ast_strdupa, ast_strlen_zero(), generate_filenames_json(), lock, NULL, pbx_builtin_getvar_helper(), RAII_VAR, S_OR, SCOPED_CHANNELLOCK, and stasis_publish().
Referenced by sendfax_exec().
|
static |
initiate a send FAX session
Definition at line 2589 of file res_fax.c.
References ao2_cleanup, app_sendfax, args, ast_answer(), AST_APP_ARG, ast_app_parse_options(), ast_atomic_fetchadd_int(), ast_calloc, ast_channel_get_t38_state(), ast_channel_name(), ast_debug, AST_DECLARE_APP_ARGS, ast_fax_modem_to_str(), AST_FAX_OPTFLAG_TRUE, AST_FAX_TECH_AUDIO, AST_FAX_TECH_MULTI_DOC, AST_FAX_TECH_SEND, AST_FAX_TECH_T38, AST_LIST_INSERT_TAIL, AST_LIST_TRAVERSE, ast_log, AST_LOG_ERROR, AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_strdupa, ast_string_field_set, ast_strlen_zero(), ast_test_flag, ast_verb, c, check_modem_rate(), disable_t38(), error(), fax_exec_options, fax_session_release(), fax_session_reserve(), faxregistry, ast_fax_document::filename, find_or_create_details(), generate_filenames_string(), generic_fax_exec(), global_fax_debug, LOG_ERROR, LOG_WARNING, NULL, OPT_ALLOWAUDIO, OPT_CALLEDMODE, OPT_CALLERMODE, OPT_DEBUG, OPT_FORCE_AUDIO, OPT_REQUEST_T38, OPT_STATUS, options, pbx_builtin_setvar_helper(), RAII_VAR, report_send_fax_status(), result, sendfax_t38_init(), set_channel_variables(), set_fax_t38_caps(), strsep(), T38_STATE_NEGOTIATED, T38_STATE_REJECTED, and T38_STATE_UNAVAILABLE.
Referenced by load_module().
|
static |
Definition at line 2282 of file res_fax.c.
References ast_fax_session_details::allow_audio, ast_channel_get_t38_state(), ast_channel_name(), AST_CONTROL_T38_PARAMETERS, ast_debug, AST_FAX_OPTFLAG_FALSE, AST_FAX_OPTFLAG_TRUE, AST_FAX_TECH_AUDIO, AST_FAX_TECH_T38, AST_FRAME_CONTROL, ast_frfree, ast_indicate_data(), ast_log, ast_playtones_start(), ast_playtones_stop(), ast_read(), ast_remaining_ms(), AST_T38_NEGOTIATED, AST_T38_REFUSED, AST_T38_REQUEST_NEGOTIATE, ast_tvnow(), ast_waitfor(), ast_fax_session_details::caps, ast_frame::data, ast_frame::datalen, ast_frame::frametype, ast_frame_subclass::integer, LOG_ERROR, LOG_WARNING, NULL, ast_fax_session_details::option, ast_fax_session_details::our_t38_parameters, ast_frame::ptr, report_fax_status(), ast_control_t38_parameters::request_response, ast_fax_session_details::request_t38, ast_frame::subclass, t38_parameters_ast_to_fax(), t38_parameters_fax_to_ast(), T38_STATE_NEGOTIATED, T38_STATE_NEGOTIATING, and ast_fax_session_details::their_t38_parameters.
Referenced by sendfax_exec().
|
static |
compare callback for ao2
Definition at line 3934 of file res_fax.c.
References CMP_MATCH, CMP_STOP, and ast_fax_session::id.
Referenced by load_module().
|
static |
create a FAX session details structure
Definition at line 695 of file res_fax.c.
References ao2_alloc, ao2_ref, AST_FAX_OPTFLAG_FALSE, AST_LIST_HEAD_INIT_NOLOCK, ast_string_field_init, d, destroy_session_details(), get_general_options(), NULL, and options.
Referenced by fax_v21_session_new(), and find_or_create_details().
|
static |
hash callback for ao2
Definition at line 3926 of file res_fax.c.
References ast_fax_session::id.
Referenced by load_module().
|
static |
Set fax related channel variables.
Definition at line 1446 of file res_fax.c.
References AST_JSON_UTF8_VALIDATE, buf, ast_fax_session_details::error, ast_fax_session_details::is_t38_negotiated, ast_fax_session_details::localstationid, NULL, ast_fax_session_details::pages_transferred, pbx_builtin_setvar_helper(), ast_fax_session_details::remotestationid, ast_fax_session_details::resolution, ast_fax_session_details::result, ast_fax_session_details::resultstr, S_OR, and ast_fax_session_details::transfer_rate.
Referenced by fax_gateway_attach(), fax_gateway_detect_t38(), fax_gateway_framehook(), fax_gateway_start(), generic_fax_exec(), receivefax_exec(), and sendfax_exec().
|
static |
configure res_fax
Definition at line 4421 of file res_fax.c.
References ast_config_destroy(), ast_config_load2(), ast_debug, ast_fax_modem_to_str(), ast_log, ast_true(), ast_variable_browse(), check_modem_rate(), config, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, default_options, end, fax_rate_str_to_int(), LOG_ERROR, LOG_NOTICE, fax_options::modems, ast_variable::name, ast_variable::next, options, reload(), set_general_options(), set_t38timeout(), update_modem_bits(), and ast_variable::value.
Referenced by load_module(), and reload_module().
|
static |
Definition at line 1490 of file res_fax.c.
References ast_channel_get_t38_state(), ast_channel_name(), AST_CONTROL_T38_PARAMETERS, AST_FAX_TECH_AUDIO, AST_FAX_TECH_T38, ast_indicate_data(), ast_log, AST_T38_REQUEST_PARMS, ast_fax_session_details::caps, LOG_ERROR, ast_control_t38_parameters::request_response, T38_STATE_NEGOTIATED, T38_STATE_NEGOTIATING, T38_STATE_REJECTED, T38_STATE_UNAVAILABLE, and T38_STATE_UNKNOWN.
Referenced by receivefax_exec(), and sendfax_exec().
|
static |
Definition at line 4389 of file res_fax.c.
References ast_rwlock_unlock, ast_rwlock_wrlock, general_options, options, and options_lock.
Referenced by set_config().
|
static |
Definition at line 4403 of file res_fax.c.
References ast_log, LOG_ERROR, and value.
Referenced by acf_faxopt_write(), and set_config().
|
static |
Definition at line 739 of file res_fax.c.
References ast_control_t38_parameters::fill_bit_removal, ast_fax_t38_parameters::fill_bit_removal, ast_control_t38_parameters::max_ifp, ast_fax_t38_parameters::max_ifp, ast_control_t38_parameters::rate, ast_fax_t38_parameters::rate, ast_control_t38_parameters::rate_management, ast_fax_t38_parameters::rate_management, ast_control_t38_parameters::transcoding_jbig, ast_fax_t38_parameters::transcoding_jbig, ast_control_t38_parameters::transcoding_mmr, ast_fax_t38_parameters::transcoding_mmr, ast_control_t38_parameters::version, and ast_fax_t38_parameters::version.
Referenced by fax_gateway_detect_t38(), find_or_create_details(), generic_fax_exec(), receivefax_t38_init(), and sendfax_t38_init().
|
static |
Definition at line 750 of file res_fax.c.
References ast_control_t38_parameters::fill_bit_removal, ast_fax_t38_parameters::fill_bit_removal, ast_control_t38_parameters::max_ifp, ast_fax_t38_parameters::max_ifp, ast_control_t38_parameters::rate, ast_fax_t38_parameters::rate, ast_control_t38_parameters::rate_management, ast_fax_t38_parameters::rate_management, ast_control_t38_parameters::transcoding_jbig, ast_fax_t38_parameters::transcoding_jbig, ast_control_t38_parameters::transcoding_mmr, ast_fax_t38_parameters::transcoding_mmr, ast_control_t38_parameters::version, and ast_fax_t38_parameters::version.
Referenced by fax_gateway_detect_t38(), fax_gateway_request_t38(), generic_fax_exec(), receivefax_t38_init(), and sendfax_t38_init().
|
static |
unload res_fax
Definition at line 4748 of file res_fax.c.
References acf_faxopt, ao2_ref, app_receivefax, app_sendfax, ARRAY_LEN, ast_cli_unregister_multiple(), ast_custom_function_unregister(), ast_log, ast_logger_unregister_level(), ast_manager_unregister(), ast_unregister_application(), fax_cli, fax_logger_level, faxregistry, LOG_WARNING, and ast_custom_function::name.
|
static |
Definition at line 811 of file res_fax.c.
References ARRAY_LEN, AST_FAX_MODEM_V17, AST_FAX_MODEM_V27TER, AST_FAX_MODEM_V29, AST_FAX_MODEM_V34, ast_log, LOG_WARNING, NULL, and value.
Referenced by acf_faxopt_write(), and set_config().
|
static |
|
static |
FAXOPT dialplan function.
Definition at line 4741 of file res_fax.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 427 of file res_fax.c.
Referenced by load_module(), receivefax_exec(), and unload_module().
|
static |
Definition at line 428 of file res_fax.c.
Referenced by load_module(), sendfax_exec(), and unload_module().
|
static |
|
static |
Definition at line 552 of file res_fax.c.
Referenced by load_module(), and set_config().
struct ao2_container* container |
active sessions are astobj2 objects
Definition at line 501 of file res_fax.c.
Referenced by __container_unlink_node_debug(), aeap_tab_complete_name(), ast_aeap_client_configs_get(), ast_extension_state_extended(), ast_sip_cli_traverse_objects(), AST_TEST_DEFINE(), bridge_profile_find(), cli_aor_get_container(), cli_aor_iterate(), cli_contact_iterate(), cli_contact_retrieve_by_id(), cli_endpoint_get_container(), cli_eprofile_show_all(), cli_get_container(), cli_iterate(), cli_iterator(), cli_profile_show_all(), cli_tn_show_all(), cli_unid_iterate(), client_config_show_all(), complete_show_sorcery_object(), config_object_tab_complete_name(), gather_contacts_for_aor(), get_publishes_and_update_state(), handle_export_primitives(), has_mwi_subscription(), insert_test_duplicates(), insert_test_vector(), load_module(), menu_find(), named_acl_find(), named_item_find(), notify_option_find(), populate_transport_states(), proxy_dtor(), registrar_add_non_permanent(), registrar_add_unreachable(), speech_observer_loaded(), test_ao2_callback_traversal(), test_ao2_iteration(), test_expected_duplicates(), test_item_find(), test_make_nonsorted(), test_make_sorted(), unload_module(), user_profile_find(), var_list_from_loc_info(), var_list_from_node(), and xmpp_client_create_buddy().
|
static |
Definition at line 538 of file res_fax.c.
Referenced by set_config().
|
static |
Definition at line 4379 of file res_fax.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 618 of file res_fax.c.
Referenced by find_details(), find_or_create_details(), and fixup_callback().
|
static |
Definition at line 574 of file res_fax.c.
Referenced by receivefax_exec(), and sendfax_exec().
|
static |
Definition at line 486 of file res_fax.c.
Referenced by ast_fax_log(), load_module(), and unload_module().
|
static |
struct { ... } faxregistry |
The faxregistry is used to manage information and statistics for all FAX sessions.
Referenced by cli_fax_show_session(), cli_fax_show_sessions(), cli_fax_show_stats(), destroy_gateway(), destroy_session(), destroy_v21_sessions(), fax_session_new(), fax_session_release(), fax_session_reserve(), fax_session_tab_complete(), generic_fax_exec(), load_module(), manager_fax_session(), manager_fax_sessions(), manager_fax_stats(), receivefax_exec(), sendfax_exec(), and unload_module().
|
static |
Definition at line 536 of file res_fax.c.
Referenced by get_general_options(), and set_general_options().
|
static |
Definition at line 554 of file res_fax.c.
Referenced by cli_fax_set_debug(), fax_gateway_attach(), receivefax_exec(), and sendfax_exec().
|
static |
Definition at line 547 of file res_fax.c.
Referenced by get_general_options(), and set_general_options().
|
static |
Definition at line 732 of file res_fax.c.
Referenced by find_or_create_details().