512#define FAX_DETECT_MODE_CNG (1 << 0)
513#define FAX_DETECT_MODE_T38 (1 << 1)
514#define FAX_DETECT_MODE_BOTH (FAX_DETECT_MODE_CNG | FAX_DETECT_MODE_T38)
519#define FAX_MAXBUCKETS 10
521#define RES_FAX_TIMEOUT 10000
522#define FAX_GATEWAY_TIMEOUT RES_FAX_TIMEOUT
551#define RES_FAX_MINRATE 4800
552#define RES_FAX_MAXRATE 14400
553#define RES_FAX_STATUSEVENTS 0
554#define RES_FAX_MODEM (AST_FAX_MODEM_V17 | AST_FAX_MODEM_V27TER | AST_FAX_MODEM_V29)
555#define RES_FAX_T38TIMEOUT 5000
582static const char *
config =
"res_fax.conf";
610 unsigned int last_consec_frames, last_consec_ms;
611 unsigned char wassil;
620 history->
silence = (dspsilence != 0) ? 1 : 0;
621 if (history->
silence != wassil) {
627 if ((last_consec_frames != 0)) {
628 ast_verb(0,
"Channel '%s' fax session '%u', [ %.3ld.%.6ld ], %s sent %u frames (%u ms) of %s.\n",
629 s->
channame, s->
id, (
long) diff.tv_sec, (
long int) diff.tv_usec,
630 (c2s) ?
"channel" :
"stack", last_consec_frames, last_consec_ms,
631 (wassil) ?
"silence" :
"energy");
701 if (!(details = datastore->
data)) {
749 d->option.statusevents =
options.statusevents;
755 d->faxdetect_id = -1;
756 d->gateway_timeout = 0;
757 d->negotiate_both = 0;
812 datastore->
data = details;
843 char *m[5], *tok, *v = (
char *)
value, *rest;
846 if (!strchr(v,
',')) {
850 tok = strtok_r(v,
", ", &rest);
853 tok = strtok_r(
NULL,
", ", &rest);
859 for (j = 0; j < i; j++) {
860 if (!strcasecmp(m[j],
"v17")) {
862 }
else if (!strcasecmp(m[j],
"v27")) {
864 }
else if (!strcasecmp(m[j],
"v29")) {
866 }
else if (!strcasecmp(m[j],
"v34")) {
869 ast_log(
LOG_WARNING,
"ignoring invalid modem setting: '%s', valid options {v17 | v27 | v29 | v34}\n", m[j]);
878 size_t size = bufsize;
1046 return "Uninitialized";
1048 return "Initialized";
1065void ast_fax_log(
int level,
const char *
file,
const int line,
const char *function,
const char *msg)
1079 if (sscanf(ratestr,
"%d", &rate) != 1) {
1094 ast_log(
LOG_WARNING,
"ignoring invalid rate '%s'. Valid options are {2400 | 4800 | 7200 | 9600 | 12000 | 14400 | 28800 | 33600}\n", ratestr);
1206 char caps[128] =
"";
1330 char caps[128] =
"";
1364 if (!details || !json_array) {
1401 char *filenames, *
c;
1413 size += strlen(separator) + strlen(
prefix) + strlen(doc->
filename);
1447 if (!json_filenames) {
1451 json_object =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: o}",
1458 "filenames", json_filenames);
1498#define GENERIC_FAX_EXEC_SET_VARS(fax, chan, errorstr, reason) \
1500 if (ast_strlen_zero(fax->details->result)) \
1501 ast_string_field_set(fax->details, result, "FAILED"); \
1502 if (ast_strlen_zero(fax->details->resultstr)) \
1503 ast_string_field_set(fax->details, resultstr, reason); \
1504 if (ast_strlen_zero(fax->details->error)) \
1505 ast_string_field_set(fax->details, error, errorstr); \
1506 set_channel_variables(chan, fax->details); \
1509#define GENERIC_FAX_EXEC_ERROR_QUIET(fax, chan, errorstr, reason) \
1511 GENERIC_FAX_EXEC_SET_VARS(fax, chan, errorstr, reason); \
1514#define GENERIC_FAX_EXEC_ERROR(fax, chan, errorstr, reason) \
1516 ast_log(LOG_ERROR, "channel '%s' FAX session '%u' failure, reason: '%s' (%s)\n", ast_channel_name(chan), fax->id, reason, errorstr); \
1517 GENERIC_FAX_EXEC_ERROR_QUIET(fax, chan, errorstr, reason); \
1561 struct timeval start;
1589 (frame->
datalen ==
sizeof(t38_parameters))) {
1624 unsigned int expected_frametype = -1;
1628 const char *tempvar;
1635 struct timeval start;
1640 if (t38negotiated) {
1716 remaining_time = timeout;
1718 while (remaining_time > 0) {
1745 (frame->
datalen ==
sizeof(t38_parameters))) {
1746 unsigned int was_t38 = t38negotiated;
1771 if (t38negotiated && !was_t38) {
1776 details->
caps &= ~AST_FAX_TECH_AUDIO;
1818 }
else if (ofd == fax->
fd) {
1821 if (!(frame = fax->
tech->
read(fax))) {
1834 if (ms && (ofd < 0)) {
1837 if (remaining_time <= 0)
1848 if (remaining_time <= 0) {
1855 ast_debug(3,
"channel '%s' - event loop stopped { timeout: %d, remaining_time: %d }\n",
ast_channel_name(chan), timeout, remaining_time);
1860 if (!strcasecmp(details->
result,
"FAILED")) {
1873 if (orig_read_format) {
1876 if (orig_write_format) {
1890 struct timeval start;
1924 (frame->
datalen ==
sizeof(t38_parameters))) {
1940 details->
caps &= ~AST_FAX_TECH_AUDIO;
1982 details->
caps &= ~AST_FAX_TECH_T38;
1993 (frame->
datalen ==
sizeof(t38_parameters))) {
2005 details->
caps &= ~AST_FAX_TECH_AUDIO;
2011 details->
caps &= ~AST_FAX_TECH_T38;
2016 details->
caps &= ~AST_FAX_TECH_T38;
2054 if (!json_array || !json_filename) {
2061 const char *remote_station_id;
2062 const char *local_station_id;
2063 const char *fax_pages;
2064 const char *fax_resolution;
2065 const char *fax_bitrate;
2070 remote_station_id =
ast_strdupa(remote_station_id);
2089 json_object =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: s, s: s, s: o}",
2091 "remote_station_id",
S_OR(remote_station_id,
""),
2092 "local_station_id",
S_OR(local_station_id,
""),
2093 "fax_pages",
S_OR(fax_pages,
""),
2094 "fax_resolution",
S_OR(fax_resolution,
""),
2095 "fax_bitrate",
S_OR(fax_bitrate,
""),
2113 char *parse, modems[128] =
"";
2117 struct ast_fax_tech_token *token =
NULL;
2139 ast_log(
LOG_ERROR,
"System cannot provide memory for session requirements.\n");
2148 if (details->gateway_id > 0) {
2149 ast_string_field_set(details, resultstr,
"can't receive a fax on a channel with a T.38 gateway");
2151 ast_log(
LOG_ERROR,
"executing ReceiveFAX on a channel with a T.38 Gateway is not supported\n");
2155 if (details->maxrate < details->minrate) {
2159 ast_log(
LOG_ERROR,
"maxrate %u is less than minrate %u\n", details->maxrate, details->minrate);
2165 ast_log(
LOG_ERROR,
"'modems' setting '%s' is incompatible with 'minrate' setting %u\n", modems, details->minrate);
2174 ast_log(
LOG_ERROR,
"'modems' setting '%s' is incompatible with 'maxrate' setting %u\n", modems, details->maxrate);
2220 if (!(doc =
ast_calloc(1,
sizeof(*doc) + strlen(
args.filename) + 1))) {
2224 ast_log(
LOG_ERROR,
"System cannot provide memory for session requirements.\n");
2309 return (!channel_alive) ? -1 : 0;
2317 struct timeval start;
2330 if (
ast_playtones_start(chan, 1024,
"!1100/500,!0/3000,!1100/500,!0/3000,!1100/500,!0/3000", 1)) {
2359 (frame->
datalen ==
sizeof(t38_parameters))) {
2375 details->
caps &= ~AST_FAX_TECH_AUDIO;
2420 details->
caps &= ~AST_FAX_TECH_T38;
2431 (frame->
datalen ==
sizeof(t38_parameters))) {
2443 details->
caps &= ~AST_FAX_TECH_AUDIO;
2449 details->
caps &= ~AST_FAX_TECH_T38;
2454 details->
caps &= ~AST_FAX_TECH_T38;
2501 (frame->
datalen ==
sizeof(t38_parameters))) {
2517 details->
caps &= ~AST_FAX_TECH_AUDIO;
2563 if (!json_filenames) {
2568 const char *remote_station_id;
2569 const char *local_station_id;
2570 const char *fax_pages;
2571 const char *fax_resolution;
2572 const char *fax_bitrate;
2577 remote_station_id =
ast_strdupa(remote_station_id);
2595 json_obj =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: s, s: s, s: o}",
2597 "remote_station_id",
S_OR(remote_station_id,
""),
2598 "local_station_id",
S_OR(local_station_id,
""),
2599 "fax_pages",
S_OR(fax_pages,
""),
2600 "fax_resolution",
S_OR(fax_resolution,
""),
2601 "fax_bitrate",
S_OR(fax_bitrate,
""),
2602 "filenames", json_filenames);
2621 char *parse, *filenames, *
c, modems[128] =
"";
2622 int channel_alive, file_count;
2625 struct ast_fax_tech_token *token =
NULL;
2647 ast_log(
LOG_ERROR,
"System cannot provide memory for session requirements.\n");
2656 if (details->gateway_id > 0) {
2659 ast_log(
LOG_ERROR,
"executing SendFAX on a channel with a T.38 Gateway is not supported\n");
2663 if (details->maxrate < details->minrate) {
2667 ast_log(
LOG_ERROR,
"maxrate %u is less than minrate %u\n", details->maxrate, details->minrate);
2673 ast_log(
LOG_ERROR,
"'modems' setting '%s' is incompatible with 'minrate' setting %u\n", modems, details->minrate);
2682 ast_log(
LOG_ERROR,
"'modems' setting '%s' is incompatible with 'maxrate' setting %u\n", modems, details->maxrate);
2727 filenames =
args.filenames;
2728 while ((
c =
strsep(&filenames,
"&"))) {
2729 if (access(
c, (F_OK | R_OK)) < 0) {
2733 ast_log(
LOG_ERROR,
"access failure. Verify '%s' exists and check permissions.\n",
args.filenames);
2737 if (!(doc =
ast_calloc(1,
sizeof(*doc) + strlen(
c) + 1))) {
2741 ast_log(
LOG_ERROR,
"System cannot provide memory for session requirements.\n");
2757 if (file_count > 1) {
2822 details->option.send_cng = 1;
2837 return (!channel_alive) ? -1 : 0;
2846 return (!channel_alive) ? -1 : 0;
2926 details->
caps &= ~AST_FAX_TECH_GATEWAY;
2927 ast_log(
LOG_ERROR,
"Can't reserve a FAX session, gateway attempt failed.\n");
2969 ast_log(
LOG_ERROR,
"Can't create a FAX session, gateway attempt failed.\n");
2983 if (start_res < 0) {
3010 .datalen =
sizeof(t38_parameters),
3012 .data.ptr = &t38_parameters,
3043 struct ast_channel *other = (active == chan) ? peer : chan;
3050 if (active_v21_session->
tech->
write(active_v21_session, f) == 0 &&
3093 if (active == chan) {
3097 if (active == chan) {
3116 if (active == chan) {
3141 struct ast_channel *other = (active == chan) ? peer : chan;
3223 ast_debug(1,
"%s is attempting to negotiate T.38 after we already sent a negotiation request based on v21 preamble detection\n",
ast_channel_name(active));
3379 switch (gateway->
s->
state) {
3480 if (chan_is_hungup || peer_is_hungup) {
3493 details->gateway_id = -1;
3498 details->is_t38_negotiated = 0;
3503 if (details->gateway_timeout) {
3538 details->gateway_id = -1;
3543 details->is_t38_negotiated = 0;
3635 .data.ptr = silence_buf,
3637 .datalen =
sizeof(silence_buf),
3639 memset(silence_buf, 0,
sizeof(silence_buf));
3662 .disable_inheritance = 1,
3686 fr_hook.
data = gateway;
3709 if (faxdetect->
dsp) {
3741 if (!faxdetect->
dsp) {
3838 if (!faxdetect->
dsp) {
3876 const char *target_context;
3888 ast_verb(2,
"Redirecting '%s' to fax extension due to %s detection\n",
3896 (
result ==
'f') ?
"CNG" :
"T38", target_context);
3929 ast_log(
LOG_ERROR,
"System cannot provide memory for session requirements.\n");
3940 fr_hook.
data = faxdetect;
3985 tklen = strlen(
a->word);
3988 snprintf(tbuf,
sizeof(tbuf),
"%u", s->
id);
3989 if (!strncasecmp(
a->word, tbuf, tklen) && ++wordnum >
a->n) {
4006 e->
command =
"fax show version";
4008 "Usage: fax show version\n"
4009 " Show versions of FAX For Asterisk components.\n";
4019 ast_cli(
a->fd,
"FAX For Asterisk Components:\n");
4039 e->
command =
"fax set debug {on|off}";
4041 "Usage: fax set debug { on | off }\n"
4042 " Enable/Disable FAX debugging on new FAX sessions. The basic FAX debugging will result in\n"
4043 " additional events sent to manager sessions with 'call' class permissions. When\n"
4044 " verbosity is greater than '5' events will be displayed to the console and audio versus\n"
4045 " energy analysis will be performed and displayed to the console.\n";
4051 what =
a->argv[e->
args-1];
4052 if (!strcasecmp(what,
"on")) {
4054 }
else if (!strcasecmp(what,
"off")) {
4061 ast_cli(
a->fd,
"\n\nFAX Debug %s\n\n", (
flag) ?
"Enabled" :
"Disabled");
4070 unsigned int num_modules = 0;
4074 e->
command =
"fax show capabilities";
4076 "Usage: fax show capabilities\n"
4077 " Shows the capabilities of the registered FAX technology modules\n";
4083 ast_cli(
a->fd,
"\n\nRegistered FAX Technology Modules:\n\n");
4091 ast_cli(
a->fd,
"%u registered modules\n\n", num_modules);
4100 char modems[128] =
"";
4105 e->
command =
"fax show settings";
4107 "Usage: fax show settings\n"
4108 " Show the global settings and defaults of both the FAX core and technology modules\n";
4116 ast_cli(
a->fd,
"FAX For Asterisk Settings:\n");
4118 ast_cli(
a->fd,
"\tStatus Events: %s\n",
options.statusevents ?
"On" :
"Off");
4123 ast_cli(
a->fd,
"\tT.38 Negotiation Timeout: %u\n",
options.t38timeout);
4124 ast_cli(
a->fd,
"\n\nFAX Technology Modules:\n\n");
4142 e->
command =
"fax show session";
4144 "Usage: fax show session <session number>\n"
4145 " Shows status of the named FAX session\n";
4155 if (sscanf(
a->argv[3],
"%u", &tmp.
id) != 1) {
4160 ast_cli(
a->fd,
"\nFAX Session Details:\n--------------------\n\n");
4176 char id_text[256] =
"";
4180 if (sscanf(session_number,
"%30u", &
find_session.id) != 1) {
4191 if (!
session->tech->manager_fax_session) {
4192 astman_send_error(s, m,
"Fax technology doesn't provide a handler for FAXSession");
4198 snprintf(id_text,
sizeof(id_text),
"ActionID: %s\r\n", action_id);
4216 e->
command =
"fax show stats";
4218 "Usage: fax show stats\n"
4219 " Shows a statistical summary of FAX transmissions\n";
4225 ast_cli(
a->fd,
"\nFAX Statistics:\n---------------\n\n");
4246 char id_text[256] =
"";
4251 snprintf(id_text,
sizeof(id_text),
"ActionID: %s\r\n", action_id);
4256 "CurrentSessions: %d\r\n"
4257 "ReservedSessions: %d\r\n"
4258 "TransmitAttempts: %d\r\n"
4259 "ReceiveAttempts: %d\r\n"
4260 "CompletedFAXes: %d\r\n"
4261 "FailedFAXes: %d\r\n"
4311 e->
command =
"fax show sessions";
4313 "Usage: fax show sessions\n"
4314 " Shows the current FAX sessions\n";
4320 ast_cli(
a->fd,
"\nCurrent FAX Sessions:\n\n");
4321 ast_cli(
a->fd,
"%-30.30s %-10.10s %-10.10s %-5.5s %-10.10s %-15.15s %-30.30s\n",
4322 "Channel",
"Tech",
"FAXID",
"Type",
"Operation",
"State",
"File(s)");
4329 ast_cli(
a->fd,
"%-30.30s %-10.10s %-10u %-5.5s %-10.10s %-15.15s %-30s\n",
4363 "Technology: %s\r\n"
4364 "SessionNumber: %u\r\n"
4365 "SessionType: %s\r\n"
4388 snprintf(id_text,
sizeof(id_text),
"ActionID: %s\r\n", action_id);
4435 unsigned int timeout;
4437 if (sscanf(
value,
"%u", &timeout) != 1) {
4440 }
else if (timeout) {
4441 *t38timeout = timeout;
4456 char modems[128] =
"";
4496 if (!strcasecmp(v->
name,
"minrate")) {
4497 ast_debug(3,
"reading minrate '%s' from configuration file\n", v->
value);
4503 }
else if (!strcasecmp(v->
name,
"maxrate")) {
4504 ast_debug(3,
"reading maxrate '%s' from configuration file\n", v->
value);
4510 }
else if (!strcasecmp(v->
name,
"statusevents")) {
4511 ast_debug(3,
"reading statusevents '%s' from configuration file\n", v->
value);
4513 }
else if (!strcasecmp(v->
name,
"ecm")) {
4514 ast_debug(3,
"reading ecm '%s' from configuration file\n", v->
value);
4516 }
else if ((!strcasecmp(v->
name,
"modem")) || (!strcasecmp(v->
name,
"modems"))) {
4519 }
else if (!strcasecmp(v->
name,
"t38timeout")) {
4565 if (!strcasecmp(data,
"ecm")) {
4567 }
else if (!strcasecmp(data,
"t38gateway") || !strcasecmp(data,
"gateway") ||
4568 !strcasecmp(data,
"t38_gateway") || !strcasecmp(data,
"faxgateway")) {
4570 }
else if (!strcasecmp(data,
"faxdetect")) {
4572 }
else if (!strcasecmp(data,
"error")) {
4574 }
else if (!strcasecmp(data,
"filename")) {
4581 }
else if (!strcasecmp(data,
"filenames")) {
4592 }
else if (!strcasecmp(data,
"headerinfo")) {
4594 }
else if (!strcasecmp(data,
"localstationid")) {
4596 }
else if (!strcasecmp(data,
"maxrate")) {
4598 }
else if (!strcasecmp(data,
"minrate")) {
4600 }
else if (!strcasecmp(data,
"pages")) {
4602 }
else if (!strcasecmp(data,
"rate")) {
4604 }
else if (!strcasecmp(data,
"remotestationid")) {
4606 }
else if (!strcasecmp(data,
"resolution")) {
4608 }
else if (!strcasecmp(data,
"sessionid")) {
4609 snprintf(
buf,
len,
"%u", details->
id);
4610 }
else if (!strcasecmp(data,
"status")) {
4612 }
else if (!strcasecmp(data,
"statusstr")) {
4614 }
else if ((!strcasecmp(data,
"modem")) || (!strcasecmp(data,
"modems"))) {
4616 }
else if (!strcasecmp(data,
"t38timeout")) {
4618 }
else if (!strcasecmp(data,
"negotiate_both")) {
4641 if (!strcasecmp(data,
"ecm")) {
4650 }
else if (!strcasecmp(data,
"t38gateway") || !strcasecmp(data,
"gateway") ||
4651 !strcasecmp(data,
"t38_gateway") || !strcasecmp(data,
"faxgateway")) {
4653 char *timeout = strchr(
val,
',');
4663 unsigned int gwtimeout;
4665 if (sscanf(timeout,
"%30u", &gwtimeout) == 1) {
4668 ast_log(
LOG_WARNING,
"Unsupported timeout '%s' passed to FAXOPT(%s).\n", timeout, data);
4690 }
else if (!strcasecmp(data,
"faxdetect")) {
4692 char *timeout = strchr(
val,
',');
4704 if (sscanf(timeout,
"%30u", &
fdtimeout) == 1) {
4712 if (!strcasecmp(
val,
"t38")) {
4714 }
else if (!strcasecmp(
val,
"cng")) {
4721 if (faxdetect < 0) {
4738 }
else if (!strcasecmp(data,
"headerinfo")) {
4740 }
else if (!strcasecmp(data,
"localstationid")) {
4742 }
else if (!strcasecmp(data,
"maxrate")) {
4747 }
else if (!strcasecmp(data,
"minrate")) {
4752 }
else if (!strcasecmp(data,
"t38timeout")) {
4756 }
else if ((!strcasecmp(data,
"modem")) || (!strcasecmp(data,
"modems"))) {
4758 }
else if (!strcasecmp(data,
"negotiate_both")) {
struct sla_ringing_trunk * first
Asterisk version information.
const char * ast_get_version(void)
Retrieve the Asterisk version string.
char * strsep(char **str, const char *delims)
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_mansession session
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_calloc(num, len)
A wrapper for calloc()
#define ast_malloc(len)
A wrapper for malloc()
#define ao2_iterator_next(iter)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_MUTEX
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define ao2_unlink(container, obj)
Remove an object from a container.
#define ao2_find(container, arg, flags)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_replace(dst, src)
Replace one object reference with another cleaning up the original.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define ao2_alloc(data_size, destructor_fn)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
struct ast_channel * ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, int nfds, int *exception, int *outfd, int *ms)
Waits for activity on a group of channels.
static enum ast_t38_state ast_channel_get_t38_state(struct ast_channel *chan)
Retrieves the current T38 state of a channel.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
struct ast_channel * ast_channel_bridge_peer(struct ast_channel *chan)
Get the channel's bridge peer only if the bridge is two-party.
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
#define ast_channel_lock(chan)
struct ast_trans_pvt * ast_channel_readtrans(const struct ast_channel *chan)
int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *peer)
Make the frame formats of two channels compatible.
ast_t38_state
Possible T38 states on channels.
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
#define ast_channel_lock_both(chan1, chan2)
Lock two channels.
const char * ast_channel_uniqueid(const struct ast_channel *chan)
const char * ast_channel_context(const struct ast_channel *chan)
int ast_write(struct ast_channel *chan, struct ast_frame *frame)
Write a frame to a channel This function writes the given frame to the indicated channel.
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
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.
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
int ast_check_hangup(struct ast_channel *chan)
Check to see if a channel is needing hang up.
int ast_indicate_data(struct ast_channel *chan, int condition, const void *data, size_t datalen)
Indicates condition of channel, with payload.
struct ast_format * ast_channel_writeformat(struct ast_channel *chan)
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
int ast_answer(struct ast_channel *chan)
Answer a channel.
const char * ast_channel_exten(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.
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
ast_channel_state
ast_channel states
Standard Command Line Interface.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
#define AST_CLI_DEFINE(fn, txt,...)
void ast_cli(int fd, const char *fmt,...)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
#define ast_datastore_alloc(info, uid)
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
Convenient Signal Processing routines.
void ast_dsp_set_threshold(struct ast_dsp *dsp, int threshold)
Set the minimum average magnitude threshold to determine talking by the DSP.
void ast_dsp_free(struct ast_dsp *dsp)
int ast_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence)
Process the audio frame for silence.
void ast_dsp_reset(struct ast_dsp *dsp)
Reset total silence count.
struct ast_frame * ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, struct ast_frame *inf)
Return AST_FRAME_NULL frames when there is silence, AST_FRAME_BUSY on busies, and call progress,...
#define DSP_FEATURE_FAX_DETECT
#define DSP_FAXMODE_DETECT_SQUELCH
#define DSP_FAXMODE_DETECT_CNG
int ast_dsp_set_faxmode(struct ast_dsp *dsp, int faxmode)
Set fax mode.
void ast_dsp_set_features(struct ast_dsp *dsp, int features)
Select feature set.
struct ast_dsp * ast_dsp_new(void)
Allocates a new dsp, assumes 8khz for internal sample rate.
Generic File Format Support. Should be included by clients of the file handling routines....
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_ATTACHED
@ AST_FRAMEHOOK_EVENT_DETACHED
@ AST_FRAMEHOOK_EVENT_WRITE
@ AST_FRAMEHOOK_EVENT_READ
int ast_framehook_detach(struct ast_channel *chan, int framehook_id)
Detach an framehook from a channel.
#define AST_FRAMEHOOK_INTERFACE_VERSION
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
void astman_send_listack(struct mansession *s, const struct message *m, char *msg, char *listflag)
Send ack in manager transaction to begin a list.
void astman_send_error(struct mansession *s, const struct message *m, char *error)
Send error in manager transaction.
void astman_send_list_complete_start(struct mansession *s, const struct message *m, const char *event_name, int count)
Start the list complete event.
void astman_send_ack(struct mansession *s, const struct message *m, char *msg)
Send ack in manager transaction.
const char * astman_get_header(const struct message *m, char *var)
Get header from manager transaction.
void astman_send_list_complete_end(struct mansession *s)
End the list complete event.
void astman_append(struct mansession *s, const char *fmt,...)
int ast_manager_unregister(const char *action)
Unregister a registered manager command.
struct stasis_message * ast_channel_blob_create_from_cache(const char *uniqueid, struct stasis_message_type *type, struct ast_json *blob)
Create a ast_channel_blob message, pulling channel state from the cache.
struct stasis_message_type * ast_channel_fax_type(void)
Message type for a fax operation.
static char prefix[MAX_PREFIX]
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
Configuration File Parser.
struct ast_config * ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags)
Load a config file.
@ CONFIG_FLAG_FILEUNCHANGED
#define CONFIG_STATUS_FILEUNCHANGED
#define CONFIG_STATUS_FILEINVALID
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
@ AST_T38_REQUEST_TERMINATE
@ AST_T38_REQUEST_NEGOTIATE
#define ast_frisolate(fr)
Makes a frame independent of any static storage.
@ AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF
@ AST_CONTROL_T38_PARAMETERS
struct ast_frame ast_null_frame
Support for logging to various files, console and syslog Configuration in file logger....
#define ast_debug(level,...)
Log a DEBUG message.
#define ast_log_dynamic_level(level,...)
Send a log message to a dynamically registered log level.
int ast_logger_register_level(const char *name)
Register a new logger level.
#define ast_verb(level,...)
void ast_logger_unregister_level(const char *name)
Unregister a previously registered logger level.
int ast_playtones_start(struct ast_channel *chan, int vol, const char *tonelist, int interruptible)
Start playing a list of tones on a channel.
void ast_playtones_stop(struct ast_channel *chan)
Stop playing tones on a channel.
I/O Management (derived from Cheops-NG)
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
#define AST_JSON_UTF8_VALIDATE(str)
Check str for UTF-8 and replace with an empty string if fails the check.
#define AST_RWLIST_REMOVE_CURRENT
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
#define AST_RWLIST_TRAVERSE_SAFE_BEGIN
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized.
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_RWLIST_TRAVERSE_SAFE_END
#define AST_RWLIST_TRAVERSE
#define AST_RWLIST_INSERT_TAIL
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
Asterisk locking-related definitions:
#define ast_rwlock_wrlock(a)
#define ast_rwlock_rdlock(a)
#define AST_RWLOCK_DEFINE_STATIC(rwlock)
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
#define SCOPED_CHANNELLOCK(varname, chan)
scoped lock specialization for channels.
#define ast_rwlock_unlock(a)
static struct mansession_session * find_session(uint32_t ident, int incinuse)
#define EVENT_FLAG_REPORTING
#define ast_manager_register_xml(action, authority, func)
Register a manager callback using XML documentation to describe the manager.
Asterisk module definitions.
@ AST_MODFLAG_GLOBAL_SYMBOLS
#define ast_module_unref(mod)
Release a reference to the module.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_module_running_ref(mod)
Hold a reference to the module if it is running.
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Options provided by main asterisk program.
Core PBX routines and definitions.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name.
#define ast_custom_function_register(acf)
Register a custom function.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
int ast_async_goto(struct ast_channel *chan, const char *context, const char *exten, int priority)
Set the channel to next execute the specified dialplan location.
void ast_fax_tech_unregister(struct ast_fax_tech *tech)
unregister a FAX technology module
static void fax_session_release(struct ast_fax_session *s, struct ast_fax_tech_token *token)
Release a session token.
static int session_cmp_cb(void *obj, void *arg, int flags)
compare callback for ao2
static int manager_fax_sessions_entry(struct mansession *s, struct ast_fax_session *session, const char *id_text)
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.
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.
static int session_hash_cb(const void *obj, const int flags)
hash callback for ao2
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
static struct ast_fax_session_details * session_details_new(void)
create a FAX session details structure
unsigned int ast_fax_minrate(void)
get the minimum supported fax rate
static struct ast_fax_session_details * find_details(struct ast_channel *chan)
returns a reference counted pointer to a fax datastore, if it exists
static struct ast_fax_session * fax_session_reserve(struct ast_fax_session_details *details, struct ast_fax_tech_token **token)
Reserve a fax session.
static int update_modem_bits(enum ast_fax_modems *bits, const char *value)
static void set_general_options(const struct fax_options *options)
static void fax_gateway_indicate_t38(struct ast_channel *chan, struct ast_channel *active, struct ast_control_t38_parameters *control_params)
#define FAX_DETECT_MODE_BOTH
static int receivefax_t38_init(struct ast_channel *chan, struct ast_fax_session_details *details)
static const struct ast_app_option fax_exec_options[128]
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.
static void destroy_gateway(void *data)
destroy a FAX gateway session structure
static int report_fax_status(struct ast_channel *chan, struct ast_fax_session_details *details, const char *status)
send a FAX status manager event
static const char app_receivefax[]
static void destroy_v21_sessions(struct fax_gateway *gateway)
destroy the v21 detection parts of a fax gateway session
static int fax_logger_level
static char * cli_fax_show_stats(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
display fax stats
static struct @438 faxregistry
The faxregistry is used to manage information and statistics for all FAX sessions.
static void destroy_session_details(void *details)
destroy a FAX session details structure
const char * ast_fax_state_to_str(enum ast_fax_state state)
convert a ast_fax_state to a string
static char * ast_fax_caps_to_str(enum ast_fax_capabilities caps, char *buf, size_t bufsize)
static const struct fax_options default_options
static const struct ast_datastore_info fax_datastore
static struct ast_custom_function acf_faxopt
FAXOPT dialplan function.
static void fax_detect_framehook_destroy(void *data)
Deref the faxdetect data structure when the faxdetect framehook is detached.
static struct ast_fax_session * fax_v21_session_new(struct ast_channel *chan)
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.
static void t38_parameters_fax_to_ast(struct ast_control_t38_parameters *dst, const struct ast_fax_t38_parameters *src)
static void fixup_callback(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
Copies fax detection and gateway framehooks during masquerades.
static const char * config
static int set_t38timeout(const char *value, unsigned int *t38timeout)
static int check_modem_rate(enum ast_fax_modems modems, unsigned int rate)
static int sendfax_exec(struct ast_channel *chan, const char *data)
initiate a send FAX session
static char * fax_session_tab_complete(struct ast_cli_args *a)
fax session tab completion
#define FAX_MAXBUCKETS
maximum buckets for res_fax ao2 containers
static int fax_detect_attach(struct ast_channel *chan, int timeout, int flags)
Attach a faxdetect framehook object to a channel.
static const char * fax_session_type(struct ast_fax_session *s)
static int receivefax_exec(struct ast_channel *chan, const char *data)
initiate a receive FAX session
static ast_rwlock_t options_lock
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
static void fax_gateway_framehook_destroy(void *data)
Destroy the gateway data structure when the framehook is detached.
static int reload_module(void)
struct ao2_container * container
static struct fax_detect * fax_detect_new(struct ast_channel *chan, int timeout, int flags)
Create a new fax detect object.
static int fax_gateway_attach(struct ast_channel *chan, struct ast_fax_session_details *details)
Attach a gateway framehook object to a channel.
static int set_config(int reload)
configure res_fax
static struct ast_control_t38_parameters our_t38_parameters
static const char app_sendfax[]
static char * cli_fax_show_capabilities(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
display registered FAX capabilities
static int ast_fax_modem_to_str(enum ast_fax_modems bits, char *tbuf, size_t bufsize)
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)
#define FAX_DETECT_MODE_T38
static char * cli_fax_show_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
display global defaults and settings
const char * ast_fax_session_operation_str(struct ast_fax_session *s)
get string representation of a FAX session's operation
static struct ast_json * generate_filenames_json(struct ast_fax_session_details *details)
unsigned int ast_fax_maxrate(void)
get the maxiumum supported fax rate
int ast_fax_tech_register(struct ast_fax_tech *tech)
register a FAX technology module
static void destroy_session(void *session)
destroy a FAX session structure
static void get_general_options(struct fax_options *options)
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.
static void t38_parameters_ast_to_fax(struct ast_fax_t38_parameters *dst, const struct ast_control_t38_parameters *src)
static int manager_fax_session(struct mansession *s, const struct message *m)
static void debug_check_frame_for_silence(struct ast_fax_session *s, unsigned int c2s, struct ast_frame *frame)
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
static char * cli_fax_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
enable FAX debugging
#define GENERIC_FAX_EXEC_ERROR(fax, chan, errorstr, reason)
#define RES_FAX_STATUSEVENTS
#define RES_FAX_T38TIMEOUT
static int set_fax_t38_caps(struct ast_channel *chan, struct ast_fax_session_details *details)
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.
static void destroy_callback(void *data)
static int manager_fax_stats(struct mansession *s, const struct message *m)
static int load_module(void)
Load the module.
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...
static int sendfax_t38_init(struct ast_channel *chan, struct ast_fax_session_details *details)
#define FAX_GATEWAY_TIMEOUT
#define GENERIC_FAX_EXEC_SET_VARS(fax, chan, errorstr, reason)
static unsigned int fax_rate_str_to_int(const char *ratestr)
convert a rate string to a rate
static char * cli_fax_show_version(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static int unload_module(void)
unload res_fax
static struct fax_gateway * fax_gateway_new(struct ast_channel *chan, struct ast_fax_session_details *details)
Create a new fax gateway object.
static void destroy_faxdetect(void *data)
destroy a FAX detect structure
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.
static void set_channel_variables(struct ast_channel *chan, struct ast_fax_session_details *details)
Set fax related channel variables.
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.
static int disable_t38(struct ast_channel *chan)
static char * cli_fax_show_sessions(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
display fax sessions
static struct ast_cli_entry fax_cli[]
static int manager_fax_sessions(struct mansession *s, const struct message *m)
#define FAX_DETECT_MODE_CNG
FAX Detect flags.
static int report_receive_fax_status(struct ast_channel *chan, const char *filename)
Report on the final state of a receive fax operation.
static struct ast_frame * fax_gateway_request_t38(struct fax_gateway *gateway, struct ast_channel *chan)
static int global_fax_debug
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.
static struct fax_options general_options
ast_fax_capabilities
capabilities for res_fax to locate a fax technology module
@ AST_FAX_TECH_V21_DETECT
#define AST_FAX_FRFLAG_GATEWAY
ast_fax_state
current state of a fax session
@ AST_FAX_STATE_INITIALIZED
@ AST_FAX_STATE_UNINITIALIZED
ast_fax_modems
fax modem capabilities
Asterisk internal frame definitions.
void ast_smoother_free(struct ast_smoother *s)
struct ast_frame * ast_smoother_read(struct ast_smoother *s)
#define ast_smoother_feed(s, f)
struct ast_smoother * ast_smoother_new(int bytes)
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_string_field_build(x, field, fmt, args...)
Set a field to a complex (built) value.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
String manipulation functions.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
static force_inline int attribute_pure ast_strlen_zero(const char *s)
int ast_build_string(char **buffer, size_t *space, const char *fmt,...)
Build a string in a buffer, designed to be called repeatedly.
int attribute_pure ast_false(const char *val)
Make sure something is false. Determine if a string containing a boolean value is "false"....
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Main Channel structure associated with a channel.
descriptor for a cli entry.
int args
This gets set in ast_cli_register()
unsigned int transcoding_jbig
enum ast_control_t38_rate rate
unsigned int transcoding_mmr
enum ast_control_t38_rate_management rate_management
enum ast_control_t38 request_response
unsigned int fill_bit_removal
Data structure associated with a custom dialplan function.
Structure for a data store type.
Structure for a data store object.
struct debug_info_history c2s s2c
struct ast_fax_document * next
The data communicated between the high level applications and the generic fax function.
const ast_string_field localstationid
struct ast_fax_t38_parameters their_t38_parameters
struct ast_fax_documents documents
const ast_string_field result
enum ast_fax_modems modems
const ast_string_field headerinfo
struct ast_fax_t38_parameters our_t38_parameters
const ast_string_field resultstr
const ast_string_field error
unsigned int pages_transferred
const ast_string_field resolution
const ast_string_field remotestationid
const ast_string_field transfer_rate
union ast_fax_session_details::@253 option
enum ast_fax_capabilities caps
The data required to handle a fax session.
struct ast_smoother * smoother
const struct ast_fax_tech * tech
unsigned long frames_received
unsigned long frames_sent
struct ast_channel * chan
struct ast_fax_debug_info * debug_info
struct ast_fax_session_details * details
unsigned int transcoding_jbig
enum ast_control_t38_rate rate
unsigned int transcoding_mmr
enum ast_control_t38_rate_management rate_management
unsigned int fill_bit_removal
used to register a FAX technology module with res_fax
void(*const release_token)(struct ast_fax_tech_token *)
void(*const destroy_session)(struct ast_fax_session *)
char *(*const cli_show_settings)(int)
struct ast_frame *(*const read)(struct ast_fax_session *)
int(*const switch_to_t38)(struct ast_fax_session *)
void *(*const new_session)(struct ast_fax_session *, struct ast_fax_tech_token *)
int(*const cancel_session)(struct ast_fax_session *)
struct ast_module * module
int(*const write)(struct ast_fax_session *, const struct ast_frame *)
int(*const generate_silence)(struct ast_fax_session *)
char *(*const cli_show_capabilities)(int)
const char *const version
const char *const description
char *(*const cli_show_stats)(int)
char *(*const cli_show_session)(struct ast_fax_session *, int)
int(*const start_session)(struct ast_fax_session *)
enum ast_fax_capabilities caps
struct ast_fax_tech_token *(*const reserve_session)(struct ast_fax_session *)
Structure used to handle boolean flags.
struct ast_format * format
Data structure associated with a single frame of data.
union ast_frame::@228 data
struct ast_frame_subclass subclass
enum ast_frame_type frametype
Abstract JSON element (object, array, string, int, ...).
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
unsigned int consec_frames
used for fax detect framehook
struct timeval timeout_start
the start of our timeout counter
struct ast_dsp * dsp
DSP Processor.
struct ast_format * orig_format
original audio formats
struct ast_fax_session_details * details
fax session details
used for gateway framehook
struct ast_fax_session * peer_v21_session
struct timeval timeout_start
the start of our timeout counter
enum ast_t38_state t38_state
a flag to track the state of our negotiation
struct ast_format * chan_read_format
original audio formats
struct ast_format * chan_write_format
struct ast_fax_session * chan_v21_session
struct ast_format * peer_write_format
struct ast_format * peer_read_format
struct ast_fax_session * s
FAX Session.
int framehook
framehook used in gateway mode
struct ast_fax_tech_token * token
reserved fax session token
int detected_v21
1 if a v21 preamble has been detected
registered FAX technology modules are put into this list
const struct ast_fax_tech * tech
enum ast_fax_modems modems
In case you didn't read that giant block of text above the mansession_session struct,...
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
int ast_remaining_ms(struct timeval start, int max_ms)
Calculate remaining milliseconds given a starting timestamp and upper bound.
struct timeval ast_tvsub(struct timeval a, struct timeval b)
Returns the difference of two timevals a - b.
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Support for translation of data formats. translate.c.
struct ast_frame * ast_translate(struct ast_trans_pvt *tr, struct ast_frame *f, int consume)
translates one or more frames Apply an input frame into the translator and receive zero or one output...
int error(const char *format,...)
#define ast_test_flag(p, flag)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.