kalkun-sms/Kalkun

Blacklist plugin error

Closed this issue · 4 comments

Describe the bug
Activated the "blacklist number" plugin. The mysql's table "plugin_blacklist_number" wasn't created (it may have something to do with my setup).
More importantly, the blacklist plugin says it blocks incoming and outgoing messages. Incoming messages are effectively blocked but outgoing aren't.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Plugins
  2. Install "blacklist number" plugin, click on it it's name, add a number to blacklist.
  3. If mysql's table wasn't created an error page appears saying it.
  4. (if the table was created) Send an sms to & from blocked number.
  5. Sms sent from number is blocked, but the sms sent to the numbers passes and is received by the telephone.

Expected behavior
Automatic creation of tables.
Block outgoing sms from sending.

Browser, kalkun setup, database setup..:

  • Kalkun version: 0.8.0 [Lang: spanish] [CountryCode: ES]
  • Operating system: Linux kalkunpod 5.14.0-162.6.1.el9_1.0.1.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Nov 28 18:44:09 UTC 2022 x86_64
  • PHP Version: 8.0.24
  • DB Backend: MySQLi 10.9.3-MariaDB-1:10.9.3+maria~ubu2204 (mysqli)
  • Gammu version: Gammu 1.42.0, Linux, kernel 5.14.0-162.6.1.el9_1.0.1.x86_64 (#1 SMP PREEMPT_DYNAMIC Mon Nov 28 18:44:09 UTC 2022), GCC 11.2
  • Gammu DB schema: 17
  • Browser: Chrome 108.0.5359.98
  • Plugins: blacklist_number, jsonrpc, rest_api

Additional context
Kalkun is running in a container with two separate containers, one for mysql (mariadb) and an other for kalkun proper (which is running a top nginx). That might have something to do with the first bug.

The database error seems to happen also for the whitelist plugin:
"A Database Error Occurred
Error Number: 1146
Table 'kalkun.plugin_whitelist_number' doesn't exist
SELECT count(*) as count FROM plugin_whitelist_number
Filename: plugins/whitelist_number/models/Whitelist_number_model.php
Line Number: 44"
Captura desde 2023-01-29 11-28-02

I've tried also to use the whitelist plugin & it also doesn't work. When the plugin is set for detecting number '6XXXXXXXX' it allows every sms outgoing to any number.

tenzap commented

Could you check if the username you use for the database has the permissions to create tables? This permissions must be granted.

tenzap commented

Automatic creation of tables.

Fixed in #492

Block outgoing sms from sending.

Can't reproduce when applying the commits of #492 (didn't try without the fix)

For whitelist number, you must set a regex pattern. For example /6.*/
Match pattern as required by PHP's preg_match() https://www.php.net/manual/en/function.preg-match.php

tenzap commented

Could you please check that #492 fixes your issues?