Sip-trip-phone with nextcloud 24.0.1

i’m trying to integrate sip-trip-phone “astrik” but every time it pop-up to the same nextcloud dashboard not to the phone screen! anyone can help?!

{“reqId”:“SXsdjqLMjuxhhyhvEG1k”,“level”:3,“time”:“2022-08-09T09:27:19+00:00”,“remoteAddr”:“154.x.x.x”,“user”:“test”,“app”:“PHP”,“method”:“GET”,“url”:“/index.php/apps/sip_trip_phone/user/getsettings/%3C?php%20p($userId);%20?%3E”,“message”:“Trying to access array offset on value of type bool at /var/www/nextcloud/apps/sip_trip_phone/lib/Service/SphoneService.php#57”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36”,“version”:“24.0.1.1”,“exception”:{“Exception”:“Error”,“Message”:“Trying to access array offset on value of type bool at /var/www/nextcloud/apps/sip_trip_phone/lib/Service/SphoneService.php#57”,“Code”:0,“Trace”:[{“file”:“/var/www/x.taqnya.cloud/apps/sip_trip_phone/lib/Service/SphoneService.php”,“line”:57,“function”:“onError”,“class”:“OC\Log\ErrorHandler”,“type”:“::”},{“file”:“/var/www/nextcloud/apps/sip_trip_phone/lib/Controller/SphoneController.php”,“line”:50,“function”:“getsettings”,“class”:“OCA\SIPTripPhone\Service\SphoneService”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:225,“function”:“getsettings”,“class”:“OCA\SIPTripPhone\Controller\SphoneController”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:133,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/AppFramework/App.php”,“line”:172,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Route/Router.php”,“line”:298,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/var/www/nextcloud/lib/base.php”,“line”:1023,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/var/www/nextcloud/index.php”,“line”:36,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/var/www/nextcloud/lib/private/Log/ErrorHandler.php”,“Line”:92,“CustomMessage”:“–”},“id”:“62f22c8162099”}

edited with the error i get also i’m using apache reverse proxy do i need to do extra configuration to redirect to Asterisk ??

SIP Trip Phone won’t start correctly unless you configure your web server as specified in the documentation. On the application’s Nextcloud page it is specified: “The web server has to be configured to allow access to a specific directory and to proxy WebSocket traffic to a specific URL, as explained in the ‘Admin documentation’”.

There are multiple web server configurations possible, depending on your situation. Since you mention that you are using Apache and you want to connect SIP Trip Phone to Asterisk, the Apache configuration for Nextcloud served on a subdomain (like ‘cloud.example.com’) or on a subdirectory (like ‘example.com/nextcloud’), with all its apps, including SIP Trip Phone, is here.

Don’t forget to enter the right credentials on the application’s Settings page, as explained in the mentioned documentation. Otherwise, the application won’t start correctly, or it will start but won’t connect to Asterisk. The error that you are showing above, “Trying to access array offset on value of type bool” usually appears in logs when no credentials were entered on the application’s Settings page.

Hi,

I’m having the same problem in NC v24, also updated to v25.0.1 and the problem persists. In older versions I have no problem with my apache configuration. Now, I changed the configuration as described in grhdt_b reply instructions and the problem is the same.

I think that the problem is not related with the websockets, it’s with NC addressing, I think, let me explain:

  1. Pressing the Sip Trip Phone in the toolbar it make a get request

GET https://cloud.mydomain.com/index.php/apps/sip_trip_phone/phone/index.html

  1. Apache responds with a 302 Moved temporarily, in the location header we can see:

Location https://cloud.mydomain.com/index.php/apps/dashboard/

  1. Then, in the new window, the dashboard is loaded, instead the phone/index.html

Config is as described in apache configuration for nextcloud, directoryIndex is modified to search index.html.

Do you know how can I fix it?

–

I also tried in a new fresh install using docker-compose with nginx and have the same problem, dashboard is opened in new window.

Best Regards!

Why haven’t you enabled ‘pretty URLs’, to remove the index.php part from every Nextcloud URL, as instructed here.

The documentation is clear: if you use Apache to serve Nextcloud on a subdomain, you have to enable ‘pretty URLs’ by adding the following 2 lines in your /var/www/cloud.example.com/config/config.php file, right below the version line:

  'overwrite.cli.url' => 'https://cloud.example.com',
  'htaccess.RewriteBase' => '/',

and then update your .htaccess file by running:

sudo -u www-data php /var/www/cloud.example.com/occ maintenance:update:htaccess

Then restart Apache:

systemctl restart apache2

So, the URL of the app should be: https://cloud.example.com/apps/sip_trip_phone/phone/index.html. It shouldn’t contain index.php.

Also, please pay attention to the rest of the Apache configuration listed on the above mentioned documentation page. This app works perfectly fine with both Nextcloud version 24 and 25, if you configure it carefully as explained in the documentation. The web server really needs to be configured that way and the ‘pretty URLs’ really need to be enabled. Otherwise, the app won’t work. We explained that the web server configuration is different for these 4 cases:

  1. Nextcloud installed on a subdomain served by Nginx.
  2. Nextcloud installed on a subdirectory seved by Nginx.
  3. Nextcloud installed on a subdomain served by Apache.
  4. Nextcloud installed on a subdirectory served by Apache.

There are also differences if you connect SiP Trip Phone to the SIP provider directly, instead of connecting it via Asterisk. This is also explained.

Also, please post any issues you might have in the future on the dedicated Isssues page for SIP Trip Phone, or even on the Issues page on GitHub, if you find it easier. I wasn’t seeing email notifications from this thread, this is why it took so much to respond. I have changed my email address now. However, the Issues page is the proper place to mention future problems.

Since we are into this issue now, please Aaa1 and jmartin4 respond with your results here, so that I know if you have solved your problems.

Hi,

It’s working, thank you for your help.

I’ll explain the problem, it could help other people.

Config for pretty urls was enabled and configured like described. The problem raised during update to v24, I use a debian packaged version of nextcloud and the post-update script were not abble to update htaccess file.

Doing it manual:

root@cloud:/# sudo -u www-data /var/www/nextcloud/occ maintenance:update:htaccess
Error updating .htaccess file, not enough permissions or "overwrite.cli.url" set to an invalid URL?

root@cloud:/# ls -l /var/www/nextcloud/.htaccess
-rw-r--r--  1 root     www-data  3253 May  2  2022 .htaccess

To fix it:

root@cloud:/# chmod 664 /var/www/nextcloud/.htaccess
root@cloud:/# sudo -u www-data /var/www/nextcloud/occ maintenance:update:htaccess

Thank you jmartin4 for your feedback. Since he hasn’t added any comments, I deduce that Aaa1 has also solved his problem, so, I will consider this issue as solved. Please consider posting any future issues regarding this app on the Issues pages mentioned above.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.