Please help! I by accident copied the extension.conf.sample over the extension.conf :-(

I had some mistake in the dahdi configuration file. After fixing that, I checked extension.conf. By accident, I copied the extension.conf.sample over the extension.conf, which is the symlink to /var/www/html/admin/modules/core/etc/extensioin.conf

Now, nothing works when I try to make call!

How can I recover from that? I tried to delete the extensions and add them back, it does not seem work. I need help badly…

Thanks for any help you can extend to me!!!

Phone has dial tone. But when I tried to dial anything, I will immediately hear busy tone. With these messages in the full log:

[Dec 31 12:19:25] VERBOSE[6503] chan_dahdi.c: – Starting simple switch on ‘DAHDI/1-1’
[Dec 31 12:19:27] VERBOSE[6503] pbx.c: – Executing [[email protected]:1] Dial(“DAHDI/1-1”, “dahdi/8,60,m(default)”) in new stack
[Dec 31 12:19:27] WARNING[6503] app_dial.c: Unable to create channel of type ‘dahdi’ (cause 0 - Unknown)
[Dec 31 12:19:27] VERBOSE[6503] app_dial.c: == Everyone is busy/congested at this time (1:0/0/1)
[Dec 31 12:19:27] VERBOSE[6503] pbx.c: – Executing [[email protected]:2] Hangup(“DAHDI/1-1”, “”) in new stack
[Dec 31 12:19:27] VERBOSE[6503] pbx.c: == Spawn extension (from-internal, 1, 2) exited non-zero on ‘DAHDI/1-1’
[Dec 31 12:19:27] VERBOSE[6503] chan_dahdi.c: – Hungup ‘DAHDI/1-1’

I need to recreat the extension.conf, can someone help me? It is a 12 port analog card with 5 extension on from-internal, and 7 pstn ports from-pstn
nothing fancy.

My freepbx and asterisk versions are:

Core 2.6.0.0 FreePBX Enabled
Feature Code Admin 2.6.0.0 FreePBX Enabled
FreePBX ARI Framework 2.6.0.2 FreePBX Enabled
FreePBX FOP Framework 2.6.0.3 FreePBX Enabled
FreePBX Framework 2.6.0.0 FreePBX Enabled
FreePBX Localization Updates 2.6.0.2 FreePBX Enabled
SIPSTATION 2.6.0.0 Bandwidth.com Enabled
System Dashboard 2.6.0.1 FreePBX Enabled
Voicemail 2.6.0.2 FreePBX Enabled

This would be useful information. Some methods produce a backup file with a .bak extension.

ditto

The proper configuration is held in the MySQL database. Make a minor change like add a new extension in FreePBX then “Apply Configuration Changes”. The plan is that the incorrect extensions.conf will be written over by FreePBX/MySQL (just like the file warns you if you manually edit extensions.conf) and you will have your original extensions.conf restored.

Thanks Blanchae. I tried to use web GUI to delete all the extension and add them back in. It does not seem the extension.conf file get recreated. It seems only update the time stamp of that file, no file contents actually changed.

I don’t know how that works, but guessing the problem is caused by the extension.conf is so much off from the database, so that the update process probably just gave up.

I would imagine the extension.conf file from every system is very similar. If I know the format, I could manually create one. But I don’t know the format. Could someone post an extension.conf produced by the FreePBX?

I have the extensions.conf documented on my website.

Did you actually overwrite the original file located at /var/www/html/admin/modules/core/etc/extensions.conf?

Or did you just overwrite the link in /etc/asterisk?

Check that the file exists in /var/www/html/admin/modules/core/etc/extensions.conf, if not, download it from http://www.freepbx.org/trac/browser/modules/branches/2.6/core/etc/extensions.conf

Go to the bottom of the page and click on Original Format.

If the file exist in /var/www/html/admin/modules/core/etc/extensions.conf just link it back with:
cd /etc/asterisk
ln -s /var/www/html/admin/modules/core/etc/extensions.conf

I actually copied the extension.conf.sample over the /etc/asterisk/extension.conf, which is the link to the /var/www/html/admin/modules/core/etc/extensions.conf

The result of that copying was the link still there, but target file was overwritten by the sample file. Now the /var/…/extension.conf has exact the same contents of the extension.conf.sample. Too bad the freepbx can not regenerate it or update it any more by remove the extensions and add back in.

Do I need to modify this file to reflect the configuraiton in my system?

Thanks so much!

There’s nothing to do with extensions.conf.

I wonder if you “apply configuration changes” if you’ll get your extensions back? Worth a try otherwise you’ll have to add them all in again.

Read my post again:
[/quote]
if not, download it from http://www.freepbx.org/trac/browser/modules/branches/2.6/core/etc/extensions.conf
Go to the bottom of the page and click on Original Format.
[/quote]

Then copy that file to /var/www/html/admin/modules/core/etc/extensions.conf

Everything else should be as it was before.

[/quote]
Too bad the freepbx can not regenerate it or update it any more by remove the extensions and add back in.
[/quote]

Well, FreePBX generates almost every file on Apply Configuration Changes except for static files such as extensions.conf.
It is by design and cant cover for mistakes like you did.

And if you delete and extension and add it back in, FreePBX generate the extensions_additional.conf where the extensions are configured. But by overwriting extensions.conf that contains a #include extensions_additional.conf you don’t see the changes.

Hmmm, the above did not format as it should, lets try again:

Then copy that file to /var/www/html/admin/modules/core/etc/extensions.conf
Everything else should be as it was before.

Well, FreePBX generates almost every file on Apply Configuration Changes except for static files such as extensions.conf.
It is by design and cant cover for mistakes like you did.
And if you delete an extension and add it back in, FreePBX generate the extensions_additional.conf where the extensions are configured. But by overwriting extensions.conf that contains a #include extensions_additional.conf you don’t see the changes.

Thanks! That fixed it!
I really appreciate your help!