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
238 stars 421 forks source link

Can only send sms after moving to render #172

Closed barrendesert closed 1 year ago

barrendesert commented 1 year ago

I've since gone through the book and the instructions at inteltechniques to re-setup everything. I can make and send calls. I can send messages, but cannot receive.

To Reproduce

  1. Everything worked in Heroku.
  2. Followed voip suite instructions at inteltechniques to setup render.
    1. Set BASE_URL env var with trailing slash as reported in other bug
  3. Could send message but not receive.
  4. Walked through book to setup a new Messaging Profile (but same problem)
  5. New Messaging Profile setup named 'sms':
    1. Inbound Settings:
      1. Both webhook input fields set to this: https://xxxx-nnn.onrender.com/api/setting/receive-sms/telnyx (where xxxx-nnn is the name of my web service)
      2. API Version set to "Twexit API" per book instructions
    2. Number has to 'sms' set in "Messaging Profile" dropdown

Expected behavior Expect that I can receive sms text messages

Screenshots

thankyoumichaelbazzell commented 1 year ago

Having the exact same issue...did the steps twice made sure to not miss anything. Both webhook input fields are set correctly with the leading / at the end. Tried in telnyx both the v2 api which i used with heroku and the twexit api with no luck. Please help!

EDIT: I re-did the entire setup from scratch but back on heroku instead of render and it works fine. I guess Telnyx and MongoDB aren't the issue, must be something to do with Render.

0perationPrivacy commented 1 year ago

That's odd, the public instance (voip.operationprivacy.com) is running on Render. I've had no issues with that so far. Could be some manual setting in telnyx or twilio. In VoIP Suite, everytime you hit save on the profile settings page, it pushes those settings out to telnyx/twilio and saves it there. It overrides any other settings. So hitting save is usually the safest route so you don't have typos.

satirical-muzzle commented 1 year ago

I switched from Heroku to Render and I'm also having the same problem. I'm using Telnyx. I can send SMS fine, but not receive SMS. signal-2022-11-24-132249

0perationPrivacy commented 1 year ago

I switched from Heroku to Render and I'm also having the same problem. I'm using Telnyx. I can send SMS fine, but not receive SMS.

So I can confirm it works on my end, using RENDER (the public instance voip.operationprivacy.com), can send and receive to/from both telnyx and twilio. Also got corresponding email notifications on message received. I used an app like TextNow to test sending the sms's.

0perationPrivacy commented 1 year ago

@satirical-muzzle @thankyoumichaelbazzell @barrendesert All the settings looks right in the logs and it does say the webhook delivered.

  1. Either refresh the app (or the whole page) and you should see it.

  2. Or, go to Settings > Profile > Save > No, Keep Old That will only push the same settings back to telnyx in case you made any manual changes on your telnyx dashboard that may have messed things up.

  3. Also, try to create the same account on the the public instance to see if send/receive works. If it works it means some setting in your Render instance may not be right (like db or base_url). If it still doesn't work, it means the issue is with some setting in your telnyx account.

Let me know if that worked. Otherwise I'll troubleshoot it more.

satirical-muzzle commented 1 year ago

@0perationPrivacy I tried the three suggestions and problem persists. It is interesting the log does show the webhook delivered, but in the same Telnyx dashboard it shows the status as failed and gives a response code of 0. I also find it interesting that even though I am able to send SMS through the Suite the webhook logs for the sent messages as "failed" even though they successfully sent.

Through the process of switching services from Heroku to Render I did not make any changes in MongoDB or on Telnyx. I believe on Render I have the correct Environment Variables. BASE_URL has "https://"thenameofmyVS".onrender.com/", COOKIE_KEY has a string of 20 randomized alpha, numeric, and special characters (not including spacebar). And I'm sure DB info is correct as I'm able to log in to VoIP Suite (I assume I wouldn't be able to log in to VoIP Suite if I didn't set this up correctly). The logs in Render also show that database connects successfully.

I also noticed a mention of "high severity vulnerability" when building the web service on Render:

