Skip to content

Fix missing customer_ipban hash table definition in Kamailio config#140

Merged
Amygos merged 2 commits into
mainfrom
copilot/add-customer-ipban-htable
Feb 19, 2026
Merged

Fix missing customer_ipban hash table definition in Kamailio config#140
Amygos merged 2 commits into
mainfrom
copilot/add-customer-ipban-htable

Conversation

Copilot AI commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Kamailio crashes with htable not found error when route[ADD_TO_IPBAN] attempts to write to $sht(customer_ipban=>...) because the hash table is never defined.

Changes

Added missing customer_ipban hash table definition in htable module parameters:

modparam("htable", "htable", "customer_ipban=>size=10;autoexpire=300;")

Placed after ipban definition (line 123) with matching autoexpire=300 configuration for consistency.

Original prompt

The Kamailio configuration is throwing errors because it attempts to write to a shared hash table ($sht(customer_ipban=>...)) that has not been defined.

Error Log:

ERROR: htable [ht_var.c:80]: pv_set_ht_cell(): htable not found for setting $sht(customer_ipban=>...)
ERROR: <core> [core/lvalue.c:358]: lval_pvar_assign(): setting pvar failed

Location:
In modules/kamailio/config/kamailio.cfg, the route[ADD_TO_IPBAN] uses:

$sht(customer_ipban=>$avp(customer_id)-$avp(ipaddressToBan)) = 1;

Missing Configuration:
The htable module parameters section in modules/kamailio/config/kamailio.cfg defines ipban, userblocklist, etc., but is missing the definition for customer_ipban.

Fix:
Add the missing modparam definition for customer_ipban in modules/kamailio/config/kamailio.cfg. It should be defined with similar parameters to ipban, for example:

modparam("htable", "htable", "customer_ipban=>size=10;autoexpire=300;")

This ensures the table exists when the script tries to write to it.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Amygos <510232+Amygos@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing htable definition for customer_ipban Fix missing customer_ipban hash table definition in Kamailio config Feb 18, 2026
Copilot AI requested a review from Amygos February 18, 2026 14:48
@Amygos
Amygos marked this pull request as ready for review February 19, 2026 15:59
@Amygos
Amygos merged commit 0f1dfa6 into main Feb 19, 2026
9 of 10 checks passed
@Amygos
Amygos deleted the copilot/add-customer-ipban-htable branch February 19, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants