TIPS LAN SIP behavior if WAN down. To pjsip or sip?

dghundt

Guru
Joined
Nov 15, 2007
Messages
647
Reaction score
86
Years ago we (well some of us) were vexed that if our internet went down, then all our LAN sip phones locked up as well. Since we still had one main pstn line, we should have been able to receive calls. There were all kinds of work around proposed, none worked for us. The only solution I found was to have only IAX trunks.

I just installed a fresh PBXIAF 13 Whole Enchilada server and I'm trying to decide how to do my trunks. In the past I had signed up for Vitelity, but it didn't work well with IAX, so I had to find other providers. I want to use the Vitelity DID plan now to cut some pstn lines.

I had read pjsip fixed the WAN sip bug that Digium had always denied.

Should I use pjsip?
 
Wasn't that WAN issue related to DNS not being able to get out or something? I vaguely remember this subject matter and I'm pretty sure Ward had a fix for it. Whether that is still an issue or not, I have no idea, but I'd test and see.
 
If I recall, the problem was that the SIP trunks were attempting to register with the FQDN of the provider. Since the DNS server could not resolve the FQDN, it caused chaos.

Instead of using your providers FQDN, try inserting it's IP address instead.
 
Yes it was a DNS FQDN issue that caused chaos. WAN goes down, then all LAN sip phones go down even though we had a single PSTN trunk.

I tried all the proposed work arounds at the time, none ever worked for me other than avoiding sip trunking. All IAX outbound trunks fixed the issue with sip phones on lan going down, but when I had an IAX DID with NO open ports on my router, someone hacked into the system and briefly made some calls. Thank goodness for the no auto replenishment plan.
That meant I had to cancel the IAX DID and went to COX cable for mildly cheaper phone lines. I need to get rid of the COX phone lines.

I have my Vitelity sip trunking registered, so I'll test it out and see once I have my routes configured. The same settings are there, just getting used to a new GUI.

I tried setting up pjsip but couldn't get it to register. Finally realized Vitelity doesn't like the @ character in passwords and was deleting them. Nuts.
 
I've yet to have luck with PJSIP for trunks. I tried to use PJSIP with Callcentric a few years ago and it didn't work and their support said it isn't supported on their platform. However, for internal phones like Yealink and Grandstream it works fine for me.

I have had luck with a dual WAN setup with one of the circuits being used as failover and the newer versions of Asterisk (13+). I've set my pfSense router to flush states on an outage and then PBXIAF handily re-registers on the backup circuit.

You can also set static DNS entries in your local DNS server or just hostnames in PBXIAF that will always resolve.
 
I remember (now) in the past when the WAN down DNS bug killed my sip extensions, I could manually disable (comment out registrations) all my sip trunks. Then sip extensions on LAN would work again. That meant a PSTN inbound would still ring on my sip extensions.
That's easy, if I'm in the office at the time.
Still need to unplug my WAN to confirm, but I should be fine with all sip extensions if I have only pjsip trunks. Snom phone was fussy using pjsip so far.

So I finally have my Vitelity Inbound DID and outbound trunks working for pjsip.
Incredible Pbx 13-13, latest release.
Here are the settings.


Pjsip outbound
trunkname: vitel-outbound
callerid <7775551212>
Allow any did
Max channels 4
Dial option T
System
Cont if busy, disable trunk No

Dialplan
Prepend 1777 to NXXXXXX
Prepend 1 to NXXNXXXXXX
1NXXNXXXXXX
911

Pjsipsettings
my vitelity sub account Login user name
my Vitelity password
Auth Outbound
Registration Send
Lang default
Sipserver outbound.vitelity.net
Sip port 5060 (yes it is 5060)
from-pstn
transport 0.0.0.0-udp

advanced
DTMF auto/rfc 4733
Forb retry interval 10
Gen retry interval 60
Expiration 3600
Max retries 10
Qualify frequency 60
Outbound proxy is blank
From domain outbound.vitelity.net
Other advanced text boxes are blank
Buttons all no, none

Codecs
Only ulaw checked


Pjsip for Inbound DID
Remember for Vitelity DIDs to set Routing to the subaccount with the username!
Remember on Pbx to set an Inbound route to an IVR or a destination

trunkname: vitel-inbound
hide callerid No
callerid <7775551212>
Allow any did
Max channels 4
Dial option T
System
Cont if busy, disable trunk No

Dialplan
Prepend 1777 to NXXXXXX
Prepend 1 to NXXNXXXXXX
1NXXNXXXXXX
911

Pjsipsettings
my vitelity subaccount userid login name (same as the DID Route to Account name)
my vitelity subaccount password
Auth Outbound
Registration Send
Lang default
Sipserver inbound25.vitelity.net
Sip port 5060 (yes it is 5060)
from-pstn
transport 0.0.0.0-udp

advanced
DTMF auto
Forb retry interval 10
Gen retry interval 60
Expiration 3600
Max retries 10
Qualify frequency 60

Outbound proxy inbound25.vitelity.net
From domain inbound25.vitelity.net
Other advanced text boxes are blank
Buttons all no, none

Codecs
Only ulaw checked
 
Last edited:
You can replace

outbound.vitelity.net with 64.2.142.189

inbound25.vitelity.net with 64.241.111.30

none of that would be necessary if dnsmasq is working properly though

The whole thing is your DNS server can or can not provide an ip address for a needed url. you need to fix that when the internet is not. so install a caching dns server to get over the missing internet,
 
Last edited:
60% of the time it works....every time!

On serious note,
Yes, I see these IPs in my pjsip asterisk info.
How often does a large provider like Vitelity change the numerical IP address?
 
In my experience with Vitelity (better than 7 years) then that would be "not yet"

If they would ever change YOUR inbound (inbound25) they would inform you well in advance, so far it's never happened to me or anyone I know.
 
Last edited:
Thanks for the tip.
My pjsip inbound trunk dropped registration and gave up sometime yesterday. I like that vitelity will email failed DID inbound call notifications, already got my first telemarketer - exciting!
I finally changed enough of the pjsip trunk configs back and forth that Asterisk was willing to retry.
Outbound trunk stayed registered and working.
I changed my permanent failure setting to disable and increased my registration tries.

I'll see how I do this week keeping my trunk up.
Otherwise, I think I'll use numerical IP address on a sip trunk as you suggested.
Unfortunately I gave up on pjsip extensions - even being mindful of ports, somehow eventually FailToBan blocked the phone, maybe just from registration retries? Took me a while to figure that out.
 
You can replace

outbound.vitelity.net with 64.2.142.189

inbound25.vitelity.net with 64.241.111.30

none of that would be necessary if dnsmasq is working properly though

The whole thing is your DNS server can or can not provide an ip address for a needed url. you need to fix that when the internet is not. so install a caching dns server to get over the missing internet,

Thanks
When I enter the ip address my inbound trunk gives fast busy. If I switch back to host=inbound25.vitelity.net in the outgoing settings and in my register string, my phone rings. nslookup does give the ip address you stated for inbound25.
Not sure why vitelity does not like the numerical ip address for inbound route.
Outbound is fine either way.
 
I would re-check the IP address you typed in for a typo mistake. The packets back and forth only work using IP addresses, not names. Names are converted to IP addresses via a DNS server just like "Directory Assistance" provides phone numbers for names.
 
I'll check again.
I'll have to make the IP change then check my log files too. Pretty sure I had the numbers correct, but you never know!
 

Members online

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top