DB error: already exists whenever I am adding a trunk

Hello all.
Running a Ubuntu 12.04 based FreePbx 2.11.0.2, everything worked fine for a while, now I have errors when trying to add trunks. Started randomly, every now and then, and now I cannot neither adding nor edit existing trunks. The detail of the error is this one:

FATAL ERROR

DB Error: already exists

INSERT INTO sip (id, keyword, data, flags) values (‘tr-peer-3’,?,?,‘1’)

Trace Back

/var/www/admin/modules/core/functions.inc.php:6044 die_freepbx()
[0]: DB Error: already exists

INSERT INTO sip (id, keyword, data, flags) values (‘tr-peer-3’,?,?,‘1’)

/var/www/admin/modules/core/functions.inc.php:5955 core_trunks_addSipOrIax()

Couldn’t find anything on the kb or forums, any help appreciated. My understanding is that there must be something wrong on the sip table, as I can install ext. no problem, but I might be after a red herring. Thanks in advance for any help.

Problem solved. After duplicating & deleting a trunk, for some reason the sip table kept some data from that trunk, and didn’t allow anything else to be added to the table. Deleted the “phantom trunk” via CLI, everything worked fine since. Our tech that fixed it says he found the issue in functions.inc.php in /var/www/admin/modules/core, line 6044, if this can be of any help

hi
i have the same problem…how can i fixed exactly ?
how can i delete trunk via cli?
thanks !
IN

Hya. we had to access MySQL database and delete the entry from there. Sorry, can’t remember exactly what the table was (I didn’t do the operation myself, our security guy did it), but once we deleted the dead record, everything went fine.