Saving custom hints in a database?


I’m running Asterisk 13 Pjsip and I’d like to save and retrieve some custom hints in a database.
Right now I set the custom device state in my dialplan like this:

exten => Ligne_Recep,hint,Custom:BLF_RECEPTION

exten => Ligne_Recep,1,NoOp()
same => n,Hangup()

The problem is that if I have to restart Asterisk I lose all custom hints.

Can I use extconfig.conf for storing custom hints state?

Another option would be pulling the device states from a DB and setting them with a call file when asterisk starts.

I have just realized that Asterisk is saving the custom Devstates in /var/lib/asterisk/astdb.sqlite3.
So even if I shutdown asterisk, the hints will keep its last state.

This command allowed me to see the device state:

database show

/CustomDevstate/BLF_1 : INUSE
/CustomDevstate/BLF_2 : NOT_INUSE
/CustomDevstate/BLF_3 : INUSE