Asterisk cmd RealTime



Realtime Data Lookup


Use the RealTime config handler system to read data into channel variables.


All unique column names will be set as channel variables with optional prefix to the name.
E.g. prefix of 'var_' would make the column 'name' become the variable ${var_name}.
The assignment parameter is used in the return value of the function and defaults to '='.

For example assume the following:

In extconfig.conf:

sipusers => mysql,asterisk,asterisk_sip

In extensions.conf:

exten => 11223344,1,RealTime(sipusers|name|12023243260|var_)
exten => 11223344,n,NoOp(RealTime variable containing data from the column field is '${var_column}')

This will execute the following SQL on the asterisk_sip table in the asterisk database:
Select * from asterisk_sip where name = 12023243260

The variable ${var_column} will contain the contents of the column field from the matching record

Return Value

(accurate as of 1.6.1)

In addition to setting the channel variables as described above, a string representing the result is also returned by the function call. The format is a little screwy:


This means that this call:


will return a string formatted like this:


The return value is really only useful if you use a prefix that also works well as a separator. For example, this call


will return


which can easily be parsed using the CUT() function.

See also

Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ

Created by: kjcsb, Last modification: Wed 10 of Feb, 2010 (18:16 UTC) by diepiapaopolopo
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+