Asterisk - The Open Source Telephony Project  GIT-master-9ed6387
Files | Functions
Dial plan applications

Applications support the dialplan. They register dynamically with. More...

Files

file  app_adsiprog.c
 Program Asterisk ADSI Scripts into phone.
 
file  app_alarmreceiver.c
 Central Station Alarm receiver for Ademco Contact ID.
 
file  app_amd.c
 Answering machine detection.
 
file  app_attended_transfer.c
 Attended transfer by caller channel.
 
file  app_audiosocket.c
 AudioSocket application – transmit and receive audio through a TCP socket.
 
file  app_authenticate.c
 Execute arbitrary authenticate commands.
 
file  app_blind_transfer.c
 Blind transfer by caller channel.
 
file  app_bridgeaddchan.c
 Application to place the channel into an existing Bridge.
 
file  app_bridgewait.c
 Application to place the channel into a holding Bridge.
 
file  app_cdr.c
 Applications connected with CDR engine.
 
file  app_celgenuserevent.c
 Generate User-Defined CEL event.
 
file  app_chanisavail.c
 Check if Channel is Available.
 
file  app_channelredirect.c
 ChannelRedirect application.
 
file  app_chanspy.c
 ChanSpy: Listen in on any channel.
 
file  app_confbridge.c
 Conference Bridge application.
 
file  app_controlplayback.c
 Trivial application to control playback of a sound file.
 
file  app_dahdiras.c
 Execute an ISDN RAS.
 
file  app_db.c
 Database access functions.
 
file  app_dial.c
 dial() & retrydial() - Trivial application to dial a channel and send an URL on answer
 
file  app_dictate.c
 Virtual Dictation Machine Application For Asterisk.
 
file  app_directed_pickup.c
 Directed Call Pickup Support.
 
file  app_directory.c
 Provide a directory of extensions.
 
file  app_disa.c
 DISA – Direct Inward System Access Application.
 
file  app_dumpchan.c
 Application to dump channel variables.
 
file  app_echo.c
 Echo application – play back what you hear to evaluate latency.
 
file  app_exec.c
 Exec application.
 
file  app_externalivr.c
 External IVR application interface.
 
file  app_festival.c
 Connect to festival.
 
file  app_flash.c
 App to flash a DAHDI trunk.
 
file  app_followme.c
 Find-Me Follow-Me application.
 
file  app_forkcdr.c
 Fork CDR application.
 
file  app_getcpeid.c
 Get ADSI CPE ID.
 
file  app_ices.c
 Stream to an icecast server via ICES (see contrib/asterisk-ices.xml)
 
file  app_image.c
 App to transmit an image.
 
file  app_ivrdemo.c
 IVR Demo application.
 
file  app_jack.c
 Jack Application.
 
file  app_macro.c
 Dial plan macro Implementation.
 
file  app_meetme.c
 Meet me conference bridge and Shared Line Appearances.
 
file  app_milliwatt.c
 Digital Milliwatt Test.
 
file  app_minivm.c
 MiniVoiceMail - A Minimal Voicemail System for Asterisk.
 
file  app_mixmonitor.c
 MixMonitor() - Record a call and mix the audio during the recording.
 
file  app_morsecode.c
 Morsecode application.
 
file  app_mp3.c
 Silly application to play an MP3 file – uses mpg123.
 
file  app_mysql.c
 MYSQL dialplan application.
 
file  app_nbscat.c
 Silly application to play an NBScat file – uses nbscat8k.
 
file  app_originate.c
 Originate application.
 
file  app_osplookup.c
 Open Settlement Protocol (OSP) Applications.
 
file  app_page.c
 page() - Paging application
 
file  app_playback.c
 Trivial application to playback a sound file.
 
file  app_playtones.c
 Playtones application.
 
file  app_privacy.c
 Block all calls without Caller*ID, require phone # to be entered.
 
file  app_queue.c
 True call queues with optional send URL on answer.
 
file  app_read.c
 Trivial application to read a variable.
 
file  app_readexten.c
 Trivial application to read an extension into a variable.
 
file  app_record.c
 Trivial application to record a sound file.
 
file  app_saycounted.c
 Applications to decline words according to current language.
 
file  app_sayunixtime.c
 SayUnixTime application.
 
file  app_senddtmf.c
 App to send DTMF digits.
 
file  app_sendtext.c
 App to transmit a text message.
 
file  app_skel.c
 Skeleton application.
 
file  app_sms.c
 SMS application - ETSI ES 201 912 protocol 1 implementation.
 
file  app_softhangup.c
 SoftHangup application.
 
file  app_speech_utils.c
 Speech Recognition Utility Applications.
 
file  app_stack.c
 Stack applications Gosub, Return, etc.
 
file  app_system.c
 Execute arbitrary system commands.
 
file  app_talkdetect.c
 Playback a file with audio detect.
 
file  app_test.c
 Applications to test connection and produce report in text file.
 
file  app_transfer.c
 Transfer a caller.
 
file  app_url.c
 App to transmit a URL.
 
file  app_userevent.c
 UserEvent application – send manager event.
 
file  app_verbose.c
 Verbose logging application.
 
file  app_voicemail.c
 Comedian Mail - Voicemail System.
 
file  app_waitforring.c
 Wait for Ring Application.
 
file  app_waitforsilence.c
 Wait for Silence.
 
file  app_waituntil.c
 Sleep until the given epoch.
 
file  app_while.c
 While Loop Implementation.
 
file  app_zapateller.c
 Playback the special information tone to get rid of telemarketers.
 
file  conf_state.c
 Confbridge state handling.
 
file  conf_state_empty.c
 Confbridge state handling for the EMPTY state.
 
file  conf_state_inactive.c
 Confbridge state handling for the INACTIVE state.
 
file  conf_state_multi.c
 Confbridge state handling for the MULTI state.
 
