Bulk upload content into the Directory - via MySQL?


#1

We are going to begin using the Directory feature to route incoming calls from our main site to satellite offices which also run FreePBX. We have over 150 extensions which people could direct-dial and I understand the only way to manage this is using the Directory.

I cringe at the amount of clicking, copying, and pasting involved in hand-building such a large directory.

I prefer to take an Excel spreadsheet and upload the content.

Since that doesn’t seem possible I’ve looked at the MySQL database for Asterisk. It looks like I could run some SQL statements and it will update info properly. Based upon my very short tests it looks like these two statements could achieve a desired result:

select max(e_id)+1 into @newID from directory_entries; 
insert into directory_entries (id, e_id, name, type, audio, dial) values (1, @newID, "test person3", "custom", "tts", "9991");

NOTE: my single Directory has ID=1 to match the “id” column above

But I’d like opinions of more senior FreePBX people before I head too far down this road.