But you have 10 trunks – does that mean you have 5 providers? There should be no reason to have (for example) multiple pjsip trunks connecting to the same VoIP.ms server; several DIDs can route to the same subaccount. If you are using multiple VoIP.ms servers, then (from Asterisk’s point of view) they are essentially separate providers and should not cause trouble.
Yes, there’s in fact 10 trunks (5 SIP and 5 PJSIP). Of those, I realized 2 (one SIP and one PJSIP) I don’t use anymore. The other ones are needed since they provide different calling rates for different destinations. Also, I have them as a backup. If one provider is down, the outbound rules will try the next one available.
Out of the 8 trunks, only 2 (voip.ms) are the ones where there can be inbound calls. Is worth noting that even though I have different trunks with the same provider, they are using different sub_accounts (and hitting different SIP servers in different locations), so there shouldn’t be any conflicts.
How many of these ten trunks are registering to the same server? Expiry? Qualify frequency?
At most, 2 trunks (one PJSIP, one SIP) are registering to the same server using separate sub_accounts. The are set to re-register every 120 seconds (might not be ideal, but was part of my troubleshooting on trying them to stay registered. If you think I should change to a different value, let me know. The SIP trunk has “qualify=yes”, and the PJSIP has 60 as Qualify frequency.
Something worth noting is this issue is happening on ALL providers I use (2 more), not just voip.ms (so I don’t believe this has anything to do with Voip.ms hardening their environments due to the recent attacks).
I am leaning more towards your first assessment of the firewall somehow blocking the access (or NAT poisoning), but I want logs on the PBX to show that before I can look at changing settings on the firewall.
Here’s another log. Let me know if there’s anything else you spot here (and thanks for the prompt help!)
Something worth noting was that while I was capturing the logs, I opened the failing trunk settings, didn’t change anything and saved/applied the changes (it shouldn’t have been any), and the trunk registered successfully again… weird.
Log:
<— SIP read from UDP:208.100.60.29:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP [LOCAL_DEVICE_IP]:5160;branch=z9hG4bK7353e256;received=[LOCAL_DEVICE_IP];rport=5160
From: <sip: [email protected]>;tag=as1dfeeffb
To: <sip: [email protected]>;tag=as548e41e2
Call-ID: 134b240667aed3703d49da2f017c7c86@[::1]
CSeq: 5119 REGISTER
Server: voip.ms
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“dallasnew1.voip.ms”, nonce=“6f825b71”
Content-Length: 0
<------------->
— (11 headers 0 lines) —
Responding to challenge, registration to domain/host name dallas1.voip.ms
REGISTER 12 headers, 0 lines
Reliably Transmitting (NAT) to 208.100.60.29:5060:
REGISTER sip:dallas1.voip.ms SIP/2.0
Via: SIP/2.0/UDP [WAN-IP]:5160;branch=z9hG4bK3c4fc400;rport
Max-Forwards: 70
From: <sip: [email protected]>;tag=as1dfeeffb
To: <sip: [email protected]>
Call-ID: 134b240667aed3703d49da2f017c7c86@[::1]
CSeq: 5120 REGISTER
Supported: replaces, timer
User-Agent: FPBX-15.0.17.55(16.20.0)
Authorization: Digest username=“SUBACCOUNT_3”, realm=“dallasnew1.voip.ms”, algorithm=MD5, uri=“sip:dallas1.voip.ms”, nonce=“6f825b71”, response=“3fffee150bd689e476d01210bd54a5a9”
Expires: 120
Contact: <sip: s@[WAN-IP]:5160>
Content-Length: 0
<— SIP read from UDP:208.100.60.29:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP [LOCAL_DEVICE_IP]:5160;branch=z9hG4bK3c4fc400;received=[LOCAL_DEVICE_IP];rport=5160
From: <sip: [email protected]>;tag=as1dfeeffb
To: <sip: [email protected]>;tag=as548e41e2
Call-ID: 134b240667aed3703d49da2f017c7c86@[::1]
CSeq: 5120 REGISTER
Server: voip.ms
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 120
Contact: <sip: s@[LOCAL_DEVICE_IP]:5160>;expires=120
Date: Tue, 19 Oct 2021 17:42:07 GMT
Content-Length: 0