QUESTION SIP Settings - External IP

LesD

Member
Joined
Nov 8, 2009
Messages
408
Reaction score
15
I have two internet connections connected via a Draytek router.

In SIP settings I have specified one of the external IPs (I assume I cannot specify both).

What happens if PIAF turns out to be communication via the other IP? What, if anything, will/can go wrong?

I have the router set to use both lines in load sharing mode though it can be set to use just one and then fall over to the other one if the primary fails.

In practice I do not seem to have any significant issues - though I do very occasionally have one way audio but that is cured by redialling.
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
When Asterisk knows it's behind a NAT it will use the external IP address in SIP headers and SDP. The result of having a wrong IP address in there would likely be failed audio. But if both paths are up it would probably still work because you're telling the remote to contact you on an IP address that leads back to your system, regardless of how you have initiated the contact. Sort of an interesting scenario.

So my hypothesis is that you won't see any problems until one of the lines goes down, and then it will be 50/50 depending on whether the line you have specified in External IP is the one that's down.
 

LesD

Member
Joined
Nov 8, 2009
Messages
408
Reaction score
15
Is this only relevant for remote extensions? I presume trunk registrations look after themselves.

What do people do if they have a dynamic IPs?
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
That's a good question, and makes me not too confident in my previous answer to you. I know that some providers will ignore the Contact: header and any other IP information in the SIP packet and just use the IP address the packet came from as the contact. (Yate server does this if you enable NAT-fixing, which I did on the GV Gateway project because everyone's NAT scenarios were a pain.) Anyway, I don't know, but if you care to capture some SIP traffic I would enjoy looking over it to help come up with a correct answer.
 

LesD

Member
Joined
Nov 8, 2009
Messages
408
Reaction score
15
I'm setting up a site in a day or two with a remote phone for testing, so I will do some 'deliberate mistakes' and see the result.

Please remind me how to turn on the sip logging. Does the output go to the regular 'full' log?
 

LesD

Member
Joined
Nov 8, 2009
Messages
408
Reaction score
15
Just finished a couple of tests.

I have a remote phone connected and working.

I then changed the IP to be different from the actual site IP.

Result:

- Making an outside call from the remote phone - silence both ways.
- Calling into the switch from outside and answering via the remote phone - silence both ways.

As yet there are no local phones so I cannot check from/to using local phones.

On the SIP Settings page there is an Auto Configure button that sets the External IP field correctly so it cannot be beyond the wit of someone knowledgeable to write something to do this automatically every x minutes.

billsimon: Do you still want some sip logs?
 

LesD

Member
Joined
Nov 8, 2009
Messages
408
Reaction score
15
Just butchered the IP on my own system and then tried incoming and outgoing calls and it was OK (On one call I thought there was only one way audio but retrying was OK).

So I conclude that the setting of this IP is only critical when using external extensions.

I also conclude that systems using dynamic IPs cannot have external extensions but otherwise are OK.

I would feel happier if someone would confirm all of this.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
I also conclude that systems using dynamic IPs cannot have external extensions but otherwise are OK.
I've done remote extensions from my home box behind a dynamic IP. Just need a DDNS hostname and something to update Asterisk's externip (?) variable when it changes.
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
I agree with rossiv. I think your internal extensions are working because the providers are somehow handling the NAT without regard to the IP address you're sending to them in the SIP packets. Obviously, external VoIP extensions aren't going to have the logic to do that.

I would suggest reconfiguring your trunked Internet connections to a primary/failover as you mentioned in your first post, and then use dynamic DNS to update the hostname when the IP fails over from one to the other. If that DDNS name is used in the Asterisk SIP settings, you wouldn't need to update the externip.
 

islandtech

Wassamassaw
Joined
Jan 11, 2009
Messages
679
Reaction score
137
One of the local ISP providers told me that a static is not needed because your ip is bound to their cable modem's id. It will only change if you replace the cable modem. Another location has a different cable provider and his address hasn't changed in 4 years. On the other hand, I have a Frontier DSL that might change ip twice in the same day! Other than my own test extensions (remote off of certain customers pbx) I use VPN for remote phones.
 

LesD

Member
Joined
Nov 8, 2009
Messages
408
Reaction score
15
If that DDNS name is used in the Asterisk SIP settings, you wouldn't need to update the externip.
Now that you mentioned that and rossiv made sure I noticed it I can see that there is a DynamicIP option which replaces the IP with a domain name and a Refresh rate.


So Dyn DNS name seems the way to go though I still do not understand why one has to go to such lengths. The settings page has an auto configure button so it can't be so difficult to figure out the current external IP so why can't the system do it all by itself with maybe just a Refresh rate field to help it along.
 

jeff.h

Guru
Joined
Dec 1, 2010
Messages
502
Reaction score
71
I use dyndns to identify my PBX and put that host name in the remote extensions sip server settings. Then in the Asterisk SIP settings I make sure that NAT is on (need to make sure the extensions for remote devices are set for NAT as well) and put my dyndns host name in the External field under the IP Configuration setting which is set to Dynamic IP. You will also need a router that can support DDNS or a client running on a machine behind the router to perform the updates with whomever you use for a DDNS provider and make sure that you have TCP 5060-5082 and UDP 10000-20000 forwarded to your PBX.
 

LesD

Member
Joined
Nov 8, 2009
Messages
408
Reaction score
15
Thanks Jeff - that was a very comprehensive reply. I have only just now started trying out remote extensions and had forgotten about the IP in the remote phone :( So whichever way you turn there is no getting away from using some form of Dyn DNS service.

One question: You mention ports 5060-5082. I have only opened 5060. Why the others?

(I also open 69 to allow t*f*t*p to work as the Aastra 57i phones need to load their config files from there)
 

jeff.h

Guru
Joined
Dec 1, 2010
Messages
502
Reaction score
71
If you have more than one phone or device using SIP coming from the same remote IP it will want to use the next available port. For instance, I have one site with three remote phones and they register on ports 5060, 5061 and 5062.
 

jeff.h

Guru
Joined
Dec 1, 2010
Messages
502
Reaction score
71
Oh and you may want to forward 22 for SSH and 9001 for webmin. I also forward external port 9080 to internal port 80 for access to my PBX GUI remotely. For example. http:pbx.mydomain.net:9080 is what I use in my browser if I am remote and if you forward that to 80 internally you are not opening up 80 to the world but you still have GUI access.
 

Members online

Forum statistics

Threads
25,814
Messages
167,783
Members
19,245
Latest member
rahee
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.
Top