Change extension outbound CID in database

Hello,

I developing a WEB application in which I have the administration of 30 operators that use extensions on our IP PBX Asterisk/FreePBX.
I accessing from the WEB application through the MySQL connection to the Asterisk database, and I made it possible to change the parameters in the asterisk.users table (columns outboundchid, noanswer_dest, busy_dest, chanunavail_dest) and after changing these parameters in the database, via the SSH connection I am running command “amportal admin reload” to apply changes.

Example:
UPDATE asterisk.users SET outboundcid=‘4XXXXXXXXXX’, noanswer_dest=’’, busy_dest=’’, chanunavail_dest=‘ext-group,100,1’ WHERE extension=105;
UPDATE asterisk.admin SET value=‘true’ WHERE variable=‘need_reload’;

The problem is that all changes are accepted and I see them through the FreePBX admin but when I make outgoing call it still old Outbound CID.

Example:
On extension via FreePBX was set Outbound CID ‘4XXXXXXXX01’. When I make changs to ‘4XXXXXXXX02’ from my app and back to FreePBX extension page is seted a new number ‘4XXXXXXXX02’ and it seems that is everything OK but when call is maked it still old CID ‘4XXXXXXXX01’.

I can’t find some other place in database where is stored extension Outbound CID and I can’t find in Asterisk configuration files to.

Where are placed settings of extension Outbound CID value?

Thanks in advance!

Best regards,
Mladen

the sqlite3 database /var/lib/asterisk/sqlite.db

1 Like

Dicko,
Thank you very much!

I found that database and I first try to update directly, but I got error “database is locked”.
sqlite3 /var/lib/asterisk/astdb.sqlite3 \"UPDATE astdb SET value='4XXXXXXXX02' WHERE key='/AMPUSER/105/outboundcid';\"

Than I found one more your post, where I find out that I can make database query directly from asterisk console and now everything works fine.
rasterisk -x "database query \"UPDATE astdb SET key='4XXXXXXXX02' WHERE key='/AMPUSER/105/outboundcid'\""

Best regards,
Mladen