Nov 24 12:02:56 PM 19 packages are looking for funding Nov 24 12:02:56 PM run npm fund for details Nov 24 12:02:56 PM
Nov 24 12:02:56 PM found 1 high severity vulnerability Nov 24 12:02:56 PM run npm audit fix to fix them, or npm audit for details Nov 24 12:02:56 PM ==> Generating container image from build. This may take a few minutes... Nov 24 12:04:22 PM ==> Uploading build... Nov 24 12:04:52 PM ==> Build uploaded in 24s Nov 24 12:04:52 PM ==> Build successful 🎉 Nov 24 12:04:52 PM ==> Deploying... Nov 24 12:05:12 PM ==> Starting service with 'node app.js'

kw1510022 commented 1 year ago

Same issue here - cant receive calls or sms

0perationPrivacy commented 1 year ago

This worked for one user:

Try this in VoIP Suite: Go to Settings > Profile Settings and hit Save Then click Yes, override it

This will override your voice settings as well. If you had configured Linphone for voice, it will replace it (not delete the Linphone settings). This action also seems to set the right webhook to receive sms's.

I'm working on a permanent fix of this in an update once I'm confident this is what's causing the issue. I believe I've narrowed it down to this.

kw1510022 commented 1 year ago

When I do that I get

Error something went wrong

I have done that a few times and I can see the changes in Telnyx but still cant receive anything

satirical-muzzle commented 1 year ago

I started to receive SMS today! I didn't make any changes. I took a few days off from trying after my last failed attempts. I logged in to VoIP Suite today and I see that I have messages. Telnyx also shows webhook status as "Delivered" on both send and receive whereas before it showed as "Failed" even though I was able to send. Hopefully it stays working and is not an intermittent issue. Still have no clue why it's working now, but I'm happy that it is.

0perationPrivacy commented 1 year ago

I started to receive SMS today! I didn't make any changes. I took a few days off from trying after my last failed attempts. I logged in to VoIP Suite today and I see that I have messages. Telnyx also shows webhook status as "Delivered" on both send and receive whereas before it showed as "Failed" even though I was able to send. Hopefully it stays working and is not an intermittent issue. Still have no clue why it's working now, but I'm happy that it is.

wow, that's great! I'm still wondering what the issue was. Since the codebase never changed and it was working for most others, I'm guessing either the telecom side webhooks got confused or cached for a while or maybe Render took a while to get the webhooks. Will continue to troubleshoot passively as I further develop the code. Any and all help is appreciated! Thanks for the update 👍🏻

satirical-muzzle commented 1 year ago

Now I've been experiencing downtime with Render. I've tried redeploying and also just deleting / reinstalling the web service to fix. Doing so willl allow me to use the app for about 5 minutes before it goes down again. UptimeRobot shows connection timeout.

0perationPrivacy commented 1 year ago

@satirical-muzzle I've had pretty good uptime with Render, for me I see a few minutes of downtime a month from the many free micro-services I'm running on it. What sucks is the 2-5 mins of build time. Heroku took 10-15 seconds.

Not sure why It's failing for you, check the logs section in Render to see if there's anything there.

kw1510022 commented 1 year ago

Tonight nothing is working. I cant even get the page to come up. It's too unreliable to use.

0perationPrivacy commented 1 year ago

Tonight nothing is working. I cant even get the page to come up. It's too unreliable to use.

Options are always good in such scenarios. Heroku is still an option ($5 instead of their free services), VPS is another option some have adopted. I'm always looking for other "free" options as well that can run lightweight backend servers like this and have a relatively private signup process.

kw1510022 commented 1 year ago

It was great for the last year but all good things come to an end. It was fantastic before the change. Thanks for all your hardwork

0perationPrivacy commented 1 year ago

It was great for the last year but all good things come to an end. It was fantastic before the change. Thanks for all your hardwork

better things to come in 2023, a native mobile app for this that actually works in GraphenOS. More server updates to clean up the code.

satirical-muzzle commented 1 year ago

Logs aren't showing anything at all when the downtime occurs. It just stops logging with no errors given. The dashboard shows a green light with "Deploy succeeded" as the status.

OfficialGitCub commented 1 year ago

Hi - I'm having a similar issues. There does not seem to be a new messaging configuration in Twilio after setting up a Render profle. I can send texts but I do not receive them.

OfficialGitCub commented 1 year ago

