AccountCode MySQL Table

It’s been a long day, I may have missed it when I looked for it or whatever.

Does anyone in which table the extension’s account code is stored in MySQL? (If at all? Perhaps it’s only stored in Asterisk’s DB)


I’m am working on something with that exact field. It is in the asterisk db. From the CLI

asterisk -rx ‘database show’ | egrep "accountcode”

It’s stored in the sip table.

select * from sip where id='100' and keyword='accountcode';

Just an example, adjust the command as you like.

And where is that value set?

In the “Advanced” tab in FreePBX when editing an extension.

Not in my freepbx unless it pre-existed

I have a fresh 15 distro install I did last week and I see it in there too.

MariaDB [asterisk]> select `data` from `sip` where `keyword` like "accountcode" and `id` like "6002";
| data              |
| test1,test2,test3 |
1 row in set (0.00 sec)
1 Like

Thank you everyone for your responses.

The below got me working:

select data from sip where id='101' and keyword='accountcode';
1 Like

OK well, if you have Zulu installed there’s another extension with a 00 prefix that contains the same account code. So I added the MySQL limit 1 function.

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