Manually Remove Extension

Hello,

I have a issue where I was removing a user and the phone and was going to create a new extension and link his phone to him. When I try to put the extension I just deleted in, it tells me there is a user still associated with it, and it is him.

I cannot find that extension anywhere in the GUI part, BUT the Reports - Peers shows it still there. I cannot find it anywhere else but here.

How do I manually remove it from the system?? I found this article but it is from 2014…

how-to-remove-an-extension-manually/10141 - it states I cannot put links in here so this is the end of the link and it is under General Help. The Database is Maria and this references mysql.

Is this the correct way?? Or is there another way?? HELP! I need to get this phone to this Teacher ASAP and very new to this software so I am definately diving in feet first and well need to get this resolved quickly.

Any help would be greatly appreciated. Yes I did reboot the server as well to see if that would help, but when I try to add that extension it still states it is in use by the user I want to use.

Try running

mysql -u root -D asterisk -e "select * from users where extension like '100';"
mysql -u root -D asterisk -e "select * from devices where id like '100';"

Where 100 is the extension number in question.

1 Like

So run this in the Asterisk CLI command area so mine would look like
mysql -u root -D asterisk -e “Select * from users where extension like ‘6144’;”

Correct?

Not from Asterisk CLI - run it from a shell.

taking this a simpler way, as this has happened to me…

did you forget to hit “Apply Config” after deleting the extension in the GUI?

1 Like

Yes I did sadly, was too much in a hurry :roll_eyes:

so are you Good now?
or are you still hosed?
we can likely help you find it via the SQL CLI if necessary

So should I run the commands given to me by adell4444 and see what happens? Or is it simpler through the SQL CLI?

that is the mysql CLI.

from command line (nothing to do with asterisk -r, or fwconsole, just the command line)

mysql -u root -D asterisk -e "select * from users where extension like '6144';"
mysql -u root -D asterisk -e "select * from devices where id like '6144';"

Tried that at the command prompt on the server under root and it comes back with Extension Number already in use by error :frowning:

So how did you fix yours when you did that?

Well did the requested and still no luck. The extension still says it is in use and the only place you can find it is in Reports - Peers with the extension and nothing with it.

Sorry @IdahoTech , the “SELECT” is returning “Extension in use”?

or after running the select, you are trying to re-add?

the commands sent are merely to Check, not to Delete.

After I run the commands at the prompt on the server. I then go into the GUI and to Extensions and re-add the extension and that is where I get the Extension in use. I have attached a photo…

When I run the commands it just goes back to the command prompt after each entry. And when I look in Reports - Asterisk Info - Peers it shows it there but nothing else with it. Not even the name…I cannot find this user or the extension anywhere else but here…

As @sholinaty intimated,

mysql -u root -D asterisk -e "delete  from users where extension like '6144'"
mysql -u root -D asterisk -e "delete  from devices where id like '6144'"

Well I tried that dicko and no luck still get the same error. Anything else I should run after those two lines? I had the ; in the line where your lines did not, should I have taken that out?

mysql -u root -D asterisk -e “delete from users where extension like ‘6144’;”
mysql -u root -D asterisk -e “delete from devices where id like ‘6144’;”

No. the terminating semicolon is unnecessary but harmless, did you fwconsole restart after having mysql delete the bogosity ?

No I did not. Just do that at the command prompt on the server, correct? It will not reboot the server will it. Do not want to take the phones down in the district.

Shouldn’t be a problem but fwconsole reload would be less traumatic, current calls would not be dropped, but accomplish the same result.