Managing database error

Hi all,

we have asterik running on a local maradb database and all is ok.
But, when a call arrives, we first look into an external database to see into a phonebook if we know the name associated to a number. This work quite well.
Sometimes, we don’t know why, the database as error and in fact into the dialplan we are stuck on the instruction that reads the value for 1 or 2 minutes… thenthe call is hanged up before we continue, nobody waits for minutes when ringing :slight_smile:

Here are the diaplan commands :

same = n(displayName),set(cidDisplayName=${ODBC_PHONEBOOK-NUMBER-USER(${CALLERID(num)})})
same = n,ExecIf($[“${cidDisplayName}” = “”]?Set(cidDisplayName=${CALLERID(num)}))

and the func_odbc associated commands :

readsql=select pB.displayName, pL.phoneDescription from g_phoneBook pB,g_phoneList pL where pB.ID=pL.FKphoneBook and pL.phoneNumber=‘${SQL_ESC(${ARG1})}’

I can see an old thread about mysql connectivity with no real solution.
By the way is there a solution to stop being stuck on the database reading using a timeout ?
For example if i have no reply after 5 sec i go to the next diaplan command.

Many thanks for ideas


I think the real solution is to replicate the database onto the machine running Asterisk, so that all time critical database accesses are local.

1 Like

Hi David,

Thanks for that
this is something i read already on another post (maybe a reply from you :slight_smile: )
I’m not very confortable with that…

Also, do you know where i can find all options (and their explanations) associated with ini files like odbc.ini, odbcinst.ini, … ?


Hi David,

i asked a coleague of mine that told me that doing such a replication (one way) is really simple. I’ll then test that.

By the way does anyone knows where i can find all values (and explanations) for odbc.ini and odbcinst.ini files ?


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