# Hints from DB. Is it possible?

**URL:** <https://community.asterisk.org/t/hints-from-db-is-it-possible/87895>\
**Category:** Asterisk Dialplan\
**Created:** [March 10, 2021, 8:37pm UTC](https://community.asterisk.org/t/hints-from-db-is-it-possible/87895 "2021-03-10T20:37:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tincho](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@Tincho](https://community.asterisk.org/u/Tincho)\
**Post date:** [March 10, 2021, 8:37pm UTC](https://community.asterisk.org/t/hints-from-db-is-it-possible/87895/1 "2021-03-10T20:37:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ambiorixg12](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ambiorixg12/32/1887_2.png) [@ambiorixg12](https://community.asterisk.org/u/ambiorixg12)\
**Post date:** [March 10, 2021, 8:46pm UTC](https://community.asterisk.org/t/hints-from-db-is-it-possible/87895/2 "2021-03-10T20:46:28Z")

</div>

`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

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [March 10, 2021, 8:55pm UTC](https://community.asterisk.org/t/hints-from-db-is-it-possible/87895/3 "2021-03-10T20:55:05Z")

</div>

The first hit on Google, [Hints and Asterisk Realtime](https://community.asterisk.org/t/hints-and-asterisk-realtime/24060) 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

---

<div class="post-metadata">

**Author:** ![Tincho](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@Tincho](https://community.asterisk.org/u/Tincho)\
**Post date:** [March 10, 2021, 9:08pm UTC](https://community.asterisk.org/t/hints-from-db-is-it-possible/87895/4 "2021-03-10T21:08:01Z")

</div>

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 ☹

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [March 10, 2021, 10:45pm UTC](https://community.asterisk.org/t/hints-from-db-is-it-possible/87895/5 "2021-03-10T22:45:07Z")

</div>

[https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration](https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration)

---

<div class="post-metadata">

**Author:** ![Tincho](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@Tincho](https://community.asterisk.org/u/Tincho)\
**Post date:** [March 11, 2021, 5:19pm UTC](https://community.asterisk.org/t/hints-from-db-is-it-possible/87895/6 "2021-03-11T17:19:37Z")

</div>

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

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 ¿?

Thanks.

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [March 11, 2021, 5:36pm UTC](https://community.asterisk.org/t/hints-from-db-is-it-possible/87895/7 "2021-03-11T17:36:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tincho](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@Tincho](https://community.asterisk.org/u/Tincho)\
**Post date:** [March 11, 2021, 6:49pm UTC](https://community.asterisk.org/t/hints-from-db-is-it-possible/87895/8 "2021-03-11T18:49:11Z")

</div>

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

hahahaha… ooooooooooooooooooook… I will try.

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [April 10, 2021, 6:50pm UTC](https://community.asterisk.org/t/hints-from-db-is-it-possible/87895/9 "2021-04-10T18:50:07Z")

</div>

Closed on April 10, 2021, 6:50pm UTC

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