DoubleBastionAdmin / sms-relentless

3 stars 1 forks source link

SMS app not connecting to API #2

Closed linuxacademyir closed 2 years ago

linuxacademyir commented 2 years ago

Hello Thank you for your super Apps for nextcloud i am trying to use the SMS app and i have configured it according to your docs to use it with telnyx. when i try to choose the provider and sender ID in the app to send SMS, it keeps loading and dosnt show any thing, here is the log i get, please advise

running nextcloud 23 on UBUNTU 18.04 server

{"reqId":"RaJcWRNh0W01SFwcRPBP","level":3,"time":"2022-05-07T10:28:51-04:00","remoteAddr":"45.153.243.138","user":"admin","app":"index","method":"POST","url":"/cloud/index.php/apps/sms_relentless/user/getbalancetel/%3C?php%20p($userId);%20?%3E","message":"Authenticated ciphertext could not be decoded.","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:99.0) Gecko/20100101 Firefox/99.0","version":"23.0.4.1","exception":{"Exception":"Exception","Message":"Authenticated ciphertext could not be decoded.","Code":0,"Trace":[{"file":"/usr/local/lib/owncloud/apps/sms_relentless/lib/Service/SmsrelentlessService.php","line":399,"function":"decrypt","class":"OC\Security\Crypto","type":"->","args":[" sensitive parameters replaced "]},{"file":"/usr/local/lib/owncloud/apps/sms_relentless/lib/Controller/SmsrelentlessController.php","line":105,"function":"getapicredentials","class":"OCA\SMSRelentless\Service\SmsrelentlessService","type":"->"},{"file":"/usr/local/lib/owncloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getbalancetel","class":"OCA\SMSRelentless\Controller\SmsrelentlessController","type":"->"},{"file":"/usr/local/lib/owncloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/usr/local/lib/owncloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/usr/local/lib/owncloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/usr/local/lib/owncloud/lib/base.php","line":1008,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/usr/local/lib/owncloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/usr/local/lib/owncloud/lib/private/Security/Crypto.php","Line":133,"CustomMessage":"--"}}

DoubleBastionAdmin commented 2 years ago

If it keeps loading when you select Telnyx on the 'Balance' line and when you click the Refresh button on the 'Set ID' line, it means it cannot connect to your Telnyx account. From the error that you posted above it seems that the credentials that you entered on the Settings page of this app weren't saved to the database. Please remove all the data from all the fields on the Settings page, then enter again the credentials that are necessary for the app to connect to the Telnyx account: Telnyx API Secret Key Telnyx Account Public Key Messaging Profile ID Telnyx webhook URL for incoming SMS Telnyx webhook URL for delivery receipts Telnyx alphanumeric Sender ID

I just tested this app with Nextcloud 23 and 24 and it works fine. Make sure you copy/paste your credentials from your Telnyx account without spaces, etc.

linuxacademyir commented 2 years ago

thank you for your reply

can i leave Telnyx alphanumeric Sender ID blank? what if i dont have alphanumeric sender ID?

On May 7, 2022, at 19:34, DoubleBastionAdmin @.***> wrote:

If it keeps loading when you select Telnyx on the 'Balance' line and when you click the Refresh button on the 'Set ID' line, it means it cannot connect to your Telnyx account. From the error that you posted above it seems that the credentials that you entered on the Settings page of this app weren't saved to the database. Please remove all the data from all the fields on the Settings page, then enter again the credentials that are necessary for the app to connect to the Telnyx account: Telnyx API Secret Key Telnyx Account Public Key Messaging Profile ID Telnyx webhook URL for incoming SMS Telnyx webhook URL for delivery receipts Telnyx alphanumeric Sender ID

I just tested this app with Nextcloud 23 and 24 and it works fine. Make sure you copy/paste your credentials from your Telnyx account without spaces, etc.

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120224592, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP227BHXG5JVSUCAYS3DVI2BBFANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

Yes, the alphanumeric Sender ID can be left blank. Please make sure that you associate the Messaging Profile with your Telnyx number by clicking on 'Numbers' on the left side bar in your Telnyx account, then selecting the name of the Messaging Profile from the drop down list, under 'Messaging Profile', on the row of the phone number.

linuxacademyir commented 2 years ago

i ll check it thank you i upgraded to nextcloud 24 installing the SMS app shows this error Column "oc_sms_relent_received"."message" is type String, but exceeding the 4.000 length limit.✖

screenshot has been attached

On May 7, 2022, at 19:42, DoubleBastionAdmin @.***> wrote:

Yes, the alphanumeric Sender ID can be left blank. Please make sure that you associate the Messaging Profile with your Telnyx number by clicking on 'Numbers' on the left side bar in your Telnyx account, then selecting the name of the Messaging Profile from the drop down list, under 'Messaging Profile', on the row of the phone number.

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120225816, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP27NLXZGYD6DRKNLD73VI2B6ZANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

I'll push a new version of SMS Relentless to the app store with the length of that field changed.

linuxacademyir commented 2 years ago

thank you very much

On May 7, 2022, at 20:28, DoubleBastionAdmin @.***> wrote:

I'll push a new version of SMS Relentless to the app store with the length of that field changed.

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120232423, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP24IEXN2NZVWZUQ67G3VI2HJXANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

The new version of SMS Relentless, 1.0.4, has been pushed to the Nextcloud app store. It will become available for update from inside Nextcloud after a few hours. Please let me know if you have any problems.

linuxacademyir commented 2 years ago

Hello. yes i saw it thank you

its 1.0.4 i tried to update and i did update it still has the same issue

On May 8, 2022, at 04:42, DoubleBastionAdmin @.***> wrote:

The new version of SMS Relentless, 1.0.4, has been pushed to the Nextcloud app store. It will become available for update from inside Nextcloud after a few hours. Please let me know if you have any problems.

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120320833, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP2YZ2SDLXZP5L2CPXZDVI4BGPANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

The 'message' column in the 'oc_sms_relent_received' and 'oc_sms_relent_sent' tables is now of type TEXT, so the 4000 Bytes size limit imposed for STRING columns in the new version of Nextcloud doesn't apply anymore. Do you see any SQL related errors in the log ? Is it still not able to connect to the Telnyx API ? Can you use phpMyAdmin to look into the 'oc_sms_relent_settings' table and see if the credentials that you enter on the Settings page are saved to that table ?

linuxacademyir commented 2 years ago

i upgraded to version 24 so i havent been able to install the SMS app though cant look into database now if you help me set up the SMS then i can look into database do u have an idea why its showing this error?

On May 8, 2022, at 16:49, DoubleBastionAdmin @.***> wrote:

The 'message' column in the 'oc_sms_relent_received' and 'oc_sms_relent_sent' tables is now of type TEXT, so the 4000 Bytes size limit imposed for STRING columns in the new version of Nextcloud doesn't apply anymore. Do you see any SQL related errors in the log ? Is it still not able to connect to the Telnyx API ? Can you use phpMyAdmin to look into the 'oc_sms_relent_settings' table and see if the credentials that you enter on the Settings page are saved to that table ?

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120408712, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP27WIRQSC5JPSZZY62LVI6WM5ANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

What error ?

linuxacademyir commented 2 years ago

the same error i sent you the screen shot sending again please see the attached files i can download it but cant enable it

An error occured during the request. Unable to proceed. Column "oc_sms_relent_received"."message" is type String, but exceeding the 4.000 length limit.✖ and here my tables in my databases, the SMS tables haven not been created oc_recent_contact | | oc_schedulingobjects | | oc_share | | oc_share_external | | oc_sip_trip_phone | | oc_storages | | oc_storages_credentials | | oc_systemtag | | oc_systemtag_group | | oc_systemtag_object_mapping | | oc_talk_attachments | | oc_talk_attendees

On May 8, 2022, at 16:52, DoubleBastionAdmin @.***> wrote:

What error ?

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120409198, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP25LV7KTKHEQ3Z5QAC3VI6WZTANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

As I said, the column "oc_sms_relent_received"."message" in the 1.0.4 version is not of type String anymore. It's TEXT and the 4000 limit doesn't apply anymore, so, you shouldn't see that error when you try to install version 1.0.4. Therefore, to be able to make a fresh install of SMS Relentless version 1.0.4 please first disable SMS Relentless if it is enabled, then press the Remove button on the Apps page in Nextcloud to totally remove all the files of SMS Relentless, then look inside the 'apps' folder of your Nextcloud installation if the 'sms_relentless' folder is gone. If it's still there delete it manually. Then restart your web server and make a fresh install of SMS Relentless 1.0.4 from inside Nextcloud, like you would do with any other app.

linuxacademyir commented 2 years ago

i did what exactly you said i removed the app i looked inside the app folder and it was not there i restarted my web server (nginx) and from nextcloud app i tried to install it again and still shows the error is there any cache or some thing like that some where in next cloud i should look into?

On May 8, 2022, at 17:05, DoubleBastionAdmin @.***> wrote:

As I said, the column "oc_sms_relent_received"."message" in the 1.0.4 version is not of type String anymore. It's TEXT and the 4000 limit doesn't apply anymore, so, you shouldn't see that error when you try to install version 1.0.4. Therefore, to be able to make a fresh install of SMS Relentless version 1.0.4 please first disable SMS Relentless if it is enabled, then press the Remove button on the Apps page in Nextcloud to totally remove all the files of SMS Relentless, then look inside the 'apps' folder of your Nextcloud installation if the 'sms_relentless' folder is gone. If it's still there delete it manually. Then restart your web server and make a fresh install of SMS Relentless 1.0.4 from inside Nextcloud, like you would do with any other app.

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120411024, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP25B5CDPASR4Y2WBFY3VI6YI7ANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

Ok. Just a second. Let me check and run a test to delete everything and install the app again to see if I can reproduce your error. I'll post here the result when finished.

linuxacademyir commented 2 years ago

sure thank you

On May 8, 2022, at 17:11, DoubleBastionAdmin @.***> wrote:

Ok. Just a second. Let me check and run a test to delete everything and install the app again to see if I can reproduce your error. I'll post here the result when finished.

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120411827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP26DXNDF5Z2L75JIHQDVI6Y6ZANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

I installed SMS Relentless from scratch and indeed I got the same error. It's due to the new restrictions on database columns that Nextcloud introduced in the last versions. If you had the app installed in the older versions of Nextcloud and then upgraded it from version to version, like me, you wouldn't have seen the error. I changed the upgrading script to remove that column size limitation and managed to install the app successfully. It created the 3 tables and everyhting was fine until I noticed it has a new problem with the SQL query that reads the data from the database. This is due to some weird things that they did in Nextcloud 24. I'll solve this new problem and then push a new version of SMS Relentless to the app store. I'll also post a message here when finished. I didn't expect Nextcloud 24 to be so disruptive.

linuxacademyir commented 2 years ago

ok i see thank you for your time i also have one question i installed asterisk and tested the webrtc on another web phone which works fine but trying to configure the SIP app on next cloud i did all as in Docs first the extension will not register and also when i open the SIP app the pop up doesnt show the phone but it shows the dashboard do u have an idea of the problem? screenshot is attached

On May 8, 2022, at 17:54, DoubleBastionAdmin @.***> wrote:

I installed SMS Relentless from scratch and indeed I got the same error. It's due to the new restrictions on database columns that Nextcloud introduced in the last versions. If you had the app installed in the older versions of Nextcloud and then upgraded it from version to version, like me, you wouldn't have seen the error. I changed the upgrading script to remove that column size limitation and managed to install the app successfully. It created the 3 tables and everyhting was fine until I noticed it has a new problem with the SQL query that reads the data from the database. This is due to some weird things that they did in Nextcloud 24. I'll solve this new problem and then push a new version of SMS Relentless to the app store. I'll also post a message here when finished. I didn't expect Nextcloud 24 to be so disruptive.

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120418593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP27JDFVQHSNHCWHQM3TVI657XANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

Yes, the fact that it doesn't register is because in Nextcloud 24 the SQL queries for inserting/getting the credentials into/from the database have been changed. The fact that the pop-up window doesn't show the phone but the Nextcloud dashboard is due to the phone's URL, which I modified in the new version of the phone, which is yet to be published. I'll make the required changes both in SMS Relentless and SIP Trip Phone, to make them compatible with all the changes introduced in Nextcloud 24 and upload the new versions to the Nextcloud app store as soon as I finish.

linuxacademyir commented 2 years ago

by the way installed another version of next cloud but 23 installed both apps SMS and SIP i can see api keys in db for SMS and asterisk settings for SIP app in DB also none works the SMS keeps loading as in screen shot and the the SIP loads dashboard

On May 8, 2022, at 20:17, mehdi zeus @.***> wrote:

oh i see ok thank you how soon will it be? shoud i downgrade to the 23 version or i should just wait?

On May 8, 2022, at 20:15, DoubleBastionAdmin @. @.>> wrote:

Yes, the fact that it doesn't register is because in Nextcloud 24 the SQL queries for inserting/getting the credentials into/from the database have been changed. The fact that the pop-up window doesn't show the phone but the Nextcloud dashboard is due to the phone's URL, which I modified in the new version of the phone, which is yet to be published. I'll make the required changes both in SMS Relentless and SIP Trip Phone, to make them compatible with all the changes introduced in Nextcloud 24 and upload the new versions to the Nextcloud app store as soon as I finish.

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120441460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP27BJKENCESXHRE74L3VI7ORDANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

In your Nextcloud 23 it doesn't work because you installed the 2 apps from scratch. In my Nextcloud 23 both SMS Relentless and SIP Trip Phone worked OK and they worked fine even in Nextcloud 24 when I upgraded Nextcloud. So, I had the credentials saved in the database from a previous version of Nextcloud. The idea is that the Nextcloud developers changed the way the credentials are saved and read from the database in one of the latest Nextcloud versions. I can't say exactly in which version they changed this mechanism, probably 22.

linuxacademyir commented 2 years ago

no i didnt install from scratch i just insatlled nextcloud and the installed both apps from app store is it how i supposed to install them ? from inside the next cloud app i have no idea why mine not working even datas are in the database as i looked am i missing any modules or some thing like that? i am running apache by the way

On May 8, 2022, at 21:30, DoubleBastionAdmin @.***> wrote:

In your Nextcloud 23 it doesn't work because you installed the 2 apps from scratch. In my Nextcloud 23 both SMS Relentless and SIP Trip Phone worked OK and they worked fine even in Nextcloud 24 when I upgraded Nextcloud. So, I had the credentials saved in the database from a previous version of Nextcloud. The idea is that the Nextcloud developers changed the way the credentials are saved and read from the database in one of the latest Nextcloud versions. I can't say exactly in which version they changed this mechanism, probably 22.

— Reply to this email directly, view it on GitHub https://github.com/DoubleBastionAdmin/sms-relentless/issues/2#issuecomment-1120452744, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3MP27MSMYGJPT2JSKERL3VI7XK7ANCNFSM5VKQA4VA. You are receiving this because you authored the thread.

DoubleBastionAdmin commented 2 years ago

Yes, the way to install them is from the Nextcloud app store. Anyway, you didn't have the credentials saved in the database from an older version of Nextcloud, when the saving/reading mechanism was still working and the credentials needed by the two apps were saved/read correctly. The encrypted data that you see in the database is not saved/read correctly, that is why the two apps can't connect. I already solved the '4000' size limit error. I'm modifying the SQL queries right now and I'll upload new versions of the 2 apps as soon as possible.

I would recommend Nginx as a web server. However, both apps work well with Apache, in both situations where you have Nextcloud served on a subdomain (like cloud.example.com) or on a subdirectly (like example.com/nextcloud). I explained the correct Apache configuration for Nextcloud here.

DoubleBastionAdmin commented 2 years ago

SMS Relentless version 1.0.5 and SIP Trip Phone version 1.0.5 have been published on the Nextcloud app store. They both contain important changes that remove the problems related to column size restrictions, SQL syntax and encryption function syntax, associated with the latest Nextcloud versions. Both applications have been tested with Nginx and Apache, with Nextcloud served both on a subdomain (like cloud.example.com) or on a subdirectory (like example.com/nextcloud).

If you are using Apache, it should be configured as described here: https://www.doublebastion.com/apache-configuration-for-nextcloud/.

As explained on that page, pretty URLs have to be enabled in Apache by including the following 2 lines in the config.php file of Nextcloud:

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

when Nextcloud is served on a subdomain, or

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

when Nextcloud is served on a subdirectory. Also, the .htaccess file has to be subsequently updated with the command:

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

if Nextcloud is served on a subdomain, or

sudo -u www-data php /var/www/nextcloud/occ maintenance:update:htaccess

if Nextcloud is served on a subdirectory.