Strange Behaviour of Outbound Routes

So I’ve just installed a new Freepbx from the distro, and the install went well generally. Ran an yum update and a FreePBX module update after install and everything is now up to date. Now at FreePBX 14.0.1rc1.17 and Asterisk 14.5

Then spent the day setting up the trunks and extensions and now I’m doing the outbound routes. When I add an outbound route that’s great and it seems all good, but if I edit that route then submit I’ll get two with the same name.

If I delete both and then add two outbound routes with different trunks then the trunks will merge between them.

So, deleted all the outgoing routes, created a single route called national. Great.
Then selected that route, changed nothing and submit and now I’ve got two called national

from the table outbound_routes

+----------+----------+--------+-------------+----------+-----------------+--------------------+----------+---------------+------+-----------+----------+-------------+-------------------+
| route_id | name     | outcid | outcid_mode | password | emergency_route | intracompany_route | mohclass | time_group_id | dest | time_mode | timezone | calendar_id | calendar_group_id |
+----------+----------+--------+-------------+----------+-----------------+--------------------+----------+---------------+------+-----------+----------+-------------+-------------------+
|        0 | national |        |             |          |                 |                    | default  |             0 |      |           | default  | NULL        | NULL              |
|        0 | national |        |             |          |                 |                    | default  |             0 |      |           | default  | NULL        | NULL              |
+----------+----------+--------+-------------+----------+-----------------+--------------------+----------+---------------+------+-----------+----------+-------------+-------------------+

So now I’m stuck. I can’t add any routes and really don’t want to have to re-install and start from scratch again. Any ideas?

Just FYI I’ve uninstalled all the commercial modules so none of those are affecting anything.

Ok, so I’ve fixed this, but just in case anyone gets here again this is what I did…

I tried to upgrade the framwork module (since routing is done from core/views/routing but it fails with a key violation on keyword in freepbx_settings. Checking that with

select keyword, count(*) from freepbx_keywords group by keyword

Showed it was full of duplicates, some 6 or more. I dumped the table into a temp table then re-populated it with select distinct, but there were still duplicates but not many and those I nailed with delete from freepbx_settings where keyword=‘whatever’ limit 1;

Anyway long story short, removed all the dups and checked with alter table freepbx_settings add primary key (keyword) which worked fine.

Another table that was full of duplicates was module_xml so I just emptied it.

Then I ran a fwconsole ma upgrade framework which worked this time, I removed webrtc and then upgraded all the other modules using the GUI.

Finally when I went into config.php?display=routing it was empty as in no routes, yet the outbound_routes table had routes so I truncated that and the other three tables associated with routes.

Then I setup a new outbound route in the GUI and that setup the outbound_route table just fine, added another, all fine, edited, deleted, all working.

In summary, I don’t know why it broke but its working now. I’d still like to hear from one of the developers on how I wound up here, and more importantly if there’s anything else I should check to ensure stability?