I am looking for some help with a problem I have been debugging for several days now.
For a new project, we decided to try AWS Lightsail and install the latest Asterisk there. I am using Asterisk 20.4 as it was the latest at that time. It’s running on their Amazon Linux 2023 image which is RedHat based distribution.
The installation went almost smoothly and we got it up and running. Now we got to the implementation of the business logic in the Asterisk dial plan and we found a show stopper.
Every incoming calls gets disconnected after a certain amount of seconds. I am not saying exact seconds for all calls because it depends on the DID which received the call. We are using VoIP.ms as the VoIP provider.
Example (note: the call is always answered by the Asterisk and then the counter begins):
If a call is received by a Swedish DID, the call is being dropped after exactly 60 seconds.
If a call is received by a Belgium DID, the call is being dropped after exactly 10 seconds.
The same issue occurs for all DIDs, no matter the country, just the drop timeframe is different.
That lead me to the conlusion that it may be an issue on the VoIP.ms side so I had several technical conversations with them. We did traces from ours and their side and they said there is nothing wrong on their side. They said that the issue is most probably related to wrong inbound routes on the machine.
Lastly, we did a test with a new subaccount registered on a softphone and one of the DIDs attached to the same subaccount - the call is received, answered and NOT being dropped. In other words - working as expected. That concluded the issue must be in the Asterisk box.
I am pasting the latest configuration that I have tested with. I will describe below the things I have tried (if I can remember them all):
Since I am a new user and cannot upload files, I sending pastebin for the PJSIP log from the CLI logger here (the only hidden part is the caller phone number and the subaccount ID as in the settings):
The things I have tried:
– Initially I thought Lightsail is behind NAT but it looks like it is not. I tried playing with a lot of NAT settings + setting the local IP in the config.
– Changed our Asterisk port from the custom one we wanted back to 5060 (we read an article here that could be the issue)
– Lightsail firewall settings allow communication on both TCP and UDP 5060 although the asterisk is running only on TCP
– Tried Asterisk running on UDP connection instead of TCP
– We have 2 lightsail instances in 2 different continents - tried on both
Most probably I am missing something that I have tried but these are the main points.
ANY help would be much appreciated!
P.S. I am aware that EC2 is the preferred instances for AWS but if it is possible to run it on Lightsail, that would be perfect for us.
P.S.2. Outgoing calls are failing as well, I would assume the reason is the same. Again, the hangup cause is Normal Clearing as if I hung up the phone.