sql command to delete all the sip/iax phones from goautodial

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

sql command to delete all the sip/iax phones from goautodial

Postby striker » Wed Apr 06, 2011 1:21 pm

hi

goautodial | single server | 2.2.1 | BUILD: 100510-2015 | no hardware

i have seen the file sip-iax_phones.sql

what command to be replaced to delete all the phones from the phones table.

in that file it is
INSERT into phones (extension,dialplan_number,voicemail_id,server_ip,login,pass,status,active,phone_type,fullname,protocol,local_gmt,outbound_cid) values('cc350','350','350','10.10.10.15','350','test','ACTIVE','Y','CCagent','station 350','IAX2','-5','0000000000');
www.striker24x7.com www.youtube.com/c/striker24x7 Telegram/skype id : striker24x7
striker
 
Posts: 962
Joined: Sun Jun 06, 2010 10:25 am

Postby williamconley » Wed Apr 06, 2011 1:38 pm

delete from phones where FIELD='VALUE'

or

delete from phones where FIELD like 'VALUE%'
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

mysql sysntax error

Postby striker » Wed Apr 06, 2011 1:46 pm

this is wat i have in that sql file

DELETE FROM phones where FIELD='VALUE' (extension,dialplan_number,voicemail_id,server_ip,login,pass,status,active,phone_type,fullname,protocol,local_gmt,outbound_cid) values('cc350','350','350','10.10.10.15','350','test','ACTIVE','Y','CCagent','station 350','IAX2','-5','0000000000');

also tried value%

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values('cc350','350','350','10.10.10.15','350','test','ACTIVE','Y','CCagent','st' at line 1
www.striker24x7.com www.youtube.com/c/striker24x7 Telegram/skype id : striker24x7
striker
 
Posts: 962
Joined: Sun Jun 06, 2010 10:25 am

Postby williamconley » Wed Apr 06, 2011 2:16 pm

lol
replace "FIELD" with the name of a field.

replace "VALUE" with a value (if exact)

or

replace "VALUE%" with a value and % (if "begins with VALUE" is your goal)

it is not necessary to specify every value of the record to delete. merely a single unique value (such as cc350?). if you want to get rid of all "cc3XX" phones, you can use cc3% in the "like" version of the query.

like this:

Code: Select all
delete from phones where extension like 'cc3%';
this will delete all extensions that begin with cc3 (note the ; which is necessary if usng at the command line but optional if in phpMyAdmin or webmin's sql execution)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby DhwaniTechnologies » Thu Apr 07, 2011 12:30 am

If you want to delete ALL phones from the table, just use:
Code: Select all
delete from phones;
Vicidial, Goautodial, OSdial Consulting | Hosted Solutions
Dhwani Technologies | info@dhwanitech.com | Skype: dhwanitech
DhwaniTechnologies
 
Posts: 46
Joined: Thu Oct 14, 2010 10:03 am
Location: US/India

thanks (SOLVED)

Postby striker » Thu Apr 07, 2011 1:11 am

Thanks william /dhawanitech


the command which u provided works great and it saved my time by deleting one by one.
www.striker24x7.com www.youtube.com/c/striker24x7 Telegram/skype id : striker24x7
striker
 
Posts: 962
Joined: Sun Jun 06, 2010 10:25 am


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 36 guests