Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <pthread.h>
#include <errno.h>
#include <tiffio.h>
#include <spandsp.h>
#include <spandsp/version.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/logger.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/app.h"
#include "asterisk/dsp.h"
#include "asterisk/module.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | fax_session |
Macros | |
#define | ASTMM_LIBC ASTMM_IGNORE |
#define | MAX_SAMPLES 240 |
#define | SPANDSP_EXPOSE_INTERNAL_STRUCTURES |
#define | WATCHDOG_STATE_TIMEOUT 5 * 60 |
#define | WATCHDOG_TOTAL_TIMEOUT 30 * 60 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void * | fax_generator_alloc (struct ast_channel *chan, void *params) |
static int | fax_generator_generate (struct ast_channel *chan, void *data, int len, int samples) |
static int | load_module (void) |
static void | phase_e_handler (t30_state_t *f, void *user_data, int result) |
static int | rcvfax_exec (struct ast_channel *chan, const char *data) |
static void | set_ecm (t30_state_t *state, int ecm) |
static void | set_file (t30_state_t *state, fax_session *s) |
static void | set_local_info (t30_state_t *state, fax_session *s) |
static int | set_logging (logging_state_t *state) |
static int | sndfax_exec (struct ast_channel *chan, const char *data) |
static void | span_message (int level, const char *msg) |
static int | t38_tx_packet_handler (t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) |
static int | transmit (fax_session *s) |
static int | transmit_audio (fax_session *s) |
static int | transmit_t38 (fax_session *s) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Simple FAX Application" , .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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_DEPRECATED, .load = load_module, .unload = unload_module, } |
static const char | app_rcvfax_name [] = "ReceiveFAX" |
static const char | app_sndfax_name [] = "SendFAX" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_generator | generator |
#define ASTMM_LIBC ASTMM_IGNORE |
#define MAX_SAMPLES 240 |
Definition at line 151 of file app_fax.c.
Referenced by fax_generator_generate().
#define WATCHDOG_STATE_TIMEOUT 5 * 60 |
Definition at line 160 of file app_fax.c.
Referenced by transmit_audio(), and transmit_t38().
#define WATCHDOG_TOTAL_TIMEOUT 30 * 60 |
Definition at line 159 of file app_fax.c.
Referenced by transmit_audio(), and transmit_t38().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
|
static |
|
static |
Definition at line 329 of file app_fax.c.
References ast_channel_name(), ast_format_slin, AST_FRAME_SET_BUFFER, AST_FRAME_VOICE, AST_FRIENDLY_OFFSET, ast_log, ast_write(), buf, errno, ast_frame::frametype, len(), LOG_WARNING, MAX_SAMPLES, and ast_frame::samples.
|
static |
Definition at line 985 of file app_fax.c.
References app_rcvfax_name, app_sndfax_name, AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_SUPPORT_DEPRECATED, ast_register_application_xml, ASTERISK_GPL_KEY, NULL, rcvfax_exec(), sndfax_exec(), and unload_module().
|
static |
Definition at line 206 of file app_fax.c.
References ao2_cleanup, ast_channel_blob_create_from_cache(), ast_channel_fax_type(), ast_channel_topic(), ast_channel_uniqueid(), ast_debug, ast_json_pack(), ast_json_ref(), ast_json_unref(), AST_JSON_UTF8_VALIDATE, ast_log, buf, fax_session::chan, fax_session::direction, fax_session::file_name, fax_session::finished, LOG_WARNING, NULL, pbx_builtin_setvar_helper(), RAII_VAR, S_OR, and stasis_publish().
Referenced by transmit_audio(), and transmit_t38().
|
static |
Definition at line 906 of file app_fax.c.
References args, AST_APP_ARG, ast_channel_queryoption(), ast_channel_setoption(), AST_DECLARE_APP_ARGS, ast_log, AST_OPTION_DIGIT_DETECT, AST_OPTION_FAX_DETECT, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero, fax_session::caller_mode, fax_session::chan, fax_session::direction, dummy(), FALSE, fax_session::file_name, fax_session::finished, LOG_ERROR, NULL, options, parse(), session, transmit(), and TRUE.
Referenced by load_module().
|
static |
Definition at line 314 of file app_fax.c.
Referenced by transmit_audio(), and transmit_t38().
|
static |
Definition at line 306 of file app_fax.c.
References fax_session::direction, and fax_session::file_name.
Referenced by transmit_audio(), and transmit_t38().
|
static |
Definition at line 293 of file app_fax.c.
References ast_strlen_zero, fax_session::chan, and pbx_builtin_getvar_helper().
Referenced by transmit_audio(), and transmit_t38().
|
static |
Definition at line 283 of file app_fax.c.
References option_debug, and span_message().
Referenced by transmit_audio(), and transmit_t38().
|
static |
Definition at line 837 of file app_fax.c.
References args, AST_APP_ARG, ast_channel_queryoption(), ast_channel_setoption(), AST_DECLARE_APP_ARGS, ast_log, AST_OPTION_DIGIT_DETECT, AST_OPTION_FAX_DETECT, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero, fax_session::caller_mode, fax_session::chan, fax_session::direction, dummy(), FALSE, fax_session::file_name, fax_session::finished, LOG_ERROR, NULL, options, parse(), session, transmit(), and TRUE.
Referenced by load_module().
|
static |
Definition at line 172 of file app_fax.c.
References ast_debug, ast_log, LOG_ERROR, and LOG_WARNING.
Referenced by set_logging().
|
static |
Definition at line 183 of file app_fax.c.
References AST_FRAME_MODEM, AST_FRAME_SET_BUFFER, ast_log, AST_MODEM_T38, ast_write(), errno, ast_frame::frametype, and LOG_WARNING.
Referenced by transmit_t38().
|
static |
Definition at line 779 of file app_fax.c.
References ast_answer(), ast_channel_get_t38_state(), ast_channel_name(), ast_debug, ast_log, AST_STATE_UP, fax_session::chan, fax_session::finished, LOG_ERROR, LOG_WARNING, NULL, pbx_builtin_setvar_helper(), T38_STATE_NEGOTIATED, fax_session::t38state, transmit_audio(), and transmit_t38().
Referenced by rcvfax_exec(), and sndfax_exec().
|
static |
Definition at line 367 of file app_fax.c.
References ao2_bump, ao2_ref, ast_activate_generator(), ast_channel_get_t38_state(), ast_channel_name(), ast_channel_readformat(), ast_channel_writeformat(), AST_CONTROL_T38_PARAMETERS, ast_deactivate_generator(), ast_debug, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_get_name(), ast_format_slin, AST_FRAME_CONTROL, AST_FRAME_VOICE, ast_frfree, ast_indicate_data(), ast_log, ast_read(), ast_set_read_format(), ast_set_write_format(), AST_T38_NEGOTIATED, AST_T38_RATE_14400, AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF, AST_T38_REFUSED, AST_T38_REQUEST_NEGOTIATE, ast_tvdiff_sec(), ast_tvnow(), ast_waitfor(), fax_session::caller_mode, fax_session::chan, ast_frame::data, ast_frame::datalen, done, FALSE, fax_session::finished, ast_frame_subclass::format, ast_frame::frametype, ast_frame_subclass::integer, LOG_ERROR, LOG_WARNING, NULL, phase_e_handler(), ast_frame::ptr, ast_control_t38_parameters::request_response, ast_frame::samples, set_ecm(), set_file(), set_local_info(), set_logging(), ast_frame::subclass, T38_STATE_NEGOTIATED, T38_STATE_UNAVAILABLE, fax_session::t38parameters, timeout, TRUE, ast_control_t38_parameters::version, WATCHDOG_STATE_TIMEOUT, and WATCHDOG_TOTAL_TIMEOUT.
Referenced by transmit().
|
static |
Definition at line 603 of file app_fax.c.
References ast_channel_get_t38_state(), ast_channel_name(), AST_CONTROL_T38_PARAMETERS, ast_debug, AST_FRAME_CONTROL, AST_FRAME_MODEM, ast_frfree, ast_indicate_data(), ast_log, AST_MODEM_T38, ast_read(), AST_T38_REFUSED, AST_T38_REQUEST_TERMINATE, AST_T38_TERMINATED, ast_tvdiff_sec(), ast_tvdiff_us(), ast_tvnow(), ast_waitfor(), fax_session::caller_mode, fax_session::chan, ast_frame::data, ast_frame::datalen, disable_t38(), FALSE, ast_control_t38_parameters::fill_bit_removal, fax_session::finished, ast_frame::frametype, ast_frame_subclass::integer, LOG_ERROR, LOG_WARNING, ast_control_t38_parameters::max_ifp, NULL, phase_e_handler(), ast_frame::ptr, ast_control_t38_parameters::request_response, ast_frame::seqno, set_ecm(), set_file(), set_local_info(), set_logging(), ast_frame::subclass, t38, T38_STATE_NEGOTIATED, t38_tx_packet_handler(), fax_session::t38parameters, timeout, ast_control_t38_parameters::transcoding_jbig, ast_control_t38_parameters::transcoding_mmr, TRUE, WATCHDOG_STATE_TIMEOUT, and WATCHDOG_TOTAL_TIMEOUT.
Referenced by transmit().
|
static |
Definition at line 975 of file app_fax.c.
References app_rcvfax_name, app_sndfax_name, and ast_unregister_application().
Referenced by load_module().
|
static |
|
static |
Definition at line 149 of file app_fax.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 148 of file app_fax.c.
Referenced by load_module(), and unload_module().
|
static |
|
static |
Definition at line 359 of file app_fax.c.
Referenced by ast_read_generator_actions(), ast_sip_pubsub_generate_body_content(), cli_alias_passthrough(), create_virtual_subscriptions(), deactivate_generator_nolock(), find_body_generator(), generator_write_format_change(), pubsub_on_rx_subscribe_request(), and sub_persistence_recreate().