Asterisk: функции диалплана

Функции Asterisk используются в диалплане. Это не команды диалплана и не могут быть использованы прямо. Функции возвращают значение для дальнейшего использования в логике диалплана.

function 'AES_DECRYPT' AES_DECRYPT(key,string) Decrypt a string encoded in base64 with AES given a 16 character key.
function 'AES_ENCRYPT' AES_ENCRYPT(key,string) Encrypt a string with AES given a 16 character key.
function 'AMI_CLIENT' AMI_CLIENT(loginname,field) Checks attributes of manager accounts
function 'ARRAY' (ARRAY(var1,var2)=1,2) Назначить массив переменных
function 'AST_CONFIG' AST_CONFIG(config_file,category,variable_name)Получить переменную из конфига
function 'AUDIOHOOK_INHERIT' AUDIOHOOK_INHERIT(source) Set whether an audiohook may be inherited to another channel
function 'BASE64_DECODE' BASE64_DECODE(string) Decode a base64 string.
function 'BASE64_ENCODE' BASE64_ENCODE(string) Encode a string in base64.
function 'BLACKLIST' BLACKLIST() Check if the callerid is on the blacklist.
function 'CALLCOMPLETION' CALLCOMPLETION(option) Get or set a call completion configuration parameter for a channel.
function 'CALLERID' CALLERID(datatype[,CID]) Gets or sets Caller*ID data on the channel.
function 'CALLERPRES' CALLERPRES() Gets or sets Caller*ID presentation on the channel.
function 'CDR' CDR(name[,options]) Gets or sets a CDR variable.
function 'CDR_PROP' CDR_PROP(name) Set a property on a channel's CDR.
function 'CHANNEL' CHANNEL(item) Gets/sets various pieces of information about the channel.
function 'CHANNELS' CHANNELS([regular_expression]) Gets the list of channels, optionally filtering by a regular expression.
function 'CHECKSIPDOMAIN' CHECKSIPDOMAIN(domain) Checks if domain is a local domain.
function 'CONFBRIDGE' CONFBRIDGE(type,option) Set a custom dynamic bridge and user profile on a channel for the ConfBridge application using the same options defined in confbridge.conf.
CONFBRIDGE_INFO CONFBRIDGE_INFO(type,conf) Get information about a ConfBridge conference.
function 'CONNECTEDLINE' CONNECTEDLINE(datatype[,i]) Gets or sets Connected Line data on the channel.
function 'CSV_QUOTE' CSV_QUOTE(string) Quotes a given string for use in a CSV file, escaping embedded quotes as necessary
function 'CURL' CURL(url[,post-data]) Retrieves the contents of a URL
function 'CURLOPT' CURLOPT(<option>) Set options for use with the CURL() function
function 'CUT' CUT(varname,char-delim,range-spec) Slices and dices strings, based upon a named delimiter.
function 'DB' DB(family/key) Read from or write to the Asterisk database.
function 'DB_DELETE'DB_DELETE(family/key) Return a value from the database and delete it.
function 'DB_EXISTS'DB_EXISTS(family/key) Check to see if a key exists in the Asterisk database.
function 'DB_KEYS' DB_KEYS([prefix]) Obtain a list of keys within the Asterisk database.
function 'DEC' DEC(variable) Decrements the value of a variable, while returning the updated value to the dialplan
function 'DEVICE_STATE' DEVICE_STATE(device) Get or Set a device state.
function 'DIALGROUP' DIALGROUP(group[,op]) Manages a group of users for dialing.
function 'DIALPLAN_EXISTS' DIALPLAN_EXISTS(context[,extension[ Checks the existence of a dialplan target.
function 'ENUMLOOKUP' ENUMLOOKUP(number[,method-type[,opt General or specific querying of NAPTR records for ENUM or ENUM-like DNS pointers.
function 'ENUMQUERY' ENUMQUERY(number[,method-type[,zone Initiate an ENUM query.
function 'ENUMRESULT' ENUMRESULT(id,resultnum) Retrieve results from a ENUMQUERY.
function 'ENV' ENV(varname) Gets or sets the environment variable specified.
function 'EVAL' EVAL(variable) Evaluate stored variables
function 'EXCEPTION' EXCEPTION(field) Retrieve the details of the current dialplan exception.
function 'EXISTS' EXISTS(data) Test the existence of a value.
function 'EXTENSION_STATE' EXTENSION_STATE(extension[@context] Get an extension's state.
function 'FAXOPT' FAXOPT(item) Gets/sets various pieces of information about a fax session.
function 'FEATURE' FEATURE(option_name) Get or set a feature option on a channel.
function 'FEATUREMAP' FEATUREMAP(feature_name) Get or set a feature map to a given value on a specific channel.
function 'FIELDNUM' FIELDNUM(varname,delim,value) Return the 1-based offset of a field in a list
function 'FIELDQTY' FIELDQTY(varname,delim) Count the fields with an arbitrary delimiter
function 'FILE' FILE(filename[,offset[,length[,opti Read or write text file.
function 'FILE_COUNT_LINE' FILE_COUNT_LINE(filename[,format]) Obtains the number of lines of a text file.
function 'FILE_FORMAT' FILE_FORMAT(filename) Return the newline format of a text file.
function 'FILTER' FILTER(allowed-chars,string) Filter the string to include only the allowed characters
function 'FRAME_TRACE' FRAME_TRACE(filter list type) View internal ast_frames as they are read and written on a channel.
function 'GLOBAL' GLOBAL(varname) Gets or sets the global variable specified.
function 'GROUP' GROUP([category]) Gets or sets the channel group.
function 'GROUP_COUNT' GROUP_COUNT([groupname][@category]) Counts the number of channels in the specified group.
function 'GROUP_LIST' GROUP_LIST() Gets a list of the groups set on a channel.
function 'GROUP_MATCH_COUNT' GROUP_MATCH_COUNT(groupmatch[@categ Counts the number of channels in the groups matching the specified pattern.
function 'HANGUPCAUSE' HANGUPCAUSE(channel,type) Gets per-channel hangupcause information from the channel.
function 'HANGUPCAUSE_KEYS' HANGUPCAUSE_KEYS() Gets the list of channels for which hangup causes are available.
function 'HASH' HASH(hashname[,hashkey]) Implementation of a dialplan associative array
function 'HASHKEYS' HASHKEYS(hashname) Retrieve the keys of the HASH() function.
function 'HINT' HINT(extension[@context][,options]) Get the devices set for a dialplan hint.
function 'IAXPEER' IAXPEER(peername[,item]) Gets IAX peer information.
function 'IAXVAR' IAXVAR(varname) Sets or retrieves a remote variable.
function 'ICONV' ICONV(in-charset,out-charset,string Converts charsets of strings.
Функция Asterisk IF IF(expresion?[true][:false]) Check for an expresion.
function 'IFMODULE' IFMODULE( Checks if an Asterisk module is loaded in memory.
function 'IFTIME' IFTIME(timespec?[true][:false]) Temporal Conditional.
function 'IMPORT' IMPORT(channel,variable) Retrieve the value of a variable from another channel.
function 'INC' INC(variable) Increments the value of a variable, while returning the updated value to the dialplan
function 'ISNULL' ISNULL(data) Check if a value is NULL.
function 'JITTERBUFFER' JITTERBUFFER(jitterbuffer type) Add a Jitterbuffer to the Read side of the channel. This dejitters the audio stream before it reaches the Asterisk core. This is a write only function.
function 'KEYPADHASH' KEYPADHASH(string) Hash the letters in string into equivalent keypad numbers.
function 'LEN' LEN(string) Return the length of the string given.
function 'LISTFILTER' LISTFILTER(varname,delim,value) Remove an item from a list, by name.
function 'LOCAL' LOCAL(varname) Manage variables local to the gosub stack frame.
function 'LOCAL_PEEK' LOCAL_PEEK(n,varname) Retrieve variables hidden by the local gosub stack frame.
function 'LOCK' LOCK(lockname) Attempt to obtain a named mutex.
function 'MAILBOX_EXISTS' MAILBOX_EXISTS(mailbox[@context]) Tell if a mailbox is configured.
function 'MASTER_CHANNEL' MASTER_CHANNEL() Gets or sets variables on the master channel
function 'MATH' MATH(expression[,type]) Performs Mathematical Functions.
function 'MD5' MD5(data) Computes an MD5 digest.
function 'MESSAGE' MESSAGE(argument) Create a message or read fields from a message.
function 'MESSAGE_DATA' MESSAGE_DATA(argument) Read or write custom data attached to a message.
function 'MINIVMACCOUNT' MINIVMACCOUNT(account:item) Gets MiniVoicemail account information.
function 'MINIVMCOUNTER' MINIVMCOUNTER(account:name[:operand Reads or sets counters for MiniVoicemail message.
function 'MUTEAUDIO' MUTEAUDIO(direction) Muting audio streams in the channel
function 'ODBC' ODBC(property[,argument]) Controls ODBC transaction properties.
function 'ODBC_FETCH' ODBC_FETCH(result-id) Fetch a row from a multirow query.
function 'PASSTHRU' PASSTHRU([string]) Pass the given argument back as a value.
function 'PITCH_SHIFT' PITCH_SHIFT(channel direction) Pitch shift both tx and rx audio streams on a channel.
function 'PJSIP_DIAL_CONTACTS' PJSIP_DIAL_CONTACTS(endpoint[,aor[, Return a dial string for dialing all contacts on an AOR.
function 'PJSIP_ENDPOINT' PJSIP_ENDPOINT(name,field) Get information about a PJSIP endpoint
function 'PJSIP_HEADER' PJSIP_HEADER(action,name[,number]) Gets, adds, updates or removes the specified SIP header from a PJSIP session.
function 'PJSIP_MEDIA_OFFER' PJSIP_MEDIA_OFFER(media) Media and codec offerings to be set on an outbound SIP channel prior to dialing.
function 'POP' POP(varname[,delimiter]) Removes and returns the last item off of a variable containing delimited text
function 'PP_EACH_EXTENSION' PP_EACH_EXTENSION(mac,template) Execute specified template for each extension.
function 'PP_EACH_USER' PP_EACH_USER(string,exclude_mac) Generate a string for each phoneprov user.
function 'PRESENCE_STATE' PRESENCE_STATE(provider,field[,opti Get or Set a presence state.
function 'PUSH' PUSH(varname[,delimiter]) Appends one or more values to the end of a variable containing delimited text
function 'QUEUE_EXISTS' QUEUE_EXISTS([queuename]) Check if a named queue exists on this server
function 'QUEUE_MEMBER' QUEUE_MEMBER(queuename,option[,inte Count number of members answering a queue.
function 'QUEUE_MEMBER_COUNT' QUEUE_MEMBER_COUNT(queuename) Count number of members answering a queue.
function 'QUEUE_MEMBER_LIST' QUEUE_MEMBER_LIST(queuename) Returns a list of interfaces on a queue.
function 'QUEUE_MEMBER_PENALTY' QUEUE_MEMBER_PENALTY(queuename,inte Gets or sets queue members penalty.
Функция диалплана Asterisk: QUEUE_VARIABLES QUEUE_VARIABLES(queuename) Return Queue information in variables.
function 'QUEUE_WAITING_COUNT' QUEUE_WAITING_COUNT([queuename]) Count number of calls currently waiting in a queue.
function 'QUOTE' QUOTE(string) Quotes a given string, escaping embedded quotes as necessary
function 'RAND' RAND([min][,max]) Choose a random number in a range.
function 'REALTIME' REALTIME(family,fieldmatch[,matchva RealTime Read/Write Functions.
function 'REALTIME_DESTROY' REALTIME_DESTROY(family,fieldmatch[ RealTime Destroy Function.
function 'REALTIME_FIELD' REALTIME_FIELD(family,fieldmatch,ma RealTime query function.
function 'REALTIME_HASH' REALTIME_HASH(family,fieldmatch,mat RealTime query function.
function 'REALTIME_STORE' REALTIME_STORE(family,field1,fieldN RealTime Store Function.
function 'REDIRECTING' REDIRECTING(datatype[,i]) Gets or sets Redirecting data on the channel.
function 'REGEX' REGEX(«regular expression» string) Check string against a regular expression.
function 'REPLACE' REPLACE(varname,find-chars[,replace Replace a set of characters in a given string with another character.
function 'SET' SET(varname[=value]) SET assigns a value to a channel variable.
function 'SHA1' SHA1(data) Computes a SHA1 digest.
function 'SHARED' SHARED(varname[,channel]) Gets or sets the shared variable specified.
function 'SHELL' SHELL(command) Executes a command using the system shell and captures its output.
function 'SHIFT' SHIFT(varname[,delimiter]) Removes and returns the first item off of a variable containing delimited text
function 'SIPCHANINFO' SIPCHANINFO(item) Gets the specified SIP parameter from the current channel.
function 'SIPPEER' SIPPEER(peername[,item]) Gets SIP peer information.
function 'SIP_HEADER' SIP_HEADER(name[,number]) Gets the specified SIP header from an incoming INVITE message.
function 'SORT' SORT(key1:val1[,key2:val2[,…]]) Sorts a list of key/vals into a list of keys, based upon the vals.
function 'SPEECH' SPEECH(argument) Gets information about speech recognition results.
function 'SPEECH_ENGINE' SPEECH_ENGINE(name) Get or change a speech engine specific attribute.
function 'SPEECH_GRAMMAR' SPEECH_GRAMMAR([nbest_number/]resul Gets the matched grammar of a result if available.
function 'SPEECH_SCORE' SPEECH_SCORE([nbest_number/]result_ Gets the confidence score of a result.
function 'SPEECH_TEXT' SPEECH_TEXT([nbest_number/]result_n Gets the recognized text of a result.
function 'SPRINTF' SPRINTF(format,arg1[,arg2[,…][,ar Format a variable according to a format string.
function 'SRVQUERY' SRVQUERY(service) Initiate an SRV query.
function 'SRVRESULT' SRVRESULT(id,resultnum) Retrieve results from an SRVQUERY.
function 'STACK_PEEK' STACK_PEEK(n,which[,suppress]) View info about the location which called Gosub
function 'STAT' STAT(flag,filename) Does a check on the specified file.
function 'STRFTIME' STRFTIME([epoch][,timezone[,format] Returns the current date/time in the specified format.
function 'STRPTIME' STRPTIME(datetime,timezone,format) Returns the epoch of the arbitrary date/time string structured as described by the format.
function 'STRREPLACE' STRREPLACE(varname,find-string[,rep Replace instances of a substring within a string with another string.
function 'SYSINFO' SYSINFO(parameter) Returns system information specified by parameter.
function 'TESTTIME' TESTTIME(date,time[,zone]) Sets a time to be used with the channel to test logical conditions.
function TIMEOUT TIMEOUT(timeouttype) Gets or sets timeouts on the channel. Timeout values are in seconds.
function 'TOLOWER' TOLOWER(string) Convert string to all lowercase letters.
function 'TOUPPER' TOUPPER(string) Convert string to all uppercase letters.
function 'TRYLOCK' TRYLOCK(lockname) Attempt to obtain a named mutex.
function 'TXTCIDNAME' TXTCIDNAME(number[,zone-suffix]) TXTCIDNAME looks up a caller name via DNS.
function 'UNLOCK' UNLOCK(lockname) Unlocks a named mutex.
function 'UNSHIFT' UNSHIFT(varname[,delimiter]) Inserts one or more values to the beginning of a variable containing delimited text
function 'URIDECODE' URIDECODE(data) Decodes a URI-encoded string according to RFC 2396.
function 'URIENCODE' URIENCODE(data) Encodes a string to URI-safe encoding according to RFC 2396.
function 'VALID_EXTEN' VALID_EXTEN([context],extension[,pr Determine whether an extension exists or not.
function 'VERSION' VERSION([info]) Return the Version info for this Asterisk.
function 'VMCOUNT' VMCOUNT(vmbox[,folder]) Count the voicemails in a specified mailbox.
function 'VM_INFO' VM_INFO(mailbox[@context],attribute Returns the selected attribute from a mailbox.
function 'VOLUME' VOLUME(direction[,options]) Set the TX or RX volume of a channel.

Asterisk настройка

Только авторизованные участники могут оставлять комментарии.

Войти через: Google Facebook