That's odd, the public instance (voip.operationprivacy.com) is running on Render. I've had no issues with that so far. Could be some manual setting in telnyx or twilio. In VoIP Suite, everytime you hit save on the profile settings page, it pushes those settings out to telnyx/twilio and saves it there. It overrides any other settings. So hitting save is usually the safest route so you don't have typos.

Messaging configuration is blank in Twilio after setting up profiles in Render

ComponentClass commented 1 year ago

Currently running this on a selfhosting configuration and I am running into the same issue.

I have mongo set up as a docker container, and I am running the nodeJS app.

I have configured the BASE_URL to a public domain that I own that has the 3000 port forwarded to the service (let me know if this the wrong port)

I am currently able to send out twilio messages, but unable to receive them.

Twilio has a webhook to the url that I am point at 3000

huzaifa3115 commented 1 year ago

@ComponentClass although this issue is not related specifically to Voip Web, this issue must be happening from the hosting provider, can you please let me know your hosting provider?

ComponentClass commented 1 year ago

@huzaifa3115

I am currently self-hosting the services - the domain provider is under cloudflare

huzaifa3115 commented 1 year ago

Please note if you are hosting it on any of your local systems or pc , webhook receiver will not work

0perationPrivacy commented 1 year ago

Currently running this on a selfhosting configuration and I am running into the same issue.

I have mongo set up as a docker container, and I am running the nodeJS app.

I have configured the BASE_URL to a public domain that I own that has the 3000 port forwarded to the service (let me know if this the wrong port)

I am currently able to send out twilio messages, but unable to receive them.

Twilio has a webhook to the url that I am point at 3000

Port forwarding alone will not work as the webhook in Twilio/Telnyx doesn't have a port associated with it. You will need to do static NAT for the whole domain and forward the request to the locally hosted IP address while retaining the URI. This is the part that PaaS providers do transparently in the background. So your NAT translated url when it hits your local server will look something like this: https://192.168.1.10:3000/api/receive-sms....

Also by self-hosting, some people mean hosting in the cloud like on a VPS or Azure/AWS/Rackspace, etc. Firewall rules will be different there. If it's at home, then you must have a static IP address and your router supporting Static NAT (as opposed to Dynamic NAT or PAT) to receive webhooks consistantly. Most ISPs will provide a static IP for a few $ extra. ISPs will also block some inbound and outbound ports (namely port 25).

Since there are so many variables with self-hosting at home or on a VPS, we don't support that deployment. But it works, we use it in testing. Every environment is unique. PaaS services make the adoption so much easier. 😇

ComponentClass commented 1 year ago

Awesome, thank you both for the responses @huzaifa3115 @0perationPrivacy ! Appreciate it :D

OfficialGitCub commented 1 year ago

Just an update - still unable to receive sms. Peered into Twilio logs and found the error 11210 "http bad host name"

OfficialGitCub commented 1 year ago

sourceComponent | "14100" httpResponse | "502" url | REDACTED ErrorCode | "11210" LogLevel | "ERROR" Msg | "HTTP bad host name" EmailNotification | "false"

0perationPrivacy commented 1 year ago

11210

Interesting, would love to see your URL in that particular debug output, just mask the host part to example or something. I'm guessing it may be a typo or a slash issue that's causing the URL to be unreachable by Twilio. https://www.twilio.com/docs/api/errors/11200

OfficialGitCub commented 1 year ago

sourceComponent | "14100" httpResponse | "502" url | "https://0peration-privacy-example.onrender.comapi/setting/receive-sms/twilio" ErrorCode | "11210" LogLevel | "ERROR" Msg | "HTTP bad host name" EmailNotification | "false"

-- Confirming messaging webhook:

MessagingWebhook to POST: https://0peration-privacy-example.onrender.comapi/setting/receive-sms/twilio

0perationPrivacy commented 1 year ago

@OfficialGitCub I see the mistake, your base_URL env variable should have a leading slash. The above example should look like this: https://0peration-privacy-example.onrender.com/api/setting/receive-sms/twilio There should be a slash between comap

OfficialGitCub commented 1 year ago

@0perationPrivacy Confirming this is fixed!! Thank you...

0perationPrivacy commented 1 year ago

closing as issue seems to be fixed with the update.