Adding SIP trunk get DB error that duplicate key exists

I’m trying to add a SIP trunk. . When I attempt to add any new SIP trunk (with any trunk name, in this case testtrunk44), I get this. Any thoughts on how I can get rid of this record in the DB? Thanks in advance.

FATAL ERROR

DB Error: already exists

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

Trace Back

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

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

/var/www/html/admin/modules/core/functions.inc.php:5757 core_trunks_addSipOrIax()
[0]: host=provider ip address username=userid secret=password type=peer
[1]: sip
[2]: testtrunk4-4
[3]: 2
[4]: 0
[5]: peer

/var/www/html/admin/modules/core/functions.inc.php:5693 core_trunks_backendAdd()
[0]: 2
[1]: sip
[2]: testtrunk4-4
[3]:
[4]:
[5]: 8008818149
[6]: host=provider ip address username=userid secret=password type=peer
[7]:
[8]: secret=password type=user context=from-trunk
[9]:
[10]: off
[11]:
[12]: off
[13]: testtrunk44
[14]:

/var/www/html/admin/modules/core/page.trunks.php:162 core_trunks_add()
[0]: sip
[1]: testtrunk4-4
[2]:
[3]:
[4]: 8008818149
[5]: host=provider ip address username=userid secret=password type=peer
[6]:
[7]: secret=password type=user context=from-trunk
[8]:
[9]: off
[10]:
[11]: off
[12]: testtrunk44
[13]:

/var/www/html/admin/config.php:321 include()
[0]: /var/www/html/admin/modules/core/page.trunks.php

What versions of FreePBX? How did you install?

Asterisk (Ver. 1.8.20.1)
PBX Firmware: 2.210.62-6
PBX Service Pack: 1.0.0.0

I should state that the PBX has been working… phone to phone for months, but as soon as I wanted to bring in SIP trunking, this surfaced.

I figured it out. All I needed to do was delete the rows in the asterisk.sip table which were offending.

Hi iflights.
I seem to be having the same problem as you.
Is there any way you can provide further explanation on how to delete these rows?

Any help would be greatly appreciated.

Thanks

Not to worry, I found all the info I needed here.

http://bugs.elastix.org/view.php?id=1412
http://www.freepbx.org/forum/general-help/database-information

Thanks anyways :slight_smile: