kalkun-sms / Kalkun

Open Source Web based SMS Manager

Home Page:https://kalkun.sourceforge.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sms to email plugin: impossible receive sms and error in script

kszwaba opened this issue · comments

Good morning,
I’m new in this group; Sorry for my English.
I installed kalkun [Kalkun_v0.8.0-beta-1_debianBundle with Gammu, in Debian 10.8 ( turnkey-lamp-16.1-buster-amd64)

it work fine (send and receive sms) but if I install the Plugin SMS to Email and set Enable email forwarding in plugin settings (http://MYHOSTNAME/kalkun/index.php/plugin/sms_to_email) I don’t receive any message in the web portal and if I execute the script

/var/www/html/kalkun/scripts/daemon.php in shell, I receive error

root@smsgw1 .../log/kalkun# /usr/share/kalkun/scripts/daemon.sh
PHP Warning: file_get_contents(http://localhost/kalkun/index.php/daemon/message_routine/): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error
in /usr/share/kalkun/scripts/daemon.php on line 11
PHP Stack trace:
PHP 1. {main}() /usr/share/kalkun/scripts/daemon.php:0
PHP 2. file_get_contents() /usr/share/kalkun/scripts/daemon.php:11

and this message in :
/var/log/kalkun/log.php

INFO - 2022-03-23 11:14:31 --> Config Class Initialized
INFO - 2022-03-23 11:14:31 --> Hooks Class Initialized
DEBUG - 2022-03-23 11:14:31 --> UTF-8 Support Enabled
INFO - 2022-03-23 11:14:31 --> Utf8 Class Initialized
INFO - 2022-03-23 11:14:31 --> URI Class Initialized
INFO - 2022-03-23 11:14:31 --> Router Class Initialized
INFO - 2022-03-23 11:14:31 --> Output Class Initialized
INFO - 2022-03-23 11:14:31 --> Security Class Initialized
DEBUG - 2022-03-23 11:14:31 --> Global POST, GET and COOKIE data sanitized
INFO - 2022-03-23 11:14:31 --> CSRF cookie sent
INFO - 2022-03-23 11:14:31 --> Input Class Initialized
INFO - 2022-03-23 11:14:31 --> Language Class Initialized
INFO - 2022-03-23 11:14:31 --> Config Class Initialized
INFO - 2022-03-23 11:14:31 --> Loader Class Initialized
DEBUG - 2022-03-23 11:14:31 --> Config file loaded: /usr/share/kalkun/application/config/kalkun_settings.php
INFO - 2022-03-23 11:14:31 --> Helper loaded: url_helper
INFO - 2022-03-23 11:14:31 --> MY_Model class loaded
INFO - 2022-03-23 11:14:31 --> Model "Phonebook_model" initialized
INFO - 2022-03-23 11:14:31 --> Controller Class Initialized
INFO - 2022-03-23 11:14:31 --> Database Driver Class Initialized
INFO - 2022-03-23 11:14:31 --> Helper loaded: directory_helper
INFO - 2022-03-23 11:14:31 --> Helper loaded: file_helper
DEBUG - 2022-03-23 11:14:31 --> Config file loaded: /usr/share/kalkun/application/config/plugins.php
INFO - 2022-03-23 11:14:31 --> Helper loaded: kalkun_helper
INFO - 2022-03-23 11:14:31 --> Model "Kalkun_model" initialized
INFO - 2022-03-23 11:14:31 --> Model "Gammu_model" initialized
INFO - 2022-03-23 11:14:31 --> Model "Message_model" initialized
INFO - 2022-03-23 11:14:31 --> Model "Spam_model" initialized
INFO - 2022-03-23 11:14:31 --> Model "User_model" initialized
DEBUG - 2022-03-23 11:14:31 --> Config file loaded: /usr/share/kalkun/application/plugins/sms_to_email/config/sms_to_email.php
INFO - 2022-03-23 11:14:31 --> Email Class Initialized
DEBUG - 2022-03-23 11:14:31 --> File loaded: /usr/share/kalkun/application/plugins/sms_to_email/models/Sms_to_email_model.php
ERROR - 2022-03-23 11:14:31 --> Severity: error --> Exception: Undefined property: MY_Lang::$idiom /usr/share/kalkun/application/core/MY_Lang.php 86

in web page if I execute this
http://my-server/kalkun/index.php/daemon/message_routine I retrieve this error:

An uncaught Exception was encountered

Type: ErrorException

Message: Undefined property: MY_Lang::$idiom

Filename: /usr/share/kalkun/application/core/MY_Lang.php

Line Number: 86

Backtrace:

File: /usr/share/kalkun/application/core/MY_Lang.php
Line: 86
Function: {closure}

File: /usr/share/kalkun/application/plugins/sms_to_email/sms_to_email.php
Line: 101
Function: send

File: /usr/share/kalkun/application/libraries/Plugins.php
Line: 461
Function: sms_to_email

File: /usr/share/kalkun/application/libraries/Plugins.php
Line: 630
Function: do_action

File: /usr/share/kalkun/application/controllers/Daemon.php
Line: 83
Function: do_action

File: /usr/share/kalkun/www/index.php
Line: 315
Function: require_once

If I disable "Enable email forwarding" in the plugin settings all works fine.

My config:

  • Kalkun version: 0.8.0-beta-1 [Lang: english] [CountryCode: US]
  • Operating system: Linux smsgw1 4.19.0-19-amd64 #1 SMP Debian 4.19.232-1 (2022-03-07) x86_64
  • PHP Version: 7.3.31-1~deb10u1
  • DB Backend: MySQLi 5.5.5-10.3.27-MariaDB-0+deb10u1 (mysqli)
  • Gammu version: Gammu 1.40.0, Linux, kernel 4.19.0-19-amd64 (#1 SMP Debian 4.19.232-1 (2022-03-07)), GCC 8.2
  • Gammu DB schema: 17
  • Browser: Firefox 87.0
  • Plugins: sms_to_email

Can you help me to identify the problem? I need to activate SMS2email feature.

Thank you in advance.

Christopher.

Thanks for your detailed report.

Please try adding this line to my_lang class, below the line public $locale = 'en';

private $idiom = '';

This line is actually missing in the code.

If this solves the issue could you please send a pull request with that fix and mention "fixes #463" in the commit message?

Btw, did you update the config file of sms2email plugin in the plug-in config directory?