Hints from DB. Is it possible?

Hello all,

(I saw this question many times and never answered)

Is there any way to make Asterisk read its “hints” configuration from a DB?

So instead of specifying:

exten => 3001,hint,SIP/3001
exten => 3000,hint,SIP/3000

Read these values from a database table.

Thanks in advance.

exten = <extension>,hint,<device state id>[& <more dev state id],<presence state id>

SIP/3001&SIP/3001 represent the device state id which is clearly based on the protocol and the device, I think anything you add outside this format as the dev state id, will throw errors

The first hit on Google, Hints and Asterisk Realtime says use -1, instead of “hint”. Whilst I cannot positively confirm that, inspection of the code shows that priority == -1 is used, internally, to represent hints

Thanks David, I saw that post but I didn’t understand. That’s why I asked.

Where sould I use “-1” ?

The idea was to read hints without change my diaplan every time I add a new extension.
Again, may be you said it but I don’t get it.

Sorry :frowning:


David, from https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration#RealtimeDatabaseConfiguration-Limitations

Currently, realtime extensions do not support realtime hints. There is a workaround available by using func_odbc. See the sample func_odbc.conf for more information.

So, again and please, don’ be mad. I really don’t understand. How should I use that: “priority = -1”
Like this?
exten => 3000,-1,SIP/3000 ¿?


There is conflicting information in the documentation, so you need to try it yourself.

If it works, you configure that part of the configuration using an ARA table, with -1 in the priority column. ARA records are structured relational records, not images of the .conf records.

I doubt anyone is going to be able to tell you which article is right without either reading the code in detail, or actually trying it out.

There is conflicting information in the documentation, so you need to try it yourself.

hahahaha… ooooooooooooooooooook… I will try.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.