-
Notifications
You must be signed in to change notification settings - Fork 17
Description
When removing a trunk rule from the Proxy using the remove-trunk action,
the rule is correctly removed from the dispatcher table in the Kamailio
database but remains in the dialplan table. This inconsistency can lead to
unexpected behavior and requires manual intervention to fully remove the rule.
Steps to reproduce:
- Add a rule to the Proxy using the
add-trunkcommand.
Example:api-cli run module/nethvoice-proxy1/add-trunk -d '{"rule":"055555555", "destination":{"uri":"sip:10.5.4.1:20039","description":"nethvoice2"}}' - Verify that the rule is added to both the
dialplananddispatchertables
in the Kamailio database. - Remove the rule using the
remove-trunkcommand
Example:api-cli run module/nethvoice-proxy1/remove-trunk -d '{"rule":"055555555"}' - Check the
dispatcheranddialplantables in the Kamailio database.
Connect to the database with the following command:runagent -m nethvoice-proxy1 podman exec -it postgres psql -U postgres kamailio
Expected behavior
The rule should be removed from both the dispatcher
and dialplan tables in the Kamailio database.
Actual behavior
The rule is removed from the dispatcher table but remains in the dialplan
table.
Example:
dispatchertable after removal:kamailio=# select * from dispatcher; id | setid | destination | flags | priority | attrs | description | created_at | last_modified ----+-------+--------------------+-------+----------+-------+-------------+---------------------+--------------------- 5 | 2 | sip:10.5.4.1:20039 | 0 | 0 | | nethvoice2 | 2025-03-07 01:01:27 | 2025-03-07 01:01:27dialplantable after removal:kamailio=# select * from dialplan; id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | created_at | last_modified | name ----+------+----+----------+-----------------------+-----------+-----------+----------+-------+---------------------+---------------------+------ 2 | 1 | 1 | 0 | pbx.example.com | 0 | (.*) | 2 | 2 | 2025-03-07 00:55:52 | 2025-03-07 00:55:52 | 11 | 2 | 1 | 1 | sip:055555555.*@.* | 0 | (.*) | 11 | 11 | 2025-04-02 14:15:06 | 2025-04-02 14:15:06 |
Workaround
While waiting for a bugfix, the workaround involves not using the delete
command, but directly using the insert command with updated data. For example,
if the instance name changes:
api-cli run module/nethvoice-proxy1/add-trunk -d '{"rule":"055555555", "destination":{"uri":"sip:10.5.4.1:20039","description":"nethvoice3"}}'
This will update the existing rule with the new information instead of trying
to remove and re-add it.
Components:
ns8-nethvoice-proxy1.2.0
See also:
Acknowledgements:
Thanks to @mgarra for identifying the issue and providing a temporary
workaround.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status