62#define POLARITY_IDLE 0
64#define MIN_MS_SINCE_FLASH ( (2000) )
107#define ISTRUNK(p) ((p->sig == ANALOG_SIG_FXSLS) || (p->sig == ANALOG_SIG_FXSKS) || \
108 (p->sig == ANALOG_SIG_FXSGS))
219#define gen_analog_field_callback(type, callback_name, def_value) \
220 static type analog_get_##callback_name(struct analog_pvt *p) \
222 if (!analog_callbacks.get_##callback_name) { \
225 return analog_callbacks.get_##callback_name(p->chan_pvt); \
232#undef gen_analog_field_callback
236 if (!strcasecmp(
value,
"ring")) {
238 }
else if (!strcasecmp(
value,
"polarity")) {
240 }
else if (!strcasecmp(
value,
"polarity_in")) {
242 }
else if (!strcasecmp(
value,
"dtmf")) {
257 return "Polarity_In";
270 res =
"ANALOG_EVENT_ONHOOK";
273 res =
"ANALOG_EVENT_RINGOFFHOOK";
276 res =
"ANALOG_EVENT_WINKFLASH";
279 res =
"ANALOG_EVENT_ALARM";
282 res =
"ANALOG_EVENT_NOALARM";
285 res =
"ANALOG_EVENT_DIALCOMPLETE";
288 res =
"ANALOG_EVENT_HOOKCOMPLETE";
291 res =
"ANALOG_EVENT_PULSE_START";
294 res =
"ANALOG_EVENT_POLARITY";
297 res =
"ANALOG_EVENT_RINGBEGIN";
300 res =
"ANALOG_EVENT_EC_DISABLED";
303 res =
"ANALOG_EVENT_RINGERON";
306 res =
"ANALOG_EVENT_RINGEROFF";
309 res =
"ANALOG_EVENT_REMOVED";
312 res =
"ANALOG_EVENT_NEONMWI_ACTIVE";
315 res =
"ANALOG_EVENT_NEONMWI_INACTIVE";
317#ifdef HAVE_DAHDI_ECHOCANCEL_FAX_MODE
319 res =
"ANALOG_EVENT_TX_CED_DETECTED";
322 res =
"ANALOG_EVENT_RX_CED_DETECTED";
325 res =
"ANALOG_EVENT_EC_NLP_DISABLED";
328 res =
"ANALOG_EVENT_EC_NLP_ENABLED";
332 res =
"ANALOG_EVENT_PULSEDIGIT";
335 res =
"ANALOG_EVENT_DTMFDOWN";
338 res =
"ANALOG_EVENT_DTMFUP";
341 res =
"UNKNOWN/OTHER";
393 ast_debug(1,
"Sending callerid. CID_NAME: '%s' CID_NUM: '%s'\n",
407#define analog_get_index(ast, p, nullok) _analog_get_index(ast, p, nullok, __PRETTY_FUNCTION__, __LINE__)
421 "Unable to get index for '%s' on channel %d (%s(), line %lu)\n",
448 p->
owner = new_owner;
720 ast_verb(3,
"TRANSFERRING %s to %s\n",
749 for (
x = 0;
x < 3;
x++) {
762 ast_debug(1,
"Updated conferencing on %d, with %d conference users\n", p->
channel, needconf);
819#ifdef DAHDI_CHECK_HOOKSTATE
826 }
else if (offhook) {
996 ast_debug(1,
"CALLING CID_NAME: %s CID_NUM:: %s\n",
1025 if (p->
owner == ast) {
1033 c = strchr(dest,
'/');
1048 ast_debug(1,
"FXO: setup deferred dialstring: %s\n",
c);
1097 const char *qual_var;
1146 ast_debug(1,
"Ignore possible polarity reversal on line seizure\n");
1165 c = strchr(dest,
'/');
1177 if (
errno != EINPROGRESS) {
1205 const char *cic =
"", *ozz =
"";
1219 ast_log(
LOG_WARNING,
"Unable to dial channel of type feature group D MF tandem access without CIC or OZZ set\n");
1304 ast_debug(1,
"Hangup: channel: %d index = %d, normal = %d, callwait = %d, thirdcall = %d\n",
1315 ast_debug(1,
"Normal call hung up with both three way call and a call waiting call in place?\n");
1318 ast_debug(1,
"We were flipped over to the callwait, moving back and not owning.\n");
1325 ast_debug(1,
"We were in the threeway and have a callwait still. Ditching the threeway.\n");
1331 ast_debug(1,
"Call was complete, setting owner to former third call\n");
1336 ast_debug(1,
"Call was incomplete, setting owner to NULL\n");
1365 ast_debug(1,
"Call was complete, setting owner to former third call\n");
1370 ast_debug(1,
"Call was incomplete, setting owner to NULL\n");
1536 ast_debug(1,
"Finally swapping real and threeway\n");
1597 ast_debug(1,
"%s DTMF digit: 0x%02X '%c' on %s\n",
1614 *dest = &p->
subs[idx].
f;
1618 ast_debug(1,
"Got some DTMF, but it's for the CAS\n");
1629 *dest = &p->
subs[idx].
f;
1649 if (strchr(term,
c)) {
1713#define ANALOG_NEED_MFDETECT(p) (((p)->sig == ANALOG_SIG_FEATDMF) || ((p)->sig == ANALOG_SIG_FEATDMF_TA) || ((p)->sig == ANALOG_SIG_E911) || ((p)->sig == ANALOG_SIG_FGC_CAMA) || ((p)->sig == ANALOG_SIG_FGC_CAMAMF) || ((p)->sig == ANALOG_SIG_FEATB))
1717 int extlen = strlen(exten);
1721 if (extlen < strlen(pickupexten) && !strncmp(pickupexten, exten, extlen)) {
1725 if (exten[0] ==
'*' && extlen < 3) {
1761 const char *pickupexten;
1792 ast_log(
LOG_ERROR,
"Unable to retrieve pickup configuration options. Unable to detect call pickup extension\n");
1795 pickupexten =
ast_strdupa(pickup_cfg->pickupexten);
1830 memset(dtmfbuf, 0,
sizeof(dtmfbuf));
1875 && (strlen(dtmfbuf) != 14)) {
1928 dtmfbuf[
len] =
'\0';
1931 timeout = analog_get_matchdigit_timeout(p);
1933 timeout = analog_get_interdigit_timeout(p);
1937 ast_debug(1,
"waitfordigit returned < 0...\n");
1941 dtmfbuf[
len++] = res;
1942 dtmfbuf[
len] =
'\0';
1954 }
else if (res < 0) {
1955 ast_debug(1,
"Got hung up before digits finished\n");
1978 ast_debug(1,
"cnoffset: %d\n", cnoffset);
1987 ast_debug(1,
"Sent wink to signal ANI start\n");
1999 if ((res > 0) || (strlen(anibuf) >= 2)) {
2000 char anistart[2] =
"X";
2002 if (strchr(
"#ABC", anibuf[strlen(anibuf) - 1])) {
2003 anistart[0] = anibuf[strlen(anibuf) - 1];
2004 anibuf[strlen(anibuf) - 1] = 0;
2010 caller->
ani2 = atoi(f);
2012 anibuf[cnoffset] = 0;
2028 if (exten[0] ==
'*') {
2033 s1 =
strsep(&stringp,
"*");
2034 s2 =
strsep(&stringp,
"*");
2050 if (exten[0] ==
'*') {
2057 s1 =
strsep(&stringp,
"#");
2058 s2 =
strsep(&stringp,
"#");
2075 caller->
ani2 = atoi(s1);
2081 if (exten[0] ==
'*') {
2086 s1 =
strsep(&stringp,
"#");
2087 s2 =
strsep(&stringp,
"#");
2088 if (s2 && (*(s2 + 1) ==
'0')) {
2099 ast_log(
LOG_WARNING,
"A KP was expected to start signaling for Feature Group C CAMA-MF, but we got something else. Received: %s on channel %d\n", exten, p->
channel);
2103 if (exten[0] ==
'*') {
2108 s1 =
strsep(&stringp,
"#");
2111 ast_log(
LOG_WARNING,
"A KP was expected to start signaling for Feature Group B, but we got something else. Received: %s on channel %d\n", exten, p->
channel);
2175 timeout = analog_get_firstdigit_timeout(p);
2183 int is_exten_parking = 0;
2194 ast_debug(1,
"waitfordigit returned < 0...\n");
2199 ast_debug(1,
"waitfordigit returned '%c' (%d), timeout = %d\n", res, res, timeout);
2224 memset(exten, 0,
sizeof(exten));
2257 timeout = analog_get_matchdigit_timeout(p);
2259 }
else if (res == 0) {
2260 ast_debug(1,
"not enough digits (and no ambiguous match)...\n");
2262 ast_debug(1,
"Nothing dialed at three-way dial tone, timed out to silent hold\n");
2269 }
else if (p->
callwaiting && !strcmp(exten,
"*70")) {
2279 memset(exten, 0,
sizeof(exten));
2280 timeout = analog_get_firstdigit_timeout(p);
2282 }
else if (!strcmp(exten, pickupexten)) {
2298 ast_debug(1,
"No call pickup possible...\n");
2312 }
else if (!p->
hidecallerid && !strcmp(exten,
"*67")) {
2324 memset(exten, 0,
sizeof(exten));
2325 timeout = analog_get_firstdigit_timeout(p);
2326 }
else if (p->
callreturn && !strcmp(exten,
"*69")) {
2335 }
else if (!strcmp(exten,
"*78")) {
2340 memset(exten, 0,
sizeof(exten));
2342 }
else if (!strcmp(exten,
"*79")) {
2347 memset(exten, 0,
sizeof(exten));
2352 memset(exten, 0,
sizeof(exten));
2355 ast_verb(3,
"Cancelling call forwarding on channel %d\n", p->
channel);
2359 memset(exten, 0,
sizeof(exten));
2372 if (bridge_channel) {
2396 memset(exten, 0,
sizeof(exten));
2411 memset(exten, 0,
sizeof(exten));
2412 timeout = analog_get_firstdigit_timeout(p);
2413 }
else if (!strcmp(exten,
"*0")) {
2420 if (pbridge &&
ISTRUNK(pbridge)) {
2426 "Unable to flash-hook bridged trunk from channel %s: %s\n",
2448 ast_debug(1,
"Can't match %s from '%s' in context %s\n", exten,
2455 timeout = analog_get_interdigit_timeout(p);
2468 if (smdi_msg !=
NULL) {
2471 if (smdi_msg->
type ==
'B')
2473 else if (smdi_msg->
type ==
'N')
2525 "DTMFCID timed out waiting for ring. Exiting simple switch\n");
2554 ast_debug(1,
"CID got string '%s'\n", dtmfbuf);
2570 int timeout = 10000;
2575 struct timeval off_start;
2585 "CallerID returned with error on channel '%s'\n",
2625 "CID timed out waiting for ring. Exiting simple switch\n");
2652 "Channel %s in prering state, but I have nothing to do. Terminating simple switch, should be restarted by the actual ring.\n",
2662 int timeout = 10000;
2666 int ring_data_idx = 0;
2677 "CallerID returned with error on channel '%s'\n",
2693 "Hanging up due to polarity reversal on channel %d while detecting callerid\n",
2706 ring_data[ring_data_idx] = p->
ringt;
2788 int data_size =
sizeof(*cause_code);
2789 char *subclass =
NULL;
2812 p->
subs[idx].
f.
src =
"dahdi_handle_event";
2814 f = &p->
subs[idx].
f;
2829 ast_debug(1,
"Dropping pulse digit '%c' because pulse dialing disabled on channel %d\n", res & 0xff, p->
channel);
2835 ast_debug(1,
"DTMF Down '%c'\n", res & 0xff);
2851 data_size += strlen(subclass);
2853 memset(cause_code, 0, data_size);
2856 snprintf(cause_code->
code, data_size -
sizeof(*cause_code) + 1,
"ANALOG %s", subclass);
2864 ast_verb(3,
"Channel %d echo canceller disabled due to CED detection\n", p->
channel);
2867#ifdef HAVE_DAHDI_ECHOCANCEL_FAX_MODE
2869 ast_verb(3,
"Channel %d detected a CED tone towards the network.\n", p->
channel);
2872 ast_verb(3,
"Channel %d detected a CED tone from the network.\n", p->
channel);
2875 ast_verb(3,
"Channel %d echo canceller disabled its NLP.\n", p->
channel);
2878 ast_verb(3,
"Channel %d echo canceller enabled its NLP.\n", p->
channel);
2915 ast_debug(1,
"Done dialing, but waiting for progress detection before doing more...\n");
2949 ast_debug(2,
"Letting this call hang up normally, since it's not the only call\n");
2961 ast_debug(2,
"Called Subscriber Held does not apply: not an incoming call\n");
3000 ast_verb(3,
"Channel %d still has (callwait) call, ringing phone\n", p->
channel);
3012 unsigned int mssinceflash;
3021 if (p->
owner != ast) {
3029 ast_debug(1,
"Last flash was %u ms ago\n", mssinceflash);
3033 ast_debug(1,
"Looks like a bounced flash, hanging up both calls on %d\n", p->
channel);
3120 return &p->
subs[idx].
f;
3165 return &p->
subs[idx].
f;
3172 return &p->
subs[idx].
f;
3292 ast_debug(1,
"Winkflash, index: %u, normal: %d, callwait: %d, thirdcall: %d\n",
3366 ast_debug(1,
"Flash when call not up or ringing\n");
3389 "Cannot allocate new call structure on channel %d\n",
3446 ast_debug(1,
"Got flash with three way call up, dropping last call on %d\n", p->
channel);
3464 ast_verb(3,
"Building conference call with %s and %s\n",
3518 ast_log(
LOG_WARNING,
"Received unexpected wink on channel of type ANALOG_SIG_FEATDMF_TA\n");
3583 ast_debug(1,
"Got hook complete in MF FGD, waiting for wink now on channel %d\n",p->
channel);
3613 ast_debug(1,
"Ignore Answer on polarity switch, channel %d\n", p->
channel);
3626 ast_debug(1,
"Ignore Hangup on polarity switch, channel %d\n", p->
channel);
3670 ast_debug(1,
"Polarity Reversal event occured - DEBUG 2: channel %d, state %u, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %" PRIi64
"\n", p->
channel,
ast_channel_state(ast), p->
polarity, p->
answeronpolarityswitch, p->
hanguponpolarityswitch, p->
polarityonanswerdelay,
ast_tvdiff_ms(
ast_tvnow(), p->
polaritydelaytv) );
3673 ast_debug(1,
"Dunno what to do with event %d on channel %d\n", res, p->
channel);
3675 return &p->
subs[idx].
f;
3698 p->
subs[idx].
f.
src =
"dahdi_exception";
3712 ast_debug(1,
"Restoring owner of channel %d on event %d\n", p->
channel, res);
3773 f = &p->
subs[idx].
f;
3778 if (ast != p->
owner) {
3780 f = &p->
subs[idx].
f;
3806 ast_debug(1,
"channel (%d) - signaling (%d) - event (%s)\n",
3819 ast_log(
LOG_WARNING,
"Can't start PBX immediately, must wait for Caller ID / distinctive ring\n");
3826 ast_debug(1,
"Disabling ring timeout (previously %d) to begin handling immediately\n", i->
ringt_base);
3850 if (res && (
errno == EBUSY)) {
3884 ast_log(
LOG_WARNING,
"Unable to play dialtone on channel %d, do you have defaultzone and loadzone defined?\n", i->
channel);
4019 ast_verb(2,
"Starting post polarity CID detection on channel %d\n",
4034 "handle_init_event detected polarity reversal on non-FXO (ANALOG_SIG_FXS) interface %d\n",
4046 ast_verb(2,
"Starting DTMF CID detection on channel %d\n",
4061 "handle_init_event detected dtmfcid generation event on non-FXO (ANALOG_SIG_FXS) interface %d\n",
4091 p->
sig = signallingtype;
4137 if (new_pvt->
owner == oldchan) {
4140 for (x = 0; x < 3; x++) {
4141 if (new_pvt->
subs[x].
owner == oldchan) {
4178 ast_verb(3,
"%s DND on channel %d\n",
4179 flag ?
"Enabled" :
"Disabled",
Persistent data storage (akin to *doze registry)
int ast_db_put(const char *family, const char *key, const char *value)
Store value addressed by family/key.
Asterisk main include file. File version handling, generic pbx functions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#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 ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
@ AST_BRIDGE_TRANSFER_SUCCESS
enum ast_transfer_result ast_bridge_transfer_attended(struct ast_channel *to_transferee, struct ast_channel *to_transfer_target)
Attended transfer.
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
#define AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED
void ast_shrink_phone_number(char *n)
Shrink a phone number in place to just digits (more accurately it just removes ()'s,...
void callerid_get_dtmf(char *cidstring, char *number, int *flags)
Get and parse DTMF-based callerid.
#define AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED
Internal Asterisk hangup causes.
#define AST_CAUSE_NETWORK_OUT_OF_ORDER
#define AST_CAUSE_NO_ANSWER
#define AST_CAUSE_NORMAL_CLEARING
#define AST_CC_GENERIC_MONITOR_TYPE
enum ast_cc_monitor_policies ast_get_cc_monitor_policy(struct ast_cc_config_params *config)
Get the cc_monitor_policy.
int ast_queue_cc_frame(struct ast_channel *chan, const char *const monitor_type, const char *const dialstring, enum ast_cc_service_type service, void *private_data)
Queue an AST_CONTROL_CC frame.
struct analog_callback analog_callbacks
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
const char * ast_channel_name(const struct ast_channel *chan)
void ast_channel_rings_set(struct ast_channel *chan, int value)
void * ast_channel_tech_pvt(const struct ast_channel *chan)
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
int ast_channel_rings(const struct ast_channel *chan)
#define ast_channel_lock(chan)
struct ast_party_redirecting * ast_channel_redirecting(struct ast_channel *chan)
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame without payload.
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
#define ast_channel_ref(c)
Increase channel reference count.
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
ast_callid ast_channel_callid(const struct ast_channel *chan)
const char * ast_channel_context(const struct ast_channel *chan)
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
#define ast_channel_trylock(chan)
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.
const char * ast_channel_appl(const struct ast_channel *chan)
void ast_set_callerid(struct ast_channel *chan, const char *cid_num, const char *cid_name, const char *cid_ani)
Set caller ID number, name and ANI and generate AMI event.
int ast_channel_fd(const struct ast_channel *chan, int which)
int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
Queue a hangup frame with hangupcause set.
void ast_set_hangupsource(struct ast_channel *chan, const char *source, int force)
Set the source of the hangup in this channel and it's bridge.
int ast_softhangup(struct ast_channel *chan, int cause)
Softly hangup up a channel.
void ast_channel_hangupcause_hash_set(struct ast_channel *chan, const struct ast_control_pvt_cause_code *cause_code, int datalen)
Sets the HANGUPCAUSE hash and optionally the SIP_CAUSE hash on the given channel.
int ast_queue_unhold(struct ast_channel *chan)
Queue an unhold frame.
int ast_queue_hold(struct ast_channel *chan, const char *musicclass)
Queue a hold frame.
#define ast_channel_unref(c)
Decrease channel reference count.
@ AST_SOFTHANGUP_EXPLICIT
const char * ast_channel_language(const struct ast_channel *chan)
struct ast_bridge_channel * ast_channel_get_bridge_channel(struct ast_channel *chan)
Get a reference to the channel's bridge pointer.
int ast_softhangup_nolock(struct ast_channel *chan, int cause)
Softly hangup up a channel (no channel lock)
struct ast_pbx * ast_channel_pbx(const struct ast_channel *chan)
int ast_channel_setoption(struct ast_channel *channel, int option, void *data, int datalen, int block)
Sets an option on a channel.
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
struct ast_cc_config_params * ast_channel_get_cc_config_params(struct ast_channel *chan)
Get the CCSS parameters from a channel.
#define ast_channel_unlock(chan)
#define AST_MAX_EXTENSION
ast_channel_state
ast_channel states
@ AST_STATE_DIALING_OFFHOOK
int ast_setstate(struct ast_channel *chan, enum ast_channel_state)
Change the state of a channel.
Call Parking and Pickup API Includes code and algorithms from the Zapata library.
Generic File Format Support. Should be included by clients of the file handling routines....
int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang)
Streams a file.
int ast_waitstream(struct ast_channel *c, const char *breakon)
Waits for a stream to stop or digit to be pressed.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
void ast_manager_publish_event(const char *type, int class_type, struct ast_json *obj)
Publish an event to AMI.
char * strsep(char **str, const char *delims)
struct ast_features_pickup_config * ast_get_chan_features_pickup_config(struct ast_channel *chan)
Get the pickup configuration options for a channel.
#define AST_OPTION_TONE_VERIFY
@ AST_CONTROL_PVT_CAUSE_CODE
struct ast_frame ast_null_frame
void ast_callid_threadstorage_auto_clean(ast_callid callid, int callid_created)
Use in conjunction with ast_callid_threadstorage_auto. Cleans up the references and if the callid was...
#define ast_debug(level,...)
Log a DEBUG message.
int ast_callid_threadassoc_add(ast_callid callid)
Adds a known callid to thread storage of the calling thread.
int ast_callid_threadstorage_auto(ast_callid *callid)
Checks thread storage for a callid and stores a reference if it exists. If not, then a new one will b...
#define ast_verb(level,...)
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define EVENT_FLAG_SYSTEM
Options provided by main asterisk program.
int ast_parking_blind_transfer_park(struct ast_bridge_channel *parker, const char *context, const char *exten, transfer_channel_cb parked_channel_cb, struct transfer_channel_data *parked_channel_data)
Perform a blind transfer to a parking extension.
int ast_parking_is_exten_park(const char *context, const char *exten)
Determine if the context/exten is a "parking" extension.
int ast_parking_provider_registered(void)
Check whether a parking provider is registered.
Core PBX routines and definitions.
enum ast_pbx_result ast_pbx_run(struct ast_channel *c)
Execute the PBX in the current thread.
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.
int ast_canmatch_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Looks for a valid matching extension.
int ast_ignore_pattern(const char *context, const char *pattern)
Checks to see if a number should be ignored.
int ast_matchmore_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Looks to see if adding anything to this extension might match something. (exists ^ canmatch)
int ast_pickup_call(struct ast_channel *chan)
Pickup a call.
struct stasis_forward * sub
Say numbers and dates (maybe words one day too)
int ast_say_digit_str(struct ast_channel *chan, const char *num, const char *ints, const char *lang)
says digits of a string
static const char * analog_get_orig_dialstring(struct analog_pvt *p)
static void analog_set_callwaiting(struct analog_pvt *p, int callwaiting_enable)
static void analog_publish_channel_alarm_clear(int channel)
static int analog_my_getsigstr(struct ast_channel *chan, char *str, const char *term, int ms)
static void analog_set_alarm(struct analog_pvt *p, int in_alarm)
static int _analog_get_index(struct ast_channel *ast, struct analog_pvt *p, int nullok, const char *fname, unsigned long line)
static int analog_stop_cid_detect(struct analog_pvt *p)
static char analog_defaultozz[64]
static int analog_alloc_sub(struct analog_pvt *p, enum analog_sub x)
int analog_hangup(struct analog_pvt *p, struct ast_channel *ast)
static int analog_send_callerid(struct analog_pvt *p, int cwcid, struct ast_party_caller *caller)
static void analog_set_confirmanswer(struct analog_pvt *p, int flag)
static int analog_update_conf(struct analog_pvt *p)
static void analog_unlock_private(struct analog_pvt *p)
static int analog_callwait(struct analog_pvt *p)
static void analog_set_outgoing(struct analog_pvt *p, int is_outgoing)
static int analog_dsp_reset_and_flush_digits(struct analog_pvt *p)
static void analog_cb_handle_dtmf(struct analog_pvt *p, struct ast_channel *ast, enum analog_sub analog_index, struct ast_frame **dest)
static void analog_increase_ss_count(void)
static int analog_unalloc_sub(struct analog_pvt *p, enum analog_sub x)
int analog_available(struct analog_pvt *p)
static char analog_defaultcic[64]
static void analog_publish_dnd_state(int channel, const char *status)
static int analog_is_off_hook(struct analog_pvt *p)
static void * analog_get_bridged_channel(struct ast_channel *chan)
static int analog_dial_digits(struct analog_pvt *p, enum analog_sub sub, struct analog_dialoperation *dop)
static int analog_handle_notify_message(struct ast_channel *chan, struct analog_pvt *p, int cid_flags, int neon_mwievent)
struct ast_frame * analog_exception(struct analog_pvt *p, struct ast_channel *ast)
#define gen_analog_field_callback(type, callback_name, def_value)
static void analog_set_new_owner(struct analog_pvt *p, struct ast_channel *new_owner)
static struct ast_frame * __analog_handle_event(struct analog_pvt *p, struct ast_channel *ast)
static struct ast_channel * analog_new_ast_channel(struct analog_pvt *p, int state, int startpbx, enum analog_sub sub, const struct ast_channel *requestor)
static int analog_canmatch_featurecode(const char *pickupexten, const char *exten)
static void * __analog_ss_thread(void *data)
static int analog_flash(struct analog_pvt *p)
static int analog_attempt_transfer(struct analog_pvt *p)
static void analog_set_needringing(struct analog_pvt *p, int value)
static int analog_set_linear_mode(struct analog_pvt *p, enum analog_sub sub, int linear_mode)
int analog_dnd(struct analog_pvt *p, int flag)
static const struct @141 sigtypes[]
static void analog_hangup_polarityswitch(struct analog_pvt *p)
static int analog_check_waitingfordt(struct analog_pvt *p)
static int analog_train_echocanceller(struct analog_pvt *p)
static void analog_set_dialing(struct analog_pvt *p, int is_dialing)
int analog_config_complete(struct analog_pvt *p)
static int analog_ring(struct analog_pvt *p)
static int analog_check_for_conference(struct analog_pvt *p)
void analog_handle_dtmf(struct analog_pvt *p, struct ast_channel *ast, enum analog_sub idx, struct ast_frame **dest)
static void analog_set_ringtimeout(struct analog_pvt *p, int ringt)
int analog_call(struct analog_pvt *p, struct ast_channel *ast, const char *rdest, int timeout)
void analog_delete(struct analog_pvt *doomed)
Delete the analog private structure.
static char * analog_event2str(enum analog_event event)
static void analog_set_cadence(struct analog_pvt *p, struct ast_channel *chan)
struct analog_pvt * analog_new(enum analog_sigtype signallingtype, void *private_data)
const char * analog_cidtype_to_str(unsigned int cid_type)
static void analog_lock_sub_owner(struct analog_pvt *pvt, enum analog_sub sub_idx)
static int analog_handles_digit(struct ast_frame *f)
void analog_free(struct analog_pvt *p)
static void analog_lock_private(struct analog_pvt *p)
int analog_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, void *newp)
static int analog_dsp_set_digitmode(struct analog_pvt *p, enum analog_dsp_digitmode mode)
static int analog_have_progressdetect(struct analog_pvt *p)
#define analog_get_index(ast, p, nullok)
enum analog_sigtype sigtype
static int analog_confmute(struct analog_pvt *p, int mute)
static void analog_answer_polarityswitch(struct analog_pvt *p)
static int analog_on_hook(struct analog_pvt *p)
static void analog_get_and_handle_alarms(struct analog_pvt *p)
static int analog_stop_callwait(struct analog_pvt *p)
static void analog_set_pulsedial(struct analog_pvt *p, int flag)
static int analog_start(struct analog_pvt *p)
static int analog_has_voicemail(struct analog_pvt *p)
static int analog_off_hook(struct analog_pvt *p)
static void analog_decrease_ss_count(void)
static const struct @142 cidtypes[]
static int analog_wait_event(struct analog_pvt *p)
const char * analog_cidstart_to_str(enum analog_cid_start cid_start)
static int analog_get_callerid(struct analog_pvt *p, char *name, char *number, enum analog_event *ev, size_t timeout)
struct ast_channel * analog_request(struct analog_pvt *p, int *callwait, const struct ast_channel *requestor)
void * analog_handle_init_event(struct analog_pvt *i, int event)
static int analog_play_tone(struct analog_pvt *p, enum analog_sub sub, enum analog_tone tone)
#define MIN_MS_SINCE_FLASH
static int analog_get_event(struct analog_pvt *p)
unsigned int analog_str_to_cidtype(const char *name)
static void analog_deadlock_avoidance_private(struct analog_pvt *p)
static int analog_set_echocanceller(struct analog_pvt *p, int enable)
static void analog_set_inthreeway(struct analog_pvt *p, enum analog_sub sub, int inthreeway)
int analog_answer(struct analog_pvt *p, struct ast_channel *ast)
static int analog_check_confirmanswer(struct analog_pvt *p)
static int analog_wink(struct analog_pvt *p, enum analog_sub index)
const char * analog_sigtype_to_str(enum analog_sigtype sigtype)
static int analog_is_dialing(struct analog_pvt *p, enum analog_sub index)
static void analog_cancel_cidspill(struct analog_pvt *p)
static int analog_start_cid_detect(struct analog_pvt *p, int cid_signalling)
static void analog_swap_subs(struct analog_pvt *p, enum analog_sub a, enum analog_sub b)
static void analog_set_waitingfordt(struct analog_pvt *p, struct ast_channel *ast)
static int analog_distinctive_ring(struct ast_channel *chan, struct analog_pvt *p, int idx, int *ringdata)
static void analog_all_subchannels_hungup(struct analog_pvt *p)
enum analog_sigtype analog_str_to_sigtype(const char *name)
int analog_ss_thread_start(struct analog_pvt *p, struct ast_channel *chan)
enum analog_cid_start analog_str_to_cidstart(const char *value)
#define ANALOG_NEED_MFDETECT(p)
static int analog_get_sub_fd(struct analog_pvt *p, enum analog_sub sub)
static void analog_start_polarityswitch(struct analog_pvt *p)
Interface header for analog signaling module.
#define ANALOG_INTER_DIGIT_TIMEOUT
Default time (ms) to detect following digits.
#define ANALOG_MATCH_DIGIT_TIMEOUT
Default time (ms) to wait, in case of ambiguous match.
#define ANALOG_SMDI_MD_WAIT_TIMEOUT
@ ANALOG_EVENT_HOOKCOMPLETE
@ ANALOG_EVENT_PULSE_START
@ ANALOG_EVENT_TX_CED_DETECTED
@ ANALOG_EVENT_NEONMWI_ACTIVE
@ ANALOG_EVENT_EC_DISABLED
@ ANALOG_EVENT_PULSEDIGIT
@ ANALOG_EVENT_RX_CED_DETECTED
@ ANALOG_EVENT_DIALCOMPLETE
@ ANALOG_EVENT_EC_NLP_ENABLED
@ ANALOG_EVENT_NEONMWI_INACTIVE
@ ANALOG_EVENT_EC_NLP_DISABLED
@ ANALOG_EVENT_RINGOFFHOOK
#define ANALOG_FIRST_DIGIT_TIMEOUT
Default time (ms) to detect first digit.
@ ANALOG_CID_START_DTMF_NOALERT
@ ANALOG_CID_START_POLARITY
@ ANALOG_CID_START_POLARITY_IN
struct ast_smdi_md_message * ast_smdi_md_message_wait(struct ast_smdi_interface *iface, int timeout)
Get the next SMDI message from the queue.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
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)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
int(*const stop_cid_detect)(void *pvt)
int(*const set_echocanceller)(void *pvt, int enable)
void(*const deadlock_avoidance_private)(void *pvt)
int(*const unallocate_sub)(void *pvt, enum analog_sub sub)
int(*const distinctive_ring)(struct ast_channel *chan, void *pvt, int idx, int *ringdata)
int(*const stop_callwait)(void *pvt)
void(*const set_confirmanswer)(void *pvt, int flag)
void(*const set_callwaiting)(void *pvt, int callwaiting_enable)
void(*const unlock_private)(void *pvt)
int(*const check_confirmanswer)(void *pvt)
const char *(*const get_orig_dialstring)(void *pvt)
void(*const set_cadence)(void *pvt, int *cidrings, struct ast_channel *chan)
int(*const have_progressdetect)(void *pvt)
void(*const hangup_polarityswitch)(void *pvt)
Switch FXS line polarity, based on answeronpolarityswitch and hanguponpolarityswitch.
int(*const is_off_hook)(void *pvt)
void(*const decrease_ss_count)(void)
int(*const is_dialing)(void *pvt, enum analog_sub sub)
int(*const train_echocanceller)(void *pvt)
void(*const set_pulsedial)(void *pvt, int flag)
int(*const check_waitingfordt)(void *pvt)
int(*const get_callerid)(void *pvt, char *name, char *num, enum analog_event *ev, size_t timeout)
int(*const conf_add)(void *pvt, enum analog_sub sub)
int(*const ring)(void *pvt)
void(*const handle_dtmf)(void *pvt, struct ast_channel *ast, enum analog_sub analog_index, struct ast_frame **dest)
int(*const flash)(void *pvt)
int(*const start_cid_detect)(void *pvt, int cid_signalling)
void(*const swap_subs)(void *pvt, enum analog_sub a, struct ast_channel *new_a_owner, enum analog_sub b, struct ast_channel *new_b_owner)
int(*const confmute)(void *pvt, int mute)
void(*const handle_notify_message)(struct ast_channel *chan, void *pvt, int cid_flags, int neon_mwievent)
int(*const set_linear_mode)(void *pvt, enum analog_sub sub, int linear_mode)
int(*const complete_conference_update)(void *pvt, int needconf)
void(*const set_outgoing)(void *pvt, int is_outgoing)
int(*const on_hook)(void *pvt)
Set channel on hook.
void(*const set_dialing)(void *pvt, int is_dialing)
void(*const answer_polarityswitch)(void *pvt)
Switch FXS line polarity, based on answeronpolarityswitch=yes.
int(*const dsp_set_digitmode)(void *pvt, enum analog_dsp_digitmode mode)
void(*const set_alarm)(void *pvt, int in_alarm)
void(*const set_new_owner)(void *pvt, struct ast_channel *new_owner)
int(*const send_callerid)(void *pvt, int cwcid, struct ast_party_caller *caller)
void(*const set_inthreeway)(void *pvt, enum analog_sub sub, int inthreeway)
void(*const increase_ss_count)(void)
void(*const cancel_cidspill)(void *pvt)
int(*const dial_digits)(void *pvt, enum analog_sub sub, struct analog_dialoperation *dop)
int(*const conf_del)(void *pvt, enum analog_sub sub)
int(*const has_voicemail)(void *pvt)
int(*const check_for_conference)(void *pvt)
int(*const allocate_sub)(void *pvt, enum analog_sub sub)
int(*const wink)(void *pvt, enum analog_sub sub)
int(*const off_hook)(void *pvt)
Set channel off hook.
int(*const dsp_reset_and_flush_digits)(void *pvt)
void(*const set_ringtimeout)(void *pvt, int ringt)
void(*const lock_private)(void *pvt)
void(*const all_subchannels_hungup)(void *pvt)
int(*const play_tone)(void *pvt, enum analog_sub sub, enum analog_tone tone)
void(*const get_and_handle_alarms)(void *pvt)
int(*const start)(void *pvt)
int(*const callwait)(void *pvt)
void(*const set_waitingfordt)(void *pvt, struct ast_channel *ast)
void(*const start_polarityswitch)(void *pvt)
Reset FXS line polarity to IDLE, based on answeronpolarityswitch and hanguponpolarityswitch.
struct ast_channel *(*const new_ast_channel)(void *pvt, int state, int startpbx, enum analog_sub sub, const struct ast_channel *requestor)
int(*const get_event)(void *pvt)
void(*const set_needringing)(void *pvt, int value)
void *(*const get_sigpvt_bridged_channel)(struct ast_channel *chan)
void(*const set_polarity)(void *pvt, int value)
Set FXS line polarity to 0=IDLE NZ=REVERSED.
int(*const get_sub_fd)(void *pvt, enum analog_sub sub)
int(*const wait_event)(void *pvt)
unsigned int immediatering
unsigned int threewaysilenthold
unsigned int permcallwaiting
unsigned int dahditrcallerid
struct analog_dialoperation dop
int polarityonanswerdelay
char cid_num[AST_MAX_EXTENSION]
unsigned int permhidecallerid
unsigned int callwaitingcallerid
unsigned int ani_wink_time
enum analog_sigtype outsigmod
unsigned int usedistinctiveringdetection
unsigned int answeronpolarityswitch
unsigned int threewaycalling
char callwait_num[AST_MAX_EXTENSION]
int msgstate
-1 = unknown, 0 = no messages, 1 = new messages available
struct timeval polaritydelaytv
unsigned int hanguponpolarityswitch
char call_forward[AST_MAX_EXTENSION]
enum analog_cid_start cid_start
unsigned int callwaitcas
TRUE if Call Waiting (CW) CPE Alert Signal (CAS) is being sent.
unsigned int hidecallerid
struct ast_channel * owner
unsigned int use_smdi
TRUE if SMDI (Simplified Message Desk Interface) is enabled.
char lastcid_name[AST_MAX_EXTENSION]
unsigned int call_qualifier
unsigned int ani_info_digits
enum analog_dialmode dialmode
unsigned int cancallforward
char lastcid_num[AST_MAX_EXTENSION]
struct analog_subchannel subs[3]
unsigned int transfertobusy
char cid_name[AST_MAX_EXTENSION]
unsigned int calledsubscriberheld
char mohsuggest[MAX_MUSICCLASS]
unsigned int use_callerid
struct ast_channel * ss_astchan
char callwait_name[AST_MAX_EXTENSION]
struct ast_smdi_interface * smdi_iface
The SMDI interface to get SMDI messages from.
struct ast_party_caller caller
struct ast_channel * owner
Structure that contains information regarding a channel in a bridge.
struct ast_channel * chan
Main Channel structure associated with a channel.
char exten[AST_MAX_EXTENSION]
struct ast_party_caller caller
Channel Caller ID information.
char chan_name[AST_CHANNEL_NAME]
Configuration relating to call pickup.
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, ...).
Caller Party information.
struct ast_party_id id
Caller party ID.
int ani2
Automatic Number Identification 2 (Info Digits)
struct ast_party_id ani
Automatic Number Identification (ANI)
struct ast_party_id id
Connected party ID.
struct ast_party_name name
Subscriber name.
struct ast_party_number number
Subscriber phone number.
int presentation
Q.931 encoded presentation-indicator encoded field.
unsigned char valid
TRUE if the name information is valid/present.
char * str
Subscriber name (Malloced)
int presentation
Q.931 presentation-indicator and screening-indicator encoded fields.
unsigned char valid
TRUE if the number information is valid/present.
char * str
Subscriber phone number (Malloced)
int code
enum AST_REDIRECTING_REASON value for redirection
struct ast_party_redirecting_reason reason
Reason for the redirection.
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
An SMDI message desk message.
char calling_st[SMDI_MAX_STATION_NUM_LEN+1]
char fwd_st[SMDI_MAX_STATION_NUM_LEN+1]
Support for dynamic strings.
int ast_remaining_ms(struct timeval start, int max_ms)
Calculate remaining milliseconds given a starting timestamp and upper bound.
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().
struct timeval ast_tv(ast_time_t sec, ast_suseconds_t usec)
Returns a timeval from sec, usec.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define ast_clear_flag(p, flag)
#define ast_pthread_create_detached(a, b, c, d)
#define ast_set_flag(p, flag)