0perationPrivacy / VoIP

Web Base Telnyx/Twilio VoIP Interface enabling SMS, MMS and Voice calls using the providers API Keys and self-hosting the application.
https://VoIP.OperationPrivacy.com
GNU General Public License v3.0
247 stars 421 forks source link

Put leading slash #153

Closed 0perationPrivacy closed 1 year ago

0perationPrivacy commented 2 years ago

Discussed in https://github.com/0perationPrivacy/VoIP/discussions/152

Originally posted by **gh4E1NtQii** August 29, 2022 ### Issue After adding a number in VoIP Suite application and when prompted to Override Settings I clicked Yes. I noticed I was able to send text messages from VoIP Suite but could not receive them. Log into Telnyx and checked the Messaging profile that gets added to the phone number which I just associated with VoIP Suite. 1. Login To Telnyx 2. Click `Messaging` on the left hand side 3. Under `Configure your Messaging Profiles` section find `VoIP sms Web Application` - There will be multiple if you have multiple Telnyx phone numbers. 4. Click the `pencil icon` 5. Scroll down to the `Inbound Settings` section 6. Under the `Send a webhook to this URL:` section you will see the URL for receiving sms text messages via the Render API. This is incorrect. It is missing a forward slash in-between `.com` and `api` ### Resolution **Change From** Send a webhook to this URL: https://voipsuite-xxxx.onrender.comapi/setting/receive-sms/telnyx **Change To** Send a webhook to this URL: https://voipsuite-xxxx.onrender.com/api/setting/receive-sms/telnyx Once I made the above change, I was able to receive text messages to my Telnyx number on VoIP Suite Anyone else seeing this in their experience?
tomkel commented 2 years ago

This leading slash issue is also breaking MMS images from displaying.

In a message record, the media field looks like: "["https://voipsuite-xxxx.onrender.comuploads/...

tomkel commented 2 years ago

Figured it out, the code assumes that the BASE_URL environment variable has a trailing slash

0perationPrivacy commented 2 years ago

Figured it out, the code assumes that the BASE_URL environment variable has a trailing slash

yes, for now please put a slash at the end of the BASE_URL like in the example. Later we will fix it programatically if someone forgets it. (Growing pains, figuring out all the possibilities of user input errors)

tomkel commented 2 years ago

Using a path lib instead of string concatenation should do the trick