FreePBX bulk extension setup or modify

Recently I had to set up 150 extensions and DDI numbers for a customer. Luckily they had a spreadsheet that contained all of the extension numbers and associated DDI numbers.

While it would have been possible to type all of these in using the FreePBX GUI it’s obviously not desirable, and prone to errors.

To create the extensions I used the ‘Bulk Extensions’ module in FreePBX. This is an ‘Unsupported’ module but worked well for me –

Bulk Extensions

What this module does is allows you to import a CSV file (in the correct format) to create all of the extensions. It also allows you to modify any existing extensions.

By far the most important thing to do when using this module is to back up your configuration, and back it up regularly. If you make a mistake, or this modules screws up your configuration, you will need a good backout plan!

The easiest way to get a CSV file in the correct format is to create a couple of extensions manually first. Make sure all of the settings for these extensions are set as required.

Then you can export the current extensions in to a CSV format using the module –

Export existing extensions

If you load this CSV up in to something like Excel you will see the extensions that have already been created with ‘edit’ listed in the first column –

Create new extensions

You can now create new lines but with column A set to ‘add’. Then you can import the CSV and any changes to the ‘edit’ lines will be applied, and any new extensions created. You still need to be fairly handy with Excel to create all of the required fields but it is an amazing add-on for creating more than 10 or 15 extensions. There is also a Bulk DID module that can be used in a similar way to create Inbound Routes.

I suggest the following when using this module –

  • Always back up your data before doing any import!
  • Check over the CSV in something like Notepad before importing it to ensure everything looks OK. Excel can screw up some columns, especially numbers with leading zeros
  • Be careful when dragging down fields to create the new extensions. For example one column is the SIP port. You want to make sure new extensions are create with port 5060, and not 5061, 5062, 5063 etc …