simontelephonics / smsconnector

SMS Connector module for FreePBX 16 and 17
https://simon.tel/open-source/
GNU General Public License v3.0
43 stars 16 forks source link

Can't reload after enabling SIP SMS #58

Closed MatthewLJensen closed 1 month ago

MatthewLJensen commented 1 month ago

I tried enabling SIP SMS within the user settings on a FreePBX 17 system. When I tried to reload I got the following error:

In Sip.class.php line 158:

  [Whoops\Exception\ErrorException (2)]
  Undefined array key "flag"

Exception trace:
  at /var/www/html/admin/modules/core/functions.inc/drivers/Sip.class.php:158
 Whoops\Run->handleError() at /var/www/html/admin/modules/core/functions.inc/drivers/Sip.class.php:158
 FreePBX\modules\Core\Drivers\Sip->addDevice() at /var/www/html/admin/modules/core/Core.class.php:1706
 FreePBX\modules\Core->addDevice() at /var/www/html/admin/modules/smsconnector/Smsconnector.class.php:963
 FreePBX\modules\Smsconnector->doDialplanHook() at /var/www/html/admin/libraries/BMO/DialplanHooks.class.php:109
 FreePBX\DialplanHooks->processHooks() at /var/www/html/admin/libraries/Console/Reload.class.php:323
 FreePBX\Console\Command\Reload->reload() at /var/www/html/admin/libraries/Console/Reload.class.php:95
 FreePBX\Console\Command\Reload->execute() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Command/Command.php:312
 Symfony\Component\Console\Command\Command->run() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:1022
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:314
 Symfony\Component\Console\Application->doRun() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:168
 Symfony\Component\Console\Application->run() at /var/lib/asterisk/bin/fwconsole:163

reload [--json] [--dry-run] [--skip-registry-checks] [--dont-reload-asterisk]

It seems like it might be trying to run code related to SIP instead of PJSIP, but that's a total shot in the dark. Here's the code from sip.class.php around line 158:

image

billsimon commented 1 month ago

Can you give me some more details about your system so that I can try to reproduce this?

MatthewLJensen commented 1 month ago

I did restore from a FreePBX 16 system that was running an older version of asterisk. However (as far as I've found) there are no SIP (non-pjsip) endpoints on the old system, and so none should have been converted during the migration.

Asterisk Version: 21.4.3

chan_sip module loaded: doesn't appear so

chan_sip enabled? I don't think so. I don't even see the sip driver option in advanced settings. Asterisk SIP settings page only shows PJSIP

Any chan_sip endpoints? Not that I can locate

was this an upgrade/migration using backup/restore? Yes

were any chan_sip endpoints converted to pjsip in migration? No

Version of SMS Connector: 16.0.17.1 (is there a 17.x release I should be using?)

HOWEVER, after figuring this info out I realized that some of the extensions I was enabling this setting on were created new on the 17 system and some had come over in the restore process. I tried them one by one and they all worked except for one (out of two) extensions that had been restored. I then tried changing the name of the extension and reloading and that somehow solved the problem and I can now toggle sip sms off and on on the extension in question with no problem reloading.

billsimon commented 1 month ago

Version of SMS Connector: 16.0.17.1 (is there a 17.x release I should be using?)

This is the correct version for both FreePBX 16 and 17.

I am unable to reproduce this and since you have resolved the problem on your system, I will close the issue at this time.