482#define FAX_DETECT_MODE_CNG (1 << 0)
483#define FAX_DETECT_MODE_T38 (1 << 1)
484#define FAX_DETECT_MODE_BOTH (FAX_DETECT_MODE_CNG | FAX_DETECT_MODE_T38)
489#define FAX_MAXBUCKETS 10
491#define RES_FAX_TIMEOUT 10000
492#define FAX_GATEWAY_TIMEOUT RES_FAX_TIMEOUT
521#define RES_FAX_MINRATE 4800
522#define RES_FAX_MAXRATE 14400
523#define RES_FAX_STATUSEVENTS 0
524#define RES_FAX_MODEM (AST_FAX_MODEM_V17 | AST_FAX_MODEM_V27TER | AST_FAX_MODEM_V29)
525#define RES_FAX_T38TIMEOUT 5000
552static const char *
config =
"res_fax.conf";
580 unsigned int last_consec_frames, last_consec_ms;
581 unsigned char wassil;
590 history->
silence = (dspsilence != 0) ? 1 : 0;
591 if (history->
silence != wassil) {
597 if ((last_consec_frames != 0)) {
598 ast_verb(0,
"Channel '%s' fax session '%u', [ %.3ld.%.6ld ], %s sent %u frames (%u ms) of %s.\n",
599 s->
channame, s->
id, (
long) diff.tv_sec, (
long int) diff.tv_usec,
600 (c2s) ?
"channel" :
"stack", last_consec_frames, last_consec_ms,
601 (wassil) ?
"silence" :
"energy");
671 if (!(details = datastore->
data)) {
719 d->option.statusevents =
options.statusevents;
725 d->faxdetect_id = -1;
726 d->gateway_timeout = 0;
727 d->negotiate_both = 0;
782 datastore->
data = details;
813 char *m[5], *tok, *v = (
char *)
value, *rest;
816 if (!strchr(v,
',')) {
820 tok = strtok_r(v,
", ", &rest);
823 tok = strtok_r(
NULL,
", ", &rest);
829 for (j = 0; j < i; j++) {
830 if (!strcasecmp(m[j],
"v17")) {
832 }
else if (!strcasecmp(m[j],
"v27")) {
834 }
else if (!strcasecmp(m[j],
"v29")) {
836 }
else if (!strcasecmp(m[j],
"v34")) {
839 ast_log(
LOG_WARNING,
"ignoring invalid modem setting: '%s', valid options {v17 | v27 | v29 | v34}\n", m[j]);
848 size_t size = bufsize;
1016 return "Uninitialized";
1018 return "Initialized";
1035void ast_fax_log(
int level,
const char *
file,
const int line,
const char *function,
const char *msg)
1049 if (sscanf(ratestr,
"%d", &rate) != 1) {
1064 ast_log(
LOG_WARNING,
"ignoring invalid rate '%s'. Valid options are {2400 | 4800 | 7200 | 9600 | 12000 | 14400 | 28800 | 33600}\n", ratestr);
1176 char caps[128] =
"";
1300 char caps[128] =
"";
1334 if (!details || !json_array) {
1371 char *filenames, *
c;
1383 size += strlen(separator) + strlen(
prefix) + strlen(doc->
filename);
1417 if (!json_filenames) {
1421 json_object =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: o}",
1428 "filenames", json_filenames);
1468#define GENERIC_FAX_EXEC_SET_VARS(fax, chan, errorstr, reason) \
1470 if (ast_strlen_zero(fax->details->result)) \
1471 ast_string_field_set(fax->details, result, "FAILED"); \
1472 if (ast_strlen_zero(fax->details->resultstr)) \
1473 ast_string_field_set(fax->details, resultstr, reason); \
1474 if (ast_strlen_zero(fax->details->error)) \
1475 ast_string_field_set(fax->details, error, errorstr); \
1476 set_channel_variables(chan, fax->details); \
1479#define GENERIC_FAX_EXEC_ERROR_QUIET(fax, chan, errorstr, reason) \
1481 GENERIC_FAX_EXEC_SET_VARS(fax, chan, errorstr, reason); \
1484#define GENERIC_FAX_EXEC_ERROR(fax, chan, errorstr, reason) \
1486 ast_log(LOG_ERROR, "channel '%s' FAX session '%u' failure, reason: '%s' (%s)\n", ast_channel_name(chan), fax->id, reason, errorstr); \
1487 GENERIC_FAX_EXEC_ERROR_QUIET(fax, chan, errorstr, reason); \
1531 struct timeval start;
1559 (frame->
datalen ==
sizeof(t38_parameters))) {
1594 unsigned int expected_frametype = -1;
1598 const char *tempvar;
1605 struct timeval start;
1610 if (t38negotiated) {
1686 remaining_time = timeout;
1688 while (remaining_time > 0) {
1715 (frame->
datalen ==
sizeof(t38_parameters))) {
1716 unsigned int was_t38 = t38negotiated;
1741 if (t38negotiated && !was_t38) {
1746 details->
caps &= ~AST_FAX_TECH_AUDIO;
1788 }
else if (ofd == fax->
fd) {
1791 if (!(frame = fax->
tech->
read(fax))) {
1804 if (ms && (ofd < 0)) {
1807 if (remaining_time <= 0)
1818 if (remaining_time <= 0) {
1825 ast_debug(3,
"channel '%s' - event loop stopped { timeout: %d, remaining_time: %d }\n",
ast_channel_name(chan), timeout, remaining_time);
1830 if (!strcasecmp(details->
result,
"FAILED")) {
1843 if (orig_read_format) {
1846 if (orig_write_format) {
1860 struct timeval start;
1894 (frame->
datalen ==
sizeof(t38_parameters))) {
1910 details->
caps &= ~AST_FAX_TECH_AUDIO;
1952 details->
caps &= ~AST_FAX_TECH_T38;
1963 (frame->
datalen ==
sizeof(t38_parameters))) {
1975 details->
caps &= ~AST_FAX_TECH_AUDIO;
1981 details->
caps &= ~AST_FAX_TECH_T38;
1986 details->
caps &= ~AST_FAX_TECH_T38;
2024 if (!json_array || !json_filename) {
2031 const char *remote_station_id;
2032 const char *local_station_id;
2033 const char *fax_pages;
2034 const char *fax_resolution;
2035 const char *fax_bitrate;
2040 remote_station_id =
ast_strdupa(remote_station_id);
2059 json_object =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: s, s: s, s: o}",
2061 "remote_station_id",
S_OR(remote_station_id,
""),
2062 "local_station_id",
S_OR(local_station_id,
""),
2063 "fax_pages",
S_OR(fax_pages,
""),
2064 "fax_resolution",
S_OR(fax_resolution,
""),
2065 "fax_bitrate",
S_OR(fax_bitrate,
""),
2083 char *parse, modems[128] =
"";
2087 struct ast_fax_tech_token *token =
NULL;
2109 ast_log(
LOG_ERROR,
"System cannot provide memory for session requirements.\n");
2118 if (details->gateway_id > 0) {
2119 ast_string_field_set(details, resultstr,
"can't receive a fax on a channel with a T.38 gateway");
2121 ast_log(
LOG_ERROR,
"executing ReceiveFAX on a channel with a T.38 Gateway is not supported\n");
2125 if (details->maxrate < details->minrate) {
2129 ast_log(
LOG_ERROR,
"maxrate %u is less than minrate %u\n", details->maxrate, details->minrate);
2135 ast_log(
LOG_ERROR,
"'modems' setting '%s' is incompatible with 'minrate' setting %u\n", modems, details->minrate);
2144 ast_log(
LOG_ERROR,
"'modems' setting '%s' is incompatible with 'maxrate' setting %u\n", modems, details->maxrate);
2190 if (!(doc =
ast_calloc(1,
sizeof(*doc) + strlen(
args.filename) + 1))) {
2194 ast_log(
LOG_ERROR,
"System cannot provide memory for session requirements.\n");
2279 return (!channel_alive) ? -1 : 0;
2287 struct timeval start;
2300 if (
ast_playtones_start(chan, 1024,
"!1100/500,!0/3000,!1100/500,!0/3000,!1100/500,!0/3000", 1)) {
2329 (frame->
datalen ==
sizeof(t38_parameters))) {
2345 details->
caps &= ~AST_FAX_TECH_AUDIO;
2390 details->
caps &= ~AST_FAX_TECH_T38;
2401 (frame->
datalen ==
sizeof(t38_parameters))) {
2413 details->
caps &= ~AST_FAX_TECH_AUDIO;
2419 details->
caps &= ~AST_FAX_TECH_T38;
2424 details->
caps &= ~AST_FAX_TECH_T38;
2471 (frame->
datalen ==
sizeof(t38_parameters))) {
2487 details->
caps &= ~AST_FAX_TECH_AUDIO;
2533 if (!json_filenames) {
2538 const char *remote_station_id;
2539 const char *local_station_id;
2540 const char *fax_pages;
2541 const char *fax_resolution;
2542 const char *fax_bitrate;
2547 remote_station_id =
ast_strdupa(remote_station_id);
2565 json_obj =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: s, s: s, s: o}",
2567 "remote_station_id",
S_OR(remote_station_id,
""),
2568 "local_station_id",
S_OR(local_station_id,
""),
2569 "fax_pages",
S_OR(fax_pages,
""),
2570 "fax_resolution",
S_OR(fax_resolution,
""),
2571 "fax_bitrate",
S_OR(fax_bitrate,
""),
2572 "filenames", json_filenames);
2591 char *parse, *filenames, *
c, modems[128] =
"";
2592 int channel_alive, file_count;
2595 struct ast_fax_tech_token *token =
NULL;
2617 ast_log(
LOG_ERROR,
"System cannot provide memory for session requirements.\n");
2626 if (details->gateway_id > 0) {
2629 ast_log(
LOG_ERROR,
"executing SendFAX on a channel with a T.38 Gateway is not supported\n");
2633 if (details->maxrate < details->minrate) {
2637 ast_log(
LOG_ERROR,
"maxrate %u is less than minrate %u\n", details->maxrate, details->minrate);
2643 ast_log(
LOG_ERROR,
"'modems' setting '%s' is incompatible with 'minrate' setting %u\n", modems, details->minrate);
2652 ast_log(
LOG_ERROR,
"'modems' setting '%s' is incompatible with 'maxrate' setting %u\n", modems, details->maxrate);
2697 filenames =
args.filenames;
2698 while ((
c =
strsep(&filenames,
"&"))) {
2699 if (access(
c, (F_OK | R_OK)) < 0) {
2703 ast_log(
LOG_ERROR,
"access failure. Verify '%s' exists and check permissions.\n",
args.filenames);
2707 if (!(doc =
ast_calloc(1,
sizeof(*doc) + strlen(
c) + 1))) {
2711 ast_log(
LOG_ERROR,
"System cannot provide memory for session requirements.\n");
2727 if (file_count > 1) {
2792 details->option.send_cng = 1;
2807 return (!channel_alive) ? -1 : 0;
2816 return (!channel_alive) ? -1 : 0;
2896 details->
caps &= ~AST_FAX_TECH_GATEWAY;
2897 ast_log(
LOG_ERROR,
"Can't reserve a FAX session, gateway attempt failed.\n");
2939 ast_log(
LOG_ERROR,
"Can't create a FAX session, gateway attempt failed.\n");
2953 if (start_res < 0) {
2980 .datalen =
sizeof(t38_parameters),
2982 .data.ptr = &t38_parameters,
3013 struct ast_channel *other = (active == chan) ? peer : chan;
3020 if (active_v21_session->
tech->
write(active_v21_session, f) == 0 &&
3063 if (active == chan) {
3067 if (active == chan) {
3086 if (active == chan) {
3111 struct ast_channel *other = (active == chan) ? peer : chan;
3193 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));
3349 switch (gateway->
s->
state) {
3450 if (chan_is_hungup || peer_is_hungup) {
3463 details->gateway_id = -1;
3468 details->is_t38_negotiated = 0;
3473 if (details->gateway_timeout) {
3508 details->gateway_id = -1;
3513 details->is_t38_negotiated = 0;
3605 .data.ptr = silence_buf,
3607 .datalen =
sizeof(silence_buf),
3609 memset(silence_buf, 0,
sizeof(silence_buf));
3632 .disable_inheritance = 1,
3656 fr_hook.
data = gateway;
3679 if (faxdetect->
dsp) {
3711 if (!faxdetect->
dsp) {
3808 if (!faxdetect->
dsp) {
3846 const char *target_context;
3858 ast_verb(2,
"Redirecting '%s' to fax extension due to %s detection\n",
3866 (
result ==
'f') ?
"CNG" :
"T38", target_context);
3899 ast_log(
LOG_ERROR,
"System cannot provide memory for session requirements.\n");
3910 fr_hook.
data = faxdetect;
3955 tklen = strlen(
a->word);
3958 snprintf(tbuf,
sizeof(tbuf),
"%u", s->
id);
3959 if (!strncasecmp(
a->word, tbuf, tklen) && ++wordnum >
a->n) {
3976 e->
command =
"fax show version";
3978 "Usage: fax show version\n"
3979 " Show versions of FAX For Asterisk components.\n";
3989 ast_cli(
a->fd,
"FAX For Asterisk Components:\n");
4009 e->
command =
"fax set debug {on|off}";
4011 "Usage: fax set debug { on | off }\n"
4012 " Enable/Disable FAX debugging on new FAX sessions. The basic FAX debugging will result in\n"
4013 " additional events sent to manager sessions with 'call' class permissions. When\n"
4014 " verbosity is greater than '5' events will be displayed to the console and audio versus\n"
4015 " energy analysis will be performed and displayed to the console.\n";
4021 what =
a->argv[e->
args-1];
4022 if (!strcasecmp(what,
"on")) {
4024 }
else if (!strcasecmp(what,
"off")) {
4031 ast_cli(
a->fd,
"\n\nFAX Debug %s\n\n", (
flag) ?
"Enabled" :
"Disabled");
4040 unsigned int num_modules = 0;
4044 e->
command =
"fax show capabilities";
4046 "Usage: fax show capabilities\n"
4047 " Shows the capabilities of the registered FAX technology modules\n";
4053 ast_cli(
a->fd,
"\n\nRegistered FAX Technology Modules:\n\n");
4061 ast_cli(
a->fd,
"%u registered modules\n\n", num_modules);
4070 char modems[128] =
"";
4075 e->
command =
"fax show settings";
4077 "Usage: fax show settings\n"
4078 " Show the global settings and defaults of both the FAX core and technology modules\n";
4086 ast_cli(
a->fd,
"FAX For Asterisk Settings:\n");
4088 ast_cli(
a->fd,
"\tStatus Events: %s\n",
options.statusevents ?
"On" :
"Off");
4093 ast_cli(
a->fd,
"\tT.38 Negotiation Timeout: %u\n",
options.t38timeout);
4094 ast_cli(
a->fd,
"\n\nFAX Technology Modules:\n\n");
4112 e->
command =
"fax show session";
4114 "Usage: fax show session <session number>\n"
4115 " Shows status of the named FAX session\n";
4125 if (sscanf(
a->argv[3],
"%u", &
tmp.id) != 1) {
4130 ast_cli(
a->fd,
"\nFAX Session Details:\n--------------------\n\n");
4146 char id_text[256] =
"";
4150 if (sscanf(session_number,
"%30u", &
find_session.id) != 1) {
4161 if (!
session->tech->manager_fax_session) {
4162 astman_send_error(s, m,
"Fax technology doesn't provide a handler for FAXSession");
4168 snprintf(id_text,
sizeof(id_text),
"ActionID: %s\r\n", action_id);
4186 e->
command =
"fax show stats";
4188 "Usage: fax show stats\n"
4189 " Shows a statistical summary of FAX transmissions\n";
4195 ast_cli(
a->fd,
"\nFAX Statistics:\n---------------\n\n");
4216 char id_text[256] =
"";
4221 snprintf(id_text,
sizeof(id_text),
"ActionID: %s\r\n", action_id);
4226 "CurrentSessions: %d\r\n"
4227 "ReservedSessions: %d\r\n"
4228 "TransmitAttempts: %d\r\n"
4229 "ReceiveAttempts: %d\r\n"
4230 "CompletedFAXes: %d\r\n"
4231 "FailedFAXes: %d\r\n"
4281 e->
command =
"fax show sessions";
4283 "Usage: fax show sessions\n"
4284 " Shows the current FAX sessions\n";
4290 ast_cli(
a->fd,
"\nCurrent FAX Sessions:\n\n");
4291 ast_cli(
a->fd,
"%-30.30s %-10.10s %-10.10s %-5.5s %-10.10s %-15.15s %-30.30s\n",
4292 "Channel",
"Tech",
"FAXID",
"Type",
"Operation",
"State",
"File(s)");
4299 ast_cli(
a->fd,
"%-30.30s %-10.10s %-10u %-5.5s %-10.10s %-15.15s %-30s\n",
4333 "Technology: %s\r\n"
4334 "SessionNumber: %u\r\n"
4335 "SessionType: %s\r\n"
4358 snprintf(id_text,
sizeof(id_text),
"ActionID: %s\r\n", action_id);
4405 unsigned int timeout;
4407 if (sscanf(
value,
"%u", &timeout) != 1) {
4410 }
else if (timeout) {
4411 *t38timeout = timeout;
4426 char modems[128] =
"";
4466 if (!strcasecmp(v->
name,
"minrate")) {
4467 ast_debug(3,
"reading minrate '%s' from configuration file\n", v->
value);
4473 }
else if (!strcasecmp(v->
name,
"maxrate")) {
4474 ast_debug(3,
"reading maxrate '%s' from configuration file\n", v->
value);
4480 }
else if (!strcasecmp(v->
name,
"statusevents")) {
4481 ast_debug(3,
"reading statusevents '%s' from configuration file\n", v->
value);
4483 }
else if (!strcasecmp(v->
name,
"ecm")) {
4484 ast_debug(3,
"reading ecm '%s' from configuration file\n", v->
value);
4486 }
else if ((!strcasecmp(v->
name,
"modem")) || (!strcasecmp(v->
name,
"modems"))) {
4489 }
else if (!strcasecmp(v->
name,
"t38timeout")) {
4535 if (!strcasecmp(data,
"ecm")) {
4537 }
else if (!strcasecmp(data,
"t38gateway") || !strcasecmp(data,
"gateway") ||
4538 !strcasecmp(data,
"t38_gateway") || !strcasecmp(data,
"faxgateway")) {
4540 }
else if (!strcasecmp(data,
"faxdetect")) {
4542 }
else if (!strcasecmp(data,
"error")) {
4544 }
else if (!strcasecmp(data,
"filename")) {
4551 }
else if (!strcasecmp(data,
"filenames")) {
4562 }
else if (!strcasecmp(data,
"headerinfo")) {
4564 }
else if (!strcasecmp(data,
"localstationid")) {
4566 }
else if (!strcasecmp(data,
"maxrate")) {
4568 }
else if (!strcasecmp(data,
"minrate")) {
4570 }
else if (!strcasecmp(data,
"pages")) {
4572 }
else if (!strcasecmp(data,
"rate")) {
4574 }
else if (!strcasecmp(data,
"remotestationid")) {
4576 }
else if (!strcasecmp(data,
"resolution")) {
4578 }
else if (!strcasecmp(data,
"sessionid")) {
4579 snprintf(
buf,
len,
"%u", details->
id);
4580 }
else if (!strcasecmp(data,
"status")) {
4582 }
else if (!strcasecmp(data,
"statusstr")) {
4584 }
else if ((!strcasecmp(data,
"modem")) || (!strcasecmp(data,
"modems"))) {
4586 }
else if (!strcasecmp(data,
"t38timeout")) {
4588 }
else if (!strcasecmp(data,
"negotiate_both")) {
4611 if (!strcasecmp(data,
"ecm")) {
4620 }
else if (!strcasecmp(data,
"t38gateway") || !strcasecmp(data,
"gateway") ||
4621 !strcasecmp(data,
"t38_gateway") || !strcasecmp(data,
"faxgateway")) {
4623 char *timeout = strchr(
val,
',');
4633 unsigned int gwtimeout;
4635 if (sscanf(timeout,
"%30u", &gwtimeout) == 1) {
4638 ast_log(
LOG_WARNING,
"Unsupported timeout '%s' passed to FAXOPT(%s).\n", timeout, data);
4660 }
else if (!strcasecmp(data,
"faxdetect")) {
4662 char *timeout = strchr(
val,
',');
4674 if (sscanf(timeout,
"%30u", &
fdtimeout) == 1) {
4682 if (!strcasecmp(
val,
"t38")) {
4684 }
else if (!strcasecmp(
val,
"cng")) {
4691 if (faxdetect < 0) {
4708 }
else if (!strcasecmp(data,
"headerinfo")) {
4710 }
else if (!strcasecmp(data,
"localstationid")) {
4712 }
else if (!strcasecmp(data,
"maxrate")) {
4717 }
else if (!strcasecmp(data,
"minrate")) {
4722 }
else if (!strcasecmp(data,
"t38timeout")) {
4726 }
else if ((!strcasecmp(data,
"modem")) || (!strcasecmp(data,
"modems"))) {
4728 }
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.
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.
char * strsep(char **str, const char *delims)
Configuration File Parser.
struct ast_config * ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags)
Load a config file.
#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)
@ CONFIG_FLAG_FILEUNCHANGED
@ 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 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 struct @435 faxregistry
The faxregistry is used to manage information and statistics for all FAX sessions.
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
union ast_fax_session_details::@251 option
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
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.
struct ast_frame_subclass subclass
union ast_frame::@226 data
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.