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-trunk command.
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
dialplan and dispatcher tables
in the Kamailio database.
- Remove the rule using the
remove-trunk command
Example:
api-cli run module/nethvoice-proxy1/remove-trunk -d '{"rule":"055555555"}'
- Check the
dispatcher and dialplan tables 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:
dispatcher table 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:27
dialplan table 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-proxy 1.2.0
See also:
Acknowledgements:
Thanks to @mgarra for identifying the issue and providing a temporary
workaround.
When removing a trunk rule from the Proxy using the
remove-trunkaction,the rule is correctly removed from the
dispatchertable in the Kamailiodatabase but remains in the
dialplantable. This inconsistency can lead tounexpected behavior and requires manual intervention to fully remove the rule.
Steps to reproduce:
add-trunkcommand.Example:
dialplananddispatchertablesin the Kamailio database.
remove-trunkcommandExample:
dispatcheranddialplantables in the Kamailio database.Connect to the database with the following command:
Expected behavior
The rule should be removed from both the
dispatcherand
dialplantables in the Kamailio database.Actual behavior
The rule is removed from the
dispatchertable but remains in thedialplantable.
Example:
dispatchertable after removal:dialplantable after removal: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:
This will update the existing rule with the new information instead of trying
to remove and re-add it.
Components:
ns8-nethvoice-proxy1.2.0See also:
Acknowledgements:
Thanks to @mgarra for identifying the issue and providing a temporary
workaround.