file  conf_state_multi_marked.c
 Confbridge state handling for the MULTI_MARKED state.
 
file  conf_state_single.c
 Confbridge state handling for the SINGLE state.
 
file  conf_state_single_marked.c
 Confbridge state handling for the SINGLE_MARKED state.
 
 
file  res_fax.c
 Generic FAX Resource for FAX technology resource modules.
 
file  res_format_attr_h263.c
 H.263 Format Attribute Module.
 
file  res_format_attr_h264.c
 H.264 Format Attribute Module.
 
file  res_realtime.c
 RealTime CLI.
 

Functions

static int iax2_prov_app (struct ast_channel *chan, const char *data)
 
int indicate_busy (struct ast_channel *chan, const char *data)
 
int indicate_congestion (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_answer (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_background (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_execiftime (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_goto (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_gotoiftime (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_hangup (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_proceeding (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_progress (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_ringing (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_setamaflags (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_wait (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_waitdigit (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_waitexten (struct ast_channel *chan, const char *data)
 

Detailed Description

Applications support the dialplan. They register dynamically with.

Asterisk Dial Plan Applications

See also
ast_register_application() and unregister with
ast_unregister_application()
See also

Function Documentation

◆ iax2_prov_app()

static int iax2_prov_app ( struct ast_channel chan,
const char *  data 
)
static

iax2provision

Definition at line 12234 of file chan_iax2.c.

References ast_channel_tech(), ast_channel_tech_pvt(), ast_log, ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_strdupa, ast_strlen_zero, ast_verb, iax2_provision(), LOG_NOTICE, NULL, and PTR_TO_CALLNO.

Referenced by load_module().

12235 {
12236  int res;
12237  char *sdata;
12238  char *opts;
12239  int force =0;
12240  unsigned short callno = PTR_TO_CALLNO(ast_channel_tech_pvt(chan));
12241  if (ast_strlen_zero(data))
12242  data = "default";
12243  sdata = ast_strdupa(data);
12244  opts = strchr(sdata, '|');
12245  if (opts)
12246  *opts='\0';
12247 
12248  if (ast_channel_tech(chan) != &iax2_tech) {
12249  ast_log(LOG_NOTICE, "Can't provision a non-IAX device!\n");
12250  return -1;
12251  }
12252  if (!callno || !iaxs[callno] || ast_sockaddr_isnull(&iaxs[callno]->addr)) {
12253  ast_log(LOG_NOTICE, "Can't provision something with no IP?\n");
12254  return -1;
12255  }
12256  res = iax2_provision(&iaxs[callno]->addr, iaxs[callno]->sockfd, NULL, sdata, force);
12257  ast_verb(3, "Provisioned IAXY at '%s' with '%s'= %d\n",
12258  ast_sockaddr_stringify(&iaxs[callno]->addr),
12259  sdata, res);
12260  return res;
12261 }
void * ast_channel_tech_pvt(const struct ast_channel *chan)
#define NULL
Definition: resample.c:96
#define ast_verb(level,...)
Definition: logger.h:455
static int ast_sockaddr_isnull(const struct ast_sockaddr *addr)
Checks if the ast_sockaddr is null. "null" in this sense essentially means uninitialized, or having a 0 length.
Definition: netsock2.h:127
#define ast_log
Definition: astobj2.c:42
#define PTR_TO_CALLNO(a)
Definition: chan_iax2.c:289
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
static struct chan_iax2_pvt * iaxs[IAX_MAX_CALLS]
an array of iax2 pvt structures
Definition: chan_iax2.c:1125
static int iax2_provision(struct ast_sockaddr *end, int sockfd, const char *dest, const char *template, int force)
Definition: chan_iax2.c:12182
static char * ast_sockaddr_stringify(const struct ast_sockaddr *addr)
Wrapper around ast_sockaddr_stringify_fmt() with default format.
Definition: netsock2.h:260
static struct ast_channel_tech iax2_tech
Definition: chan_iax2.c:1293
#define LOG_NOTICE
Definition: logger.h:263
#define ast_strlen_zero(a)
Definition: muted.c:73
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)

◆ indicate_busy()

int indicate_busy ( struct ast_channel chan,
const char *  data 
)

Definition at line 708 of file pbx_builtins.c.

References AST_CAUSE_BUSY, ast_channel_hangupcause_set(), ast_channel_lock, ast_channel_unlock, AST_CONTROL_BUSY, ast_indicate(), ast_setstate(), AST_STATE_BUSY, AST_STATE_UP, and wait_for_hangup().

Referenced by __ast_pbx_run().

709 {
711  /* Don't change state of an UP channel, just indicate
712  busy in audio */
713  ast_channel_lock(chan);
714  if (ast_channel_state(chan) != AST_STATE_UP) {
717  }
718  ast_channel_unlock(chan);
719  wait_for_hangup(chan, data);
720  return -1;
721 }
#define ast_channel_lock(chan)
Definition: channel.h:2837
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
Definition: channel.c:4271
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
ast_channel_state
ast_channel states
Definition: channelstate.h:35
void wait_for_hangup(struct ast_channel *chan, const void *data)
Definition: pbx.c:8248
#define ast_channel_unlock(chan)
Definition: channel.h:2838
int ast_setstate(struct ast_channel *chan, enum ast_channel_state)
Change the state of a channel.
Definition: channel.c:7325
#define AST_CAUSE_BUSY
Definition: causes.h:148

◆ indicate_congestion()

int indicate_congestion ( struct ast_channel ,
const char *   
)

pbx_builtins.c functions needed by pbx.c

Definition at line 726 of file pbx_builtins.c.

References AST_CAUSE_CONGESTION, ast_channel_hangupcause_set(), ast_channel_lock, ast_channel_unlock, AST_CONTROL_CONGESTION, ast_indicate(), ast_setstate(), AST_STATE_BUSY, AST_STATE_UP, and wait_for_hangup().

Referenced by __ast_pbx_run().

727 {
729  /* Don't change state of an UP channel, just indicate
730  congestion in audio */
731  ast_channel_lock(chan);
732  if (ast_channel_state(chan) != AST_STATE_UP) {
735  }
736  ast_channel_unlock(chan);
737  wait_for_hangup(chan, data);
738  return -1;
739 }
#define ast_channel_lock(chan)
Definition: channel.h:2837
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
Definition: channel.c:4271
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
ast_channel_state
ast_channel states
Definition: channelstate.h:35
void wait_for_hangup(struct ast_channel *chan, const void *data)
Definition: pbx.c:8248
#define ast_channel_unlock(chan)
Definition: channel.h:2838
int ast_setstate(struct ast_channel *chan, enum ast_channel_state)
Change the state of a channel.
Definition: channel.c:7325
#define AST_CAUSE_CONGESTION
Definition: causes.h:152

◆ pbx_builtin_answer()

static int pbx_builtin_answer ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 744 of file pbx_builtins.c.

References __ast_answer(), args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_LOG_WARNING, AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_strdupa, ast_strlen_zero, and parse().

745 {
746  int delay = 0;
747  char *parse;
749  AST_APP_ARG(delay);
750  AST_APP_ARG(answer_cdr);
751  );
752 
753  if (ast_strlen_zero(data)) {
754  return __ast_answer(chan, 0);
755  }
756 
757  parse = ast_strdupa(data);
758 
759  AST_STANDARD_APP_ARGS(args, parse);
760 
761  if (!ast_strlen_zero(args.delay) && (ast_channel_state(chan) != AST_STATE_UP))
762  delay = atoi(data);
763 
764  if (delay < 0) {
765  delay = 0;
766  }
767 
768  if (!ast_strlen_zero(args.answer_cdr) && !strcasecmp(args.answer_cdr, "nocdr")) {
769  ast_log(AST_LOG_WARNING, "The nocdr option for the Answer application has been removed and is no longer supported.\n");
770  }
771 
772  return __ast_answer(chan, delay);
773 }
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the &#39;standard&#39; argument separation process for an application.
#define AST_LOG_WARNING
Definition: logger.h:279
ast_channel_state
ast_channel states
Definition: channelstate.h:35
const char * args
#define ast_log
Definition: astobj2.c:42
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
int __ast_answer(struct ast_channel *chan, unsigned int delay)
Answer a channel, with a selectable delay before returning.
Definition: channel.c:2670
#define ast_strlen_zero(a)
Definition: muted.c:73
static void parse(struct mgcp_request *req)
Definition: chan_mgcp.c:1872
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application&#39;s arguments.
#define AST_APP_ARG(name)
Define an application argument.

◆ pbx_builtin_background()

static int pbx_builtin_background ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 1113 of file pbx_builtins.c.

References args, ast_answer(), AST_APP_ARG, ast_app_parse_options(), ast_canmatch_extension(), ast_channel_caller(), ast_channel_context(), ast_channel_context_set(), ast_channel_exten_set(), ast_channel_flags(), ast_channel_language(), ast_channel_lock, ast_channel_name(), ast_channel_priority_set(), ast_channel_unlock, AST_DECLARE_APP_ARGS, AST_DIGIT_ANY, AST_FLAG_DISABLE_WORKAROUNDS, ast_log, ast_matchmore_extension(), AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_stopstream(), ast_strdupa, ast_streamfile(), ast_strip(), ast_strlen_zero, ast_test_flag, ast_waitstream(), ast_waitstream_exten(), BACKGROUND_MATCHEXTEN, BACKGROUND_NOANSWER, background_opts, BACKGROUND_PLAYBACK, BACKGROUND_SKIP, buf, context, done, exten, ast_flags::flags, LOG_WARNING, NULL, options, parse(), pbx_builtin_getvar_helper(), pbx_builtin_setvar_helper(), S_COR, and strsep().

1114 {
1115  int res = 0;
1116  int mres = 0;
1117  struct ast_flags flags = {0};
1118  char *parse, exten[2] = "";
1120  AST_APP_ARG(filename);
1122  AST_APP_ARG(lang);
1124  );
1125 
1126  if (ast_strlen_zero(data)) {
1127  ast_log(LOG_WARNING, "Background requires an argument (filename)\n");
1128  return -1;
1129  }
1130 
1131  parse = ast_strdupa(data);
1132 
1133  AST_STANDARD_APP_ARGS(args, parse);
1134 
1135  if (ast_strlen_zero(args.lang))
1136  args.lang = (char *)ast_channel_language(chan); /* XXX this is const */
1137 
1138  if (ast_strlen_zero(args.context)) {
1139  const char *context;
1140  ast_channel_lock(chan);
1141  if ((context = pbx_builtin_getvar_helper(chan, "MACRO_CONTEXT"))) {
1142  args.context = ast_strdupa(context);
1143  } else {
1144  args.context = ast_strdupa(ast_channel_context(chan));
1145  }
1146  ast_channel_unlock(chan);
1147  }
1148 
1149  if (args.options) {
1150  if (!strcasecmp(args.options, "skip"))
1151  flags.flags = BACKGROUND_SKIP;
1152  else if (!strcasecmp(args.options, "noanswer"))
1153  flags.flags = BACKGROUND_NOANSWER;
1154  else
1155  ast_app_parse_options(background_opts, &flags, NULL, args.options);
1156  }
1157 
1158  /* Answer if need be */
1159  if (ast_channel_state(chan) != AST_STATE_UP) {
1160  if (ast_test_flag(&flags, BACKGROUND_SKIP)) {
1161  goto done;
1162  } else if (!ast_test_flag(&flags, BACKGROUND_NOANSWER)) {
1163  res = ast_answer(chan);
1164  }
1165  }
1166 
1167  if (!res) {
1168  char *back = ast_strip(args.filename);
1169  char *front;
1170 
1171  ast_stopstream(chan); /* Stop anything playing */
1172  /* Stream the list of files */
1173  while (!res && (front = strsep(&back, "&")) ) {
1174  if ( (res = ast_streamfile(chan, front, args.lang)) ) {
1175  ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", ast_channel_name(chan), (char*)data);
1176  res = 0;
1177  mres = 1;
1178  break;
1179  }
1180  if (ast_test_flag(&flags, BACKGROUND_PLAYBACK)) {
1181  res = ast_waitstream(chan, "");
1182  } else if (ast_test_flag(&flags, BACKGROUND_MATCHEXTEN)) {
1183  res = ast_waitstream_exten(chan, args.context);
1184  } else {
1185  res = ast_waitstream(chan, AST_DIGIT_ANY);
1186  }
1187  ast_stopstream(chan);
1188  }
1189  }
1190 
1191  /* If ast_waitstream didn't give us back a digit, there is nothing else to do */
1192  if (res <= 0) {
1193  goto done;
1194  }
1195 
1196  exten[0] = res;
1197 
1198  /*
1199  * If the single digit DTMF is an extension in the specified context, then
1200  * go there and signal no DTMF. Otherwise, we should exit with that DTMF.
1201  * If we're in Macro, we'll exit and seek that DTMF as the beginning of an
1202  * extension in the Macro's calling context. If we're not in Macro, then
1203  * we'll simply seek that extension in the calling context. Previously,
1204  * someone complained about the behavior as it related to the interior of a
1205  * Gosub routine, and the fix (#14011) inadvertently broke FreePBX
1206  * (#14940). This change should fix both of these situations, but with the
1207  * possible incompatibility that if a single digit extension does not exist
1208  * (but a longer extension COULD have matched), it would have previously
1209  * gone immediately to the "i" extension, but will now need to wait for a
1210  * timeout.
1211  *
1212  * Later, we had to add a flag to disable this workaround, because AGI
1213  * users can EXEC Background and reasonably expect that the DTMF code will
1214  * be returned (see #16434).
1215  */
1217  && ast_canmatch_extension(chan, args.context, exten, 1,
1218  S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))
1219  && !ast_matchmore_extension(chan, args.context, exten, 1,
1220  S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
1221  char buf[2] = { 0, };
1222  snprintf(buf, sizeof(buf), "%c", res);
1223  ast_channel_exten_set(chan, buf);
1224  ast_channel_context_set(chan, args.context);
1225  ast_channel_priority_set(chan, 0);
1226  res = 0;
1227  }
1228 done:
1229  pbx_builtin_setvar_helper(chan, "BACKGROUNDSTATUS", mres ? "FAILED" : "SUCCESS");
1230  return res;
1231 }
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
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) ...
Definition: pbx.c:4190
#define ast_channel_lock(chan)
Definition: channel.h:2837
static char exten[AST_MAX_EXTENSION]
Definition: chan_alsa.c:118
int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang)
Streams a file.
Definition: file.c:1250
#define BACKGROUND_MATCHEXTEN
Definition: pbx_builtins.c:654
#define AST_DIGIT_ANY
Definition: file.h:48
#define ast_test_flag(p, flag)
Definition: utils.h:63
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the &#39;standard&#39; argument separation process for an application.
#define LOG_WARNING
Definition: logger.h:274
unsigned int flags
Definition: utils.h:200
ast_channel_state
ast_channel states
Definition: channelstate.h:35
const char * args
#define NULL
Definition: resample.c:96
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.
Definition: pbx.c:4185
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 done
Definition: test_amihooks.c:48
Number structure.
Definition: app_followme.c:154
#define ast_log
Definition: astobj2.c:42
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
Definition: strings.h:219
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
Definition: strings.h:85
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
static const struct ast_app_option background_opts[128]
Definition: pbx_builtins.c:662
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.
Definition: main/app.c:2829
#define BACKGROUND_PLAYBACK
Definition: pbx_builtins.c:655
#define BACKGROUND_SKIP
Definition: pbx_builtins.c:652
#define ast_strlen_zero(a)
Definition: muted.c:73
#define ast_channel_unlock(chan)
Definition: channel.h:2838
static void parse(struct mgcp_request *req)
Definition: chan_mgcp.c:1872
Structure used to handle boolean flags.
Definition: utils.h:199
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
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...
char * strsep(char **str, const char *delims)
void ast_channel_context_set(struct ast_channel *chan, const char *value)
const char * ast_channel_name(const struct ast_channel *chan)
int ast_waitstream(struct ast_channel *c, const char *breakon)
Waits for a stream to stop or digit to be pressed.
Definition: file.c:1775
int ast_answer(struct ast_channel *chan)
Answer a channel.
Definition: channel.c:2780
const char * ast_channel_language(const struct ast_channel *chan)
#define BACKGROUND_NOANSWER
Definition: pbx_builtins.c:653
const char * ast_channel_context(const struct ast_channel *chan)
static struct test_options options
static char context[AST_MAX_CONTEXT]
Definition: chan_alsa.c:116
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
void ast_channel_priority_set(struct ast_channel *chan, int value)
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application&#39;s arguments.
int ast_stopstream(struct ast_channel *c)
Stops a stream.
Definition: file.c:187
int ast_waitstream_exten(struct ast_channel *c, const char *context)
Waits for a stream to stop or digit matching a valid one digit exten to be pressed.
Definition: file.c:1794
#define AST_APP_ARG(name)
Define an application argument.

◆ pbx_builtin_execiftime()

static int pbx_builtin_execiftime ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 928 of file pbx_builtins.c.

References app, ast_build_timing(), ast_check_timing(), ast_destroy_timing(), ast_log, ast_strdupa, ast_strlen_zero, LOG_WARNING, pbx_exec(), pbx_findapp(), S_OR, strsep(), and usage.

929 {
930  char *s, *appname;
931  struct ast_timing timing;
932  struct ast_app *app;
933  static const char * const usage = "ExecIfTime requires an argument:\n <time range>,<days of week>,<days of month>,<months>[,<timezone>]?<appname>[(<appargs>)]";
934 
935  if (ast_strlen_zero(data)) {
936  ast_log(LOG_WARNING, "%s\n", usage);
937  return -1;
938  }
939 
940  appname = ast_strdupa(data);
941 
942  s = strsep(&appname, "?"); /* Separate the timerange and application name/data */
943  if (!appname) { /* missing application */
944  ast_log(LOG_WARNING, "%s\n", usage);
945  return -1;
946  }
947 
948  if (!ast_build_timing(&timing, s)) {
949  ast_log(LOG_WARNING, "Invalid Time Spec: %s\nCorrect usage: %s\n", s, usage);
950  ast_destroy_timing(&timing);
951  return -1;
952  }
953 
954  if (!ast_check_timing(&timing)) { /* outside the valid time window, just return */
955  ast_destroy_timing(&timing);
956  return 0;
957  }
958  ast_destroy_timing(&timing);
959 
960  /* now split appname(appargs) */
961  if ((s = strchr(appname, '('))) {
962  char *e;
963  *s++ = '\0';
964  if ((e = strrchr(s, ')')))
965  *e = '\0';
966  else
967  ast_log(LOG_WARNING, "Failed to find closing parenthesis\n");
968  }
969 
970 
971  if ((app = pbx_findapp(appname))) {
972  return pbx_exec(chan, app, S_OR(s, ""));
973  } else {
974  ast_log(LOG_WARNING, "Cannot locate application %s\n", appname);
975  return -1;
976  }
977 }
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data)
Execute an application.
Definition: pbx_app.c:471
#define LOG_WARNING
Definition: logger.h:274
#define ast_log
Definition: astobj2.c:42
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
char * usage
Definition: utils/frame.c:37
int ast_check_timing(const struct ast_timing *i)
Evaluate a pre-constructed bitmap as to whether the current time falls within the range specified...
Definition: extconf.c:4002
#define ast_strlen_zero(a)
Definition: muted.c:73
int ast_destroy_timing(struct ast_timing *i)
Deallocates memory structures associated with a timing bitmap.
Definition: pbx_timing.c:285
int ast_build_timing(struct ast_timing *i, const char *info)
Construct a timing bitmap, for use in time-based conditionals.
Definition: extconf.c:3808
char * strsep(char **str, const char *delims)
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
Definition: strings.h:79
ast_app: A registered application
Definition: pbx_app.c:45
struct ast_app * pbx_findapp(const char *app)
Look up an application.
Definition: ael_main.c:165
static const char app[]
Definition: app_mysql.c:62

◆ pbx_builtin_goto()

static int pbx_builtin_goto ( struct ast_channel chan,
const char *  data 
)
static

Goto

Definition at line 863 of file pbx_builtins.c.

References ast_channel_context(), ast_channel_exten(), ast_channel_priority(), ast_parseable_goto(), and ast_verb.

Referenced by pbx_builtin_gotoif(), and pbx_builtin_gotoiftime().

864 {
865  int res = ast_parseable_goto(chan, data);
866  if (!res)
867  ast_verb(3, "Goto (%s,%s,%d)\n", ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan) + 1);
868  return res;
869 }
int ast_channel_priority(const struct ast_channel *chan)
#define ast_verb(level,...)
Definition: logger.h:455
int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
Definition: pbx.c:8840
const char * ast_channel_exten(const struct ast_channel *chan)
const char * ast_channel_context(const struct ast_channel *chan)

◆ pbx_builtin_gotoiftime()

static int pbx_builtin_gotoiftime ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 874 of file pbx_builtins.c.

References ast_build_timing(), ast_channel_lock, ast_channel_unlock, ast_check_timing2(), ast_debug, ast_destroy_timing(), ast_log, ast_strdupa, ast_strlen_zero, ast_tvnow(), LOG_WARNING, NULL, pbx_builtin_getvar_helper(), pbx_builtin_goto(), pbx_builtin_setvar_helper(), and strsep().

875 {
876  char *s, *ts, *branch1, *branch2, *branch;
877  struct ast_timing timing;
878  const char *ctime;
879  struct timeval tv = ast_tvnow();
880  long timesecs;
881 
882  if (!chan) {
883  ast_log(LOG_WARNING, "GotoIfTime requires a channel on which to operate\n");
884  return -1;
885  }
886 
887  if (ast_strlen_zero(data)) {
888  ast_log(LOG_WARNING, "GotoIfTime requires an argument:\n <time range>,<days of week>,<days of month>,<months>[,<timezone>]?'labeliftrue':'labeliffalse'\n");
889  return -1;
890  }
891 
892  ts = s = ast_strdupa(data);
893 
894  ast_channel_lock(chan);
895  if ((ctime = pbx_builtin_getvar_helper(chan, "TESTTIME")) && sscanf(ctime, "%ld", &timesecs) == 1) {
896  tv.tv_sec = timesecs;
897  } else if (ctime) {
898  ast_log(LOG_WARNING, "Using current time to evaluate\n");
899  /* Reset when unparseable */
900  pbx_builtin_setvar_helper(chan, "TESTTIME", NULL);
901  }
902  ast_channel_unlock(chan);
903 
904  /* Separate the Goto path */
905  strsep(&ts, "?");
906  branch1 = strsep(&ts,":");
907  branch2 = strsep(&ts,"");
908 
909  /* struct ast_include include contained garbage here, fixed by zeroing it on get_timerange */
910  if (ast_build_timing(&timing, s) && ast_check_timing2(&timing, tv)) {
911  branch = branch1;
912  } else {
913  branch = branch2;
914  }
915  ast_destroy_timing(&timing);
916 
917  if (ast_strlen_zero(branch)) {
918  ast_debug(1, "Not taking any branch\n");
919  return 0;
920  }
921 
922  return pbx_builtin_goto(chan, branch);
923 }
#define ast_channel_lock(chan)
Definition: channel.h:2837
int ast_check_timing2(const struct ast_timing *i, const struct timeval tv)
Evaluate a pre-constructed bitmap as to whether a particular time falls within the range specified...
Definition: pbx_timing.c:251
#define LOG_WARNING
Definition: logger.h:274
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition: time.h:150
#define NULL
Definition: resample.c:96
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
#define ast_debug(level,...)
Log a DEBUG message.
Definition: logger.h:444
#define ast_log
Definition: astobj2.c:42
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
#define ast_strlen_zero(a)
Definition: muted.c:73
int ast_destroy_timing(struct ast_timing *i)
Deallocates memory structures associated with a timing bitmap.
Definition: pbx_timing.c:285
#define ast_channel_unlock(chan)
Definition: channel.h:2838
int ast_build_timing(struct ast_timing *i, const char *info)
Construct a timing bitmap, for use in time-based conditionals.
Definition: extconf.c:3808
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...
char * strsep(char **str, const char *delims)
static int pbx_builtin_goto(struct ast_channel *chan, const char *data)
Definition: pbx_builtins.c:863

◆ pbx_builtin_hangup()

static int pbx_builtin_hangup ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 828 of file pbx_builtins.c.

References AST_CAUSE_NORMAL_CLEARING, ast_channel_hangupcause(), ast_channel_hangupcause_set(), ast_channel_lock, ast_channel_unlock, ast_log, ast_set_hangupsource(), AST_SOFTHANGUP_EXPLICIT, ast_softhangup_nolock(), ast_str2cause(), ast_strlen_zero, and LOG_WARNING.

829 {
830  int cause;
831 
832  ast_set_hangupsource(chan, "dialplan/builtin", 0);
833 
834  if (!ast_strlen_zero(data)) {
835  cause = ast_str2cause(data);
836  if (cause <= 0) {
837  if (sscanf(data, "%30d", &cause) != 1 || cause <= 0) {
838  ast_log(LOG_WARNING, "Invalid cause given to Hangup(): \"%s\"\n", data);
839  cause = 0;
840  }
841  }
842  } else {
843  cause = 0;
844  }
845 
846  ast_channel_lock(chan);
847  if (cause <= 0) {
848  cause = ast_channel_hangupcause(chan);
849  if (cause <= 0) {
851  }
852  }
853  ast_channel_hangupcause_set(chan, cause);
855  ast_channel_unlock(chan);
856 
857  return -1;
858 }
#define ast_channel_lock(chan)
Definition: channel.h:2837
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
#define LOG_WARNING
Definition: logger.h:274
#define ast_log
Definition: astobj2.c:42
void ast_set_hangupsource(struct ast_channel *chan, const char *source, int force)
Set the source of the hangup in this channel and it&#39;s bridge.
Definition: channel.c:2479
#define AST_CAUSE_NORMAL_CLEARING
Definition: causes.h:105
int ast_softhangup_nolock(struct ast_channel *chan, int reason)
Softly hangup up a channel (no channel lock)
Definition: channel.c:2438
#define ast_strlen_zero(a)
Definition: muted.c:73
#define ast_channel_unlock(chan)
Definition: channel.h:2838
int ast_channel_hangupcause(const struct ast_channel *chan)
int ast_str2cause(const char *name) attribute_pure
Convert the string form of a cause code to a number.
Definition: channel.c:621

◆ pbx_builtin_proceeding()

static int pbx_builtin_proceeding ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 681 of file pbx_builtins.c.

References AST_CONTROL_PROCEEDING, and ast_indicate().

682 {
684  return 0;
685 }
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
Definition: channel.c:4271

◆ pbx_builtin_progress()

static int pbx_builtin_progress ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 690 of file pbx_builtins.c.

References AST_CONTROL_PROGRESS, and ast_indicate().

691 {
693  return 0;
694 }
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
Definition: channel.c:4271

◆ pbx_builtin_ringing()

static int pbx_builtin_ringing ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 699 of file pbx_builtins.c.

References AST_CONTROL_RINGING, and ast_indicate().

700 {
702  return 0;
703 }
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
Definition: channel.c:4271

◆ pbx_builtin_setamaflags()

static int pbx_builtin_setamaflags ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 800 of file pbx_builtins.c.

References amaflags, ast_channel_amaflags_set(), ast_channel_lock, ast_channel_name(), ast_channel_string2amaflag(), ast_channel_unlock, ast_log, AST_LOG_WARNING, and ast_strlen_zero.

801 {
802  ast_log(AST_LOG_WARNING, "The SetAMAFlags application is deprecated. Please use the CHANNEL function instead.\n");
803 
804  if (ast_strlen_zero(data)) {
805  ast_log(AST_LOG_WARNING, "No parameter passed to SetAMAFlags\n");
806  return 0;
807  }
808  /* Copy the AMA Flags as specified */
809  ast_channel_lock(chan);
810  if (isdigit(data[0])) {
811  int amaflags;
812  if (sscanf(data, "%30d", &amaflags) != 1) {
813  ast_log(AST_LOG_WARNING, "Unable to set AMA flags on channel %s\n", ast_channel_name(chan));
814  ast_channel_unlock(chan);
815  return 0;
816  }
817  ast_channel_amaflags_set(chan, amaflags);
818  } else {
820  }
821  ast_channel_unlock(chan);
822  return 0;
823 }
#define ast_channel_lock(chan)
Definition: channel.h:2837
static int amaflags
Definition: chan_iax2.c:432
#define AST_LOG_WARNING
Definition: logger.h:279
enum ama_flags ast_channel_string2amaflag(const char *flag)
Convert a string to a detail record AMA flag.
Definition: channel.c:4354
#define ast_log
Definition: astobj2.c:42
void ast_channel_amaflags_set(struct ast_channel *chan, enum ama_flags value)
#define ast_strlen_zero(a)
Definition: muted.c:73
#define ast_channel_unlock(chan)
Definition: channel.h:2838
const char * ast_channel_name(const struct ast_channel *chan)

◆ pbx_builtin_wait()

static int pbx_builtin_wait ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 982 of file pbx_builtins.c.

References ast_app_parse_timelen(), ast_safe_sleep(), and TIMELEN_SECONDS.

983 {
984  int ms;
985 
986  /* Wait for "n" seconds */
987  if (!ast_app_parse_timelen(data, &ms, TIMELEN_SECONDS) && ms > 0) {
988  return ast_safe_sleep(chan, ms);
989  }
990  return 0;
991 }
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
Definition: channel.c:1554
int ast_app_parse_timelen(const char *timestr, int *result, enum ast_timelen defunit)
Common routine to parse time lengths, with optional time unit specifier.
Definition: main/app.c:3036

◆ pbx_builtin_waitdigit()

static int pbx_builtin_waitdigit ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 996 of file pbx_builtins.c.

References args, AST_APP_ARG, ast_app_parse_timelen(), AST_DECLARE_APP_ARGS, AST_DIGIT_ANY, AST_STANDARD_APP_ARGS, ast_strdupa, ast_waitfordigit_full(), parse(), pbx_builtin_setvar_helper(), S_OR, TIMELEN_SECONDS, and timeout.

997 {
998  int res;
999  int ms;
1000  char *parse;
1003  AST_APP_ARG(digits);
1004  );
1005 
1006  parse = ast_strdupa(data);
1007  AST_STANDARD_APP_ARGS(args, parse);
1008 
1009  if (ast_app_parse_timelen(args.timeout, &ms, TIMELEN_SECONDS) || ms < 0) {
1010  pbx_builtin_setvar_helper(chan, "WAITDIGITSTATUS", "ERROR");
1011  return 0;
1012  }
1013 
1014  /* Wait for "n" seconds */
1015  res = ast_waitfordigit_full(chan, ms, S_OR(args.digits, AST_DIGIT_ANY), -1, -1);
1016  if (res < 0) {
1017  pbx_builtin_setvar_helper(chan, "WAITDIGITSTATUS", "CANCEL");
1018  return -1;
1019  }
1020 
1021  if (res == 0) {
1022  pbx_builtin_setvar_helper(chan, "WAITDIGITSTATUS", "TIMEOUT");
1023  } else {
1024  char key[2];
1025 
1026  snprintf(key, sizeof(key), "%c", res);
1027  pbx_builtin_setvar_helper(chan, "WAITDIGITRESULT", key);
1028  pbx_builtin_setvar_helper(chan, "WAITDIGITSTATUS", "DTMF");
1029  }
1030 
1031  return 0;
1032 }
#define AST_DIGIT_ANY
Definition: file.h:48
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the &#39;standard&#39; argument separation process for an application.
static int timeout
Definition: cdr_mysql.c:86
const char * args
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
static void parse(struct mgcp_request *req)
Definition: chan_mgcp.c:1872
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 S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
Definition: strings.h:79
int ast_app_parse_timelen(const char *timestr, int *result, enum ast_timelen defunit)
Common routine to parse time lengths, with optional time unit specifier.
Definition: main/app.c:3036
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application&#39;s arguments.
int ast_waitfordigit_full(struct ast_channel *c, int ms, const char *breakon, int audiofd, int ctrlfd)
Wait for a digit Same as ast_waitfordigit() with audio fd for outputting read audio and ctrlfd to mon...
Definition: channel.c:3214
#define AST_APP_ARG(name)
Define an application argument.

◆ pbx_builtin_waitexten()

static int pbx_builtin_waitexten ( struct ast_channel chan,
const char *  data 
)
static

Definition at line 1037 of file pbx_builtins.c.

References args, AST_APP_ARG, ast_app_parse_options(), ast_app_parse_timelen(), ast_channel_caller(), ast_channel_context(), ast_channel_exten(), ast_channel_name(), ast_channel_pbx(), ast_channel_priority(), ast_channel_zone(), ast_check_hangup(), AST_CONTROL_HOLD, AST_CONTROL_UNHOLD, AST_DECLARE_APP_ARGS, ast_exists_extension(), ast_get_indication_tone(), ast_indicate(), ast_indicate_data(), ast_log, ast_playtones_start(), ast_playtones_stop(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero, ast_test_flag, ast_tone_zone_sound_unref(), ast_tonepair_start(), ast_verb, ast_waitfordigit(), ast_tone_zone_sound::data, LOG_WARNING, NULL, options, parse(), raise_exception(), ast_pbx::rtimeoutms, S_COR, S_OR, set_ext_pri(), TIMELEN_SECONDS, timeout, WAITEXTEN_DIALTONE, WAITEXTEN_MOH, and waitexten_opts.

1038 {
1039  int ms, res;
1040  struct ast_flags flags = {0};
1041  char *opts[1] = { NULL };
1042  char *parse;
1046  );
1047 
1048  if (!ast_strlen_zero(data)) {
1049  parse = ast_strdupa(data);
1050  AST_STANDARD_APP_ARGS(args, parse);
1051  } else
1052  memset(&args, 0, sizeof(args));
1053 
1054  if (args.options)
1055  ast_app_parse_options(waitexten_opts, &flags, opts, args.options);
1056 
1057  if (ast_test_flag(&flags, WAITEXTEN_MOH) && !opts[0] ) {
1058  ast_log(LOG_WARNING, "The 'm' option has been specified for WaitExten without a class.\n");
1059  } else if (ast_test_flag(&flags, WAITEXTEN_MOH)) {
1060  ast_indicate_data(chan, AST_CONTROL_HOLD, S_OR(opts[0], NULL),
1061  !ast_strlen_zero(opts[0]) ? strlen(opts[0]) + 1 : 0);
1062  } else if (ast_test_flag(&flags, WAITEXTEN_DIALTONE)) {
1063  struct ast_tone_zone_sound *ts = ast_get_indication_tone(ast_channel_zone(chan), "dial");
1064  if (ts) {
1065  ast_playtones_start(chan, 0, ts->data, 0);
1066  ts = ast_tone_zone_sound_unref(ts);
1067  } else {
1068  ast_tonepair_start(chan, 350, 440, 0, 0);
1069  }
1070  }
1071  /* Wait for "n" seconds */
1072  if (!ast_app_parse_timelen(args.timeout, &ms, TIMELEN_SECONDS) && ms > 0) {
1073  /* Yay! */
1074  } else if (ast_channel_pbx(chan)) {
1075  ms = ast_channel_pbx(chan)->rtimeoutms;
1076  } else {
1077  ms = 10000;
1078  }
1079 
1080  res = ast_waitfordigit(chan, ms);
1081  if (!res) {
1082  if (ast_check_hangup(chan)) {
1083  /* Call is hungup for some reason. */
1084  res = -1;
1085  } else if (ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan) + 1,
1086  S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
1087  ast_verb(3, "Timeout on %s, continuing...\n", ast_channel_name(chan));
1088  } else if (ast_exists_extension(chan, ast_channel_context(chan), "t", 1,
1089  S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
1090  ast_verb(3, "Timeout on %s, going to 't'\n", ast_channel_name(chan));
1091  set_ext_pri(chan, "t", 0); /* 0 will become 1, next time through the loop */
1092  } else if (ast_exists_extension(chan, ast_channel_context(chan), "e", 1,
1093  S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
1094  raise_exception(chan, "RESPONSETIMEOUT", 0); /* 0 will become 1, next time through the loop */
1095  } else {
1096  ast_log(LOG_WARNING, "Timeout but no rule 't' or 'e' in context '%s'\n",
1097  ast_channel_context(chan));
1098  res = -1;
1099  }
1100  }
1101 
1102  if (ast_test_flag(&flags, WAITEXTEN_MOH))
1104  else if (ast_test_flag(&flags, WAITEXTEN_DIALTONE))
1105  ast_playtones_stop(chan);
1106 
1107  return res;
1108 }
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
#define ast_test_flag(p, flag)
Definition: utils.h:63
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
Definition: channel.c:4271
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the &#39;standard&#39; argument separation process for an application.
#define LOG_WARNING
Definition: logger.h:274
static int timeout
Definition: cdr_mysql.c:86
unsigned int flags
Definition: utils.h:200
struct ast_tone_zone * ast_channel_zone(const struct ast_channel *chan)
int ast_indicate_data(struct ast_channel *chan, int condition, const void *data, size_t datalen)
Indicates condition of channel, with payload.
Definition: channel.c:4647
#define WAITEXTEN_MOH
Definition: pbx_builtins.c:664
const char * args
void ast_playtones_stop(struct ast_channel *chan)
Stop playing tones on a channel.
Definition: indications.c:393
#define NULL
Definition: resample.c:96
int ast_channel_priority(const struct ast_channel *chan)
#define ast_verb(level,...)
Definition: logger.h:455
Number structure.
Definition: app_followme.c:154
#define ast_log
Definition: astobj2.c:42
int raise_exception(struct ast_channel *chan, const char *reason, int priority)
Definition: pbx.c:2806
struct ast_pbx * ast_channel_pbx(const struct ast_channel *chan)
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
Definition: strings.h:85
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
static struct ast_tone_zone_sound * ast_tone_zone_sound_unref(struct ast_tone_zone_sound *ts)
Release a reference to an ast_tone_zone_sound.
Definition: indications.h:227
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
Definition: pbx.c:4170
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.
Definition: main/app.c:2829
const char * ast_channel_exten(const struct ast_channel *chan)
int ast_check_hangup(struct ast_channel *chan)
Check to see if a channel is needing hang up.
Definition: channel.c:441
void set_ext_pri(struct ast_channel *c, const char *exten, int pri)
Definition: pbx.c:4259
Description of a tone.
Definition: indications.h:35
struct ast_tone_zone_sound * ast_get_indication_tone(const struct ast_tone_zone *zone, const char *indication)
Locate a tone zone sound.
Definition: indications.c:455
static const struct ast_app_option waitexten_opts[128]
Definition: pbx_builtins.c:670
#define ast_strlen_zero(a)
Definition: muted.c:73
static void parse(struct mgcp_request *req)
Definition: chan_mgcp.c:1872
Structure used to handle boolean flags.
Definition: utils.h:199
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
Definition: channel.c:3150
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
Definition: strings.h:79
const char * ast_channel_name(const struct ast_channel *chan)
int ast_playtones_start(struct ast_channel *chan, int vol, const char *tonelist, int interruptible)
Start playing a list of tones on a channel.
Definition: indications.c:302
int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol)
Definition: channel.c:7521
const char * ast_channel_context(const struct ast_channel *chan)
const char * data
Description of a tone.
Definition: indications.h:52
static struct test_options options
int ast_app_parse_timelen(const char *timestr, int *result, enum ast_timelen defunit)
Common routine to parse time lengths, with optional time unit specifier.
Definition: main/app.c:3036
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application&#39;s arguments.
#define WAITEXTEN_DIALTONE
Definition: pbx_builtins.c:665
#define AST_APP_ARG(name)
Define an application argument.
int rtimeoutms
Definition: pbx.h:213