Can not delete empty extension

I have a wireless USB keyboard and while creating a new extinction for an ATA-168 the keyboard battery dyed.
I managed to create an empty extension (no name or extension number).

This is from /etc/asterisk/sip_additional.conf
[]
type=friend
secret=
record_out=Adhoc
record_in=Adhoc
qualify=yes
port=5060
pickupgroup=
nat=yes
mailbox=@device
host=dynamic
dtmfmode=rfc2833
disallow=
dial=SIP/
context=from-internal

How can I delete it? The web gui will not allow it.

sounds like you may have a dated version of FreePBX that allowed that, as there was an issue some time back where that could happen but I believe it had been fixed some time back.

You are going to have to go into the database and delete the row from the devices and users table, and then all the entries in the sip table related to that extension. Then you will need to go into the Asterisk CLI and find the bogus entries that will probably look something like AMPUSER// and DEVICE// with various things under them. Those will also have to be deleted with ‘database deltree’ as there were some odd bugs that would happen if they were left present.

Then - upgrade to the latest version if not already there so that hopefully that doesn’t happen again.

I am using FreePBX Ver 2.4.0.1. I thought I was keeping it up to date but I check for an update.
using Webmin in the database Asterisk, i deleted the bad entries from the SIP and extensions. Then from Asterisk CLI database show listed the bad extension:

/AMPUSER//cidname : ATA-186-1
/AMPUSER//cidnum :
/AMPUSER//device :
/AMPUSER//noanswer :
/AMPUSER//outboundcid :
/AMPUSER//password :
/AMPUSER//recording : out=Adhoc|in=Adhoc
/AMPUSER//ringtimer : 0
/AMPUSER//voicemail : novm

I used “database deltree /AMPUSER//” with “Database entries removed” returned.

I did a reload and a reboot but the bad extension is still there. What am I missing?

once you delete the db entries and astdb entries, you need to press the orange bar for it to regenerate the config files

I had the same issue using an old FreePBX (the one pre-installed with PBX in flash 1.0). Here is what I did, when I’ve added an Extension with “Spare2” Display Name and blank parameters for all, I cannot dial even local extensions so I revert to my previous backup fixing the dial plan issue and deleting the entry on Freepbx, but it introduce other problem in my Caller ID where “Spare2” is always prefixing on my CLI. I’ve try deleting the entry on the database using “database deltree /AMPUSER//” and “database deltree /DEVICE//”, then “restart now” and “amportal restart”.

Here is my “database show” entry:
/AMPUSER//cidname : Spare2
/AMPUSER//cidnum :
/AMPUSER//device :
/AMPUSER//noanswer :
/AMPUSER//outboundcid :
/AMPUSER//password :
/AMPUSER//recording : out=Adhoc|in=Adhoc
/AMPUSER//ringtimer : 0
/AMPUSER//voicemail : novm

I’ve also upgraded to Freepbx 2.3.1.5 which fixed the bug on adding invalid extensions but I still have the invalid entry on the database.

you have to ‘database deltree AMPUSER//cidnam’, ‘database deltree AMPUSER//cidnum’, and so on - each one.

I’ve used "database deltree /AMPUSER// and so on which didn’t work, it should “database deltree AMPUSER//” without the “/” prior to .

Thanks Philip.