Hello.
First time post here, hoping someone can offer me some help or advice.
I just created a new server running Elastix / FreePBX and I am attempting to get all the extensions into it from another already existing pbx. The existing pbx has no way of exporting this information in any usable form some I am stuck with the sip.conf and extensions.conf I found in the /etc/asterisk directory on the old pbx.
Is there anyway I can use either one of these or both of these files to create all the extensions I need on the new server?
I have been pulling my hair out searching for solution as there is easily over 500 extensions.
For that many extensions, it may be worth creating a script that compiles down the core information into a CSV file and trying to use the bulk import module to pull them in.
Of course by the time you have gone through all that you may be better off paying your teenage daughter/son (or a colleagues if you don’t have one) $10/hr to enter them…
In any event, you can still use the bulk extension module to go a bit quicker.
We attempted to write a script that would parse the information from the old sip.conf file inject it into the php scripts used to create extensions, but obviously have something wrong as it does not seem to work.
Basically it was written to parse the data from each extension into an array and the push the array into the script. Here is the part of the script that attempts to inject the data:
forget trying to use the core_users_add and core_devices_add APIs, they are an ugly mess, trust me.
As I mentioned, just use the scripts to make a CSV file and use the bulkextensions module (in the extended repository) to import them. It’s already done the ugly work of figuring out the APIs.
Make sure that you don’t have some hidden characters in the offending field.
Try entering a couple of extensions manually into the csv and see if that works.
Also make sure your csv file has the proper number of comma delimiters.
When you re-import the csv into excel does it look ok with the proper number of fields…even null fields?
I’ve been able to clean up csv files that might have hidden characters by reading them into notepad and then resaving them. Seems that notepad doesn’t save special characters.
I haven’t tried that specifically with FreePBx but it has worked in other csv applications.
I had the same problem just because I forgot to set separations between fiels:
that needs “,” and not “;” (and excel automatically sets “;”) ^^
Notepad++ and ctrl+F did the trick.
Have fun