Asterisk - The Open Source Telephony Project  18.5.0
Files | Functions | Variables
Module: Dial plan functions

Functions support the dialplan. They do not change any property of a channel or touch a channel in any way. More...


file  app_dtmfstore.c
 Technology independent asynchronous DTMF collection.
file  cli_commands.c
 PJSIP channel CLI functions.
file  pjsip/dialplan_functions.c
 PJSIP channel dialplan functions.
file  func_aes.c
 AES encryption/decryption dialplan functions.
file  func_base64.c
 Use the base64 as functions.
file  func_blacklist.c
 Function to lookup the callerid number, and see if it is blacklisted.
file  func_callerid.c
 Party ID related dialplan functions (Caller-ID, Connected-line, Redirecting)
file  func_cdr.c
 Call Detail Record related dialplan functions.
file  func_channel.c
 Channel info dialplan functions.
file  func_config.c
 A function to retrieve variables from an Asterisk configuration file.
file  func_curl.c
 Curl - Load a URL.
file  func_cut.c
 CUT function.
file  func_db.c
 Functions for interaction with the Asterisk database.
file  func_devstate.c
 Manually controlled blinky lights.
file  func_dialgroup.c
 Dial group dialplan function.
file  func_dialplan.c
 Dialplan group functions check if a dialplan entry exists.
file  func_enum.c
 ENUM Functions.
file  func_env.c
 Environment related dialplan functions.
file  func_evalexten.c
 Dialplan extension evaluation function.
file  func_extstate.c
 Get the state of a hinted extension for dialplan control.
file  func_frame_drop.c
 Function that drops specified frames from channels.
file  func_frame_trace.c
 Trace internal ast_frames on a channel.
file  func_global.c
 Global variable dialplan functions.
file  func_groupcount.c
 Channel group related dialplan functions.
file  func_hangupcause.c
 Functions related to retreiving per-channel hangupcause information.
file  func_holdintercept.c
 Function that intercepts HOLD frames from channels and raises events.
file  func_iconv.c
 Charset conversions.
file  func_jitterbuffer.c
 Put a jitterbuffer on the read side of a channel.
file  func_lock.c
 Dialplan mutexes.
file  func_logic.c
 Conditional logic dialplan functions.
file  func_math.c
 Math related dialplan function.
file  func_md5.c
 MD5 digest related dialplan functions.
file  func_module.c
 Simple module check function.
file  func_odbc.c
 ODBC lookups.
file  func_periodic_hook.c
 Periodic dialplan hooks.
file  func_pitchshift.c
 Pitch Shift Audio Effect.
file  func_pjsip_aor.c
 Get information about a PJSIP AOR.
file  func_pjsip_contact.c
 Get information about a PJSIP contact.
file  func_pjsip_endpoint.c
 Get information about a PJSIP endpoint.
file  func_presencestate.c
 Custom presence provider.
file  func_rand.c
 Generate Random Number.
file  func_realtime.c
 REALTIME dialplan function.
file  func_sayfiles.c
 Returns files played by Say applications.
file  func_scramble.c
 Frequency inverter.
file  func_sha1.c
 SHA1 digest related dialplan functions.
file  func_shell.c
file  func_sorcery.c
 Get a field from a sorcery object.
file  func_speex.c
 Noise reduction and automatic gain control (AGC)
file  func_sprintf.c
 String manipulation dialplan functions.
file  func_srv.c
 SRV Functions.
file  func_strings.c
 String manipulation dialplan functions.
file  func_sysinfo.c
file  func_talkdetect.c
 Function that raises events when talking is detected on a channel.
file  func_timeout.c
 Channel timeout related dialplan functions.
file  func_uri.c
 URI encoding / decoding.
file  func_version.c
 Return the current Version strings.
file  func_vmcount.c
 VMCOUNT dialplan function.
file  func_volume.c
 Technology independent volume control.
file  res_mutestream.c
 MUTESTREAM audiohooks.


static int testtime_write (struct ast_channel *chan, const char *cmd, char *var, const char *value)


static struct ast_custom_function dundi_function

Detailed Description

Functions support the dialplan. They do not change any property of a channel or touch a channel in any way.

Asterisk Dial Plan Functions

See also

Function Documentation

◆ testtime_write()

static int testtime_write ( struct ast_channel chan,
const char *  cmd,
char *  var,
const char *  value 

Definition at line 8292 of file pbx.c.

References ast_mktime(), ast_strptime(), NULL, pbx_builtin_setvar_helper(), pbx_checkcondition(), result, and S_OR.

8293 {
8294  struct ast_tm tm;
8295  struct timeval tv;
8296  char *remainder, result[30], timezone[80];
8298  /* Turn off testing? */
8299  if (!pbx_checkcondition(value)) {
8300  pbx_builtin_setvar_helper(chan, "TESTTIME", NULL);
8301  return 0;
8302  }
8304  /* Parse specified time */
8305  if (!(remainder = ast_strptime(value, "%Y/%m/%d %H:%M:%S", &tm))) {
8306  return -1;
8307  }
8308  sscanf(remainder, "%79s", timezone);
8309  tv = ast_mktime(&tm, S_OR(timezone, NULL));
8311  snprintf(result, sizeof(result), "%ld", (long) tv.tv_sec);
8312  pbx_builtin_setvar_helper(chan, "__TESTTIME", result);
8313  return 0;
8314 }
#define NULL
Definition: resample.c:96
int value
Definition: syslog.c:37
char * ast_strptime(const char *s, const char *format, struct ast_tm *tm)
Special version of strptime(3) which places the answer in the common structure ast_tm. Also, unlike strptime(3), ast_strptime() initializes its memory prior to use.
Definition: localtime.c:2550
int pbx_checkcondition(const char *condition)
Evaluate a condition.
Definition: pbx.c:8321
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...
struct timeval ast_mktime(struct ast_tm *const tmp, const char *zone)
Timezone-independent version of mktime(3).
Definition: localtime.c:2357
#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
static PGresult * result
Definition: cel_pgsql.c:88

Variable Documentation

◆ dundi_function

struct ast_custom_function dundi_function
Initial value:
= {
.name = "DUNDILOOKUP",
.read = dundifunc_read,
static int dundifunc_read(struct ast_channel *chan, const char *cmd, char *num, char *buf, size_t len)
Definition: pbx_dundi.c:4137


Definition at line 4186 of file pbx_dundi.c.