Skip to content

Dialplan Functions

Germán Luis Aracil Boned edited this page Apr 30, 2026 · 1 revision

Dialplan Functions

Dialplan functions read or write values from channels, global state, realtime backends, strings, math, files, protocols and other modules.

Functions are implemented under:

funcs/

Channel And Call State

Module Purpose
func_channel Channel information functions.
func_callerid Caller ID, connected line and redirecting functions.
func_cdr CDR access.
func_timeout Channel timeout functions.
func_volume Technology-independent volume control.
func_audiohookinherit Audiohook inheritance.
func_frame_trace Internal frame tracing.

Dialplan Logic And Variables

Module Purpose
func_logic Logical functions.
func_math Mathematical functions.
func_rand Random number function.
func_global Global/channel variable functions.
func_env Environment and filesystem functions.
func_strings String handling functions.
func_cut Cut fields from strings.
func_sprintf Formatting function.
func_base64 Base64 encode/decode.
func_uri URI encode/decode.
func_iconv Charset conversion.

Database And Realtime

Module Purpose
func_db AstDB functions.
func_realtime Realtime read/write/store/destroy.
func_odbc ODBC lookups.
func_config Configuration file variable access.
func_curl External URL access.

SIP, SRV And ENUM

Module Purpose
func_srv SRV lookup functions.
func_enum ENUM functions.
SIP functions Implemented by SIP channel driver modules such as chan_sofia and chan_sip: SIPPEER, SIPCHANINFO, SIP_HEADER, CHECKSIPDOMAIN.

Device State, Groups And Modules

Module Purpose
func_devstate Get/set custom device state.
func_extstate Extension state lookup.
func_groupcount Channel group functions.
func_dialgroup Dialgroup function.
func_module Check whether a module is loaded.
func_dialplan Context/extension/priority checking.
func_callcompletion Call completion configuration.

Security, Hashing And System

Module Purpose
func_aes AES dialplan functions.
func_md5 MD5 digest functions.
func_sha1 SHA-1 function.
func_shell Run shell command and return output.
func_sysinfo System information functions.
func_blacklist Caller ID blacklist lookup.
func_lock Dialplan mutexes.
func_version GABPBX version/build info.

Audio Helpers

Module Purpose
func_speex Noise reduction and AGC.
func_pitchshift Audio effect functions.

Operational Notes

Some functions have side effects. In production dialplans, be careful with:

  • SHELL() because it executes system commands.
  • Realtime write/store/destroy functions because they modify backend data.
  • ODBC functions because they depend on DSN configuration and SQL behavior.
  • Device state writes because they affect hints and subscriptions.

Clone this wiki locally