The database has a table that is filled with some data through a third-party web interface. This table contains some data of real users. During a call from Asterisk, i need to make a request to this database in order to request some information by phone number, which is then used further in the process of making a call. The database is connected to Asterisk via ODBC, the data on the endpoints are in the same database. I.e., a real-time database.
If i do not use such tools as scripts, is it possible to make a similar query in the database?
Something like same => n,Set(variable=DATABASE(...))
I can’t understand the syntax.
I have a query select val from table where phone = 103. For example, the calling number 103, by which I can request a value from the database and write it to a variable in Asterisk, so that later I can use this variable in the dialplan.
I personally do not use func_odbc, but what you ask is easily doable, in my case I do it with the shell function, and from there I execute the query to the database
please have a look at file func_odbc func_odbc.conf.sample
declare the query there and in the dial plan u use it as a variable
like Set(ABC=${ODBC_DECLARED(arg1,arg2)})