multiple gateways and NAT
I am sure this question comes up all the time... I want to use several different SIP gateway providers (for different regions and services). Freeswitch seems to deal with NAT just great with one external gateway, but multiple gateways seems to be a rather thornier issue. So, do I need totally separate profiles for each gateway? And do they have to use different ports? And does that mean that I need to get my firewall to port map each of them separately (I would assume they all try to use the same 5060 port to reach my system in case of an incoming call)? Julf
So, do I need totally separate profiles for each gateway? yes the same 5060 port to reach my system in case of an incoming call)?
yes ----- Original Message ----- From: "Johan Helsingius" <julf@julf.com> To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Sent: Sunday, March 13, 2011 2:18 PM Subject: [Freeswitch-users] multiple gateways and NAT
I am sure this question comes up all the time...
I want to use several different SIP gateway providers (for different regions and services). Freeswitch seems to deal with NAT just great with one external gateway, but multiple gateways seems to be a rather thornier issue.
So, do I need totally separate profiles for each gateway? And do they have to use different ports? And does that mean that I need to get my firewall to port map each of them separately (I would assume they all try to use the same 5060 port to reach my system in case of an incoming call)?
Julf
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I have the same problem (3 ITSPs) but use different ports for each, 5068, 5069, 5080. I had trouble using the same port for them but can't remember what the problem was. Mu big issue is I have 2 DSL lines,1 static and 1 dynamic, and no uPNP. I've never gotten FreeSwitch to handle two external DSLs so I have a new router to try out SIP ALG which I know some people hate but seems to be very good at handling the NAT and dual WANs, Freeswitch now uses both in case one goes down. On Mar 13, 2011, at 11:26 AM, Madovsky wrote:
So, do I need totally separate profiles for each gateway? yes the same 5060 port to reach my system in case of an incoming call)?
yes
----- Original Message ----- From: "Johan Helsingius" <julf@julf.com> To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Sent: Sunday, March 13, 2011 2:18 PM Subject: [Freeswitch-users] multiple gateways and NAT
I am sure this question comes up all the time...
I want to use several different SIP gateway providers (for different regions and services). Freeswitch seems to deal with NAT just great with one external gateway, but multiple gateways seems to be a rather thornier issue.
So, do I need totally separate profiles for each gateway? And do they have to use different ports? And does that mean that I need to get my firewall to port map each of them separately (I would assume they all try to use the same 5060 port to reach my system in case of an incoming call)?
Julf
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I only have one external network, but I have several gateways all using port 5060 with no problems. My fs is on the public network and this makes it easier.. Mario G <mario_fs@mgtech.com> wrote:
I have the same problem (3 ITSPs) but use different ports for each, 5068, 5069, 5080. I had trouble using the same port for them but can't remember what the problem was. Mu big issue is I have 2 DSL lines,1 static and 1 dynamic, and no uPNP. I've never gotten FreeSwitch to handle two external DSLs so I have a new router to try out SIP ALG which I know some people hate but seems to be very good at handling the NAT and dual WANs, Freeswitch now uses both in case one goes down.
On Mar 13, 2011, at 11:26 AM, Madovsky wrote:
So, do I need totally separate profiles for each gateway? yes the same 5060 port to reach my system in case of an incoming call)?
yes
----- Original Message ----- From: "Johan Helsingius" <julf@julf.com> To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Sent: Sunday, March 13, 2011 2:18 PM Subject: [Freeswitch-users] multiple gateways and NAT
I am sure this question comes up all the time...
I want to use several different SIP gateway providers (for different regions and services). Freeswitch seems to deal with NAT just great with one external gateway, but multiple gateways seems to be a rather thornier issue.
So, do I need totally separate profiles for each gateway? And do they have to use different ports? And does that mean that I need to get my firewall to port map each of them separately (I would assume they all try to use the same 5060 port to reach my system in case of an incoming call)?
Julf
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com
You can use a single IP on multiple profiles by using different ports. -Steve On 13 March 2011 19:27, Johan Helsingius <julf@julf.com> wrote:
My fs is on the public network and this makes it easier..
Indeed, that does make it much, much easier. But unfortunately, with IPv4 space running out pretty quickly, that's a luxury most of us can't afford... :(
Julf
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
So, do I need totally separate profiles for each gateway? yes
OK. And they have to be on different ports?
the same 5060 port to reach my system in case of an incoming call)?
yes
So I have to selectively translate the incoming port 5060 (in the firewall) to a different port for each gateway on the FS host? Julf
----- Original Message ----- From: "Johan Helsingius" <julf@julf.com> To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Sent: Sunday, March 13, 2011 3:19 PM Subject: Re: [Freeswitch-users] multiple gateways and NAT
So, do I need totally separate profiles for each gateway? yes
OK. And they have to be on different ports? not necessary
the same 5060 port to reach my system in case of an incoming call)?
yes
So I have to selectively translate the incoming port 5060 (in the firewall) to a different port for each gateway on the FS host?
no
So, do I need totally separate profiles for each gateway? yes
OK. And they have to be on different ports? not necessary
OK, but... Why are the separate profiles needed then? If they can use the same port, why can't they use the same profile? I am also more than a bit confused about the port 5060 vs. 5080 thing. So the external profile listens on 5080, but won't the gateway try to use 5060 when it has an incoming call for me? Or will the registration take care of that? Julf
FS default for registered users is port 5060 and external gateway 5080. but you can invert these port to follow a kind of standard SIP port for external gateway which is 5060. I use on file per each external gateway, more easy to manage... ----- Original Message ----- From: "Johan Helsingius" <julf@julf.com> To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Sent: Sunday, March 13, 2011 3:48 PM Subject: Re: [Freeswitch-users] multiple gateways and NAT
So, do I need totally separate profiles for each gateway? yes
OK. And they have to be on different ports? not necessary
OK, but... Why are the separate profiles needed then? If they can use the same port, why can't they use the same profile?
I am also more than a bit confused about the port 5060 vs. 5080 thing. So the external profile listens on 5080, but won't the gateway try to use 5060 when it has an incoming call for me? Or will the registration take care of that?
Julf
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I remembered why I needed to use different ports in one case: Two of the three accounts are at the same ITSP, in this case since the IP address is the same on the two accounts you need to use different ports. On Mar 13, 2011, at 1:01 PM, Madovsky wrote:
FS default for registered users is port 5060 and external gateway 5080. but you can invert these port to follow a kind of standard SIP port for external gateway which is 5060. I use on file per each external gateway, more easy to manage...
----- Original Message ----- From: "Johan Helsingius" <julf@julf.com> To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Sent: Sunday, March 13, 2011 3:48 PM Subject: Re: [Freeswitch-users] multiple gateways and NAT
So, do I need totally separate profiles for each gateway? yes
OK. And they have to be on different ports? not necessary
OK, but... Why are the separate profiles needed then? If they can use the same port, why can't they use the same profile?
I am also more than a bit confused about the port 5060 vs. 5080 thing. So the external profile listens on 5080, but won't the gateway try to use 5060 when it has an incoming call for me? Or will the registration take care of that?
Julf
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I remembered why I needed to use different ports in one case: Two of the three accounts are at the same ITSP, in this case since the IP address is the same on the two accounts you need to use different ports.
Ah, I have sort of the same case - 4 accounts with one ITSP providing 4 different incoming DID's (replacing an old ISDN connection), and 2 separate single ITSP accounts for international calls. But I am still very confused about the need for different ports. This is not a complaint, just an observation, but I do think the multiple port thing is one of the more confusing aspects of FS, and something other SIP switches seem to do without. On outgoing connections, we register with the ITSP gateway (by the way, does the SIP registration register both an ip address and a port number, or just the ip address?), and on incoming connections they either have a destination number/DID that routes them to the right place in the dialplan, or they register with us (using username/password) in the case of SIP clients. Security can be handled with ACL's. So I can't get my head around to why separate ports are needed - maybe someone can point out what I am missing? Julf
I'll tell you what I know/observed: Based on web searches you need address and port. Here is an example of what happened to me during testing: I have multiple user IDs on my internal phone, so each phone registers multiple times, one for each extension. When I configured the phone (SPA962) to use the same port (5060) for all extensions the phones had problems such as not ringing when they should. When I gave each extension its own port and problems solved. As for ITSPs, I remember that I could not get the ITSP that had 2 accounts working right until each account had its own port. My guess is that the connection between the ITSP is registered with the user ID, but then that ID is no longer used, just the IP and port. Since FS had the same ip addr and port for both accounts there is no way to know what data belonged to what account. Making separate ports fixed the problem. I also am very confused about FS ports. In vars.xml there is only one port that can be setup for internal and external. However, I have separate external profiles each with its own port that is required to make things work. But.... I only have 1 internal profile and yet all extensions work even though they are setup with different ports for each extension. You would think FS would require different internal profiles for each ID as it does for external. Go figure.... Hope this helps a little. As for using port in registrations I am not sure. The reason is while testing dual WAN I had a call going on one WAN then pulled the plug. The other took over and FS kept the conversation going. So in that case even the IP address changed! But... I am having other major FS problems trying to get a working backup so had to abandon the FS dual wan setup and stick to 1 wan connection for FS. Mario G On Mar 14, 2011, at 2:03 AM, Johan Helsingius wrote:
I remembered why I needed to use different ports in one case: Two of the three accounts are at the same ITSP, in this case since the IP address is the same on the two accounts you need to use different ports.
Ah, I have sort of the same case - 4 accounts with one ITSP providing 4 different incoming DID's (replacing an old ISDN connection), and 2 separate single ITSP accounts for international calls.
But I am still very confused about the need for different ports. This is not a complaint, just an observation, but I do think the multiple port thing is one of the more confusing aspects of FS, and something other SIP switches seem to do without.
On outgoing connections, we register with the ITSP gateway (by the way, does the SIP registration register both an ip address and a port number, or just the ip address?), and on incoming connections they either have a destination number/DID that routes them to the right place in the dialplan, or they register with us (using username/password) in the case of SIP clients. Security can be handled with ACL's. So I can't get my head around to why separate ports are needed - maybe someone can point out what I am missing?
Julf
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Mon, Mar 14, 2011 at 10:07 AM, Mario G <mario_fs@mgtech.com> wrote:
I'll tell you what I know/observed: Based on web searches you need address and port. Here is an example of what happened to me during testing:
I have multiple user IDs on my internal phone, so each phone registers multiple times, one for each extension. When I configured the phone (SPA962) to use the same port (5060) for all extensions the phones had problems such as not ringing when they should. When I gave each extension its own port and problems solved.
As for ITSPs, I remember that I could not get the ITSP that had 2 accounts working right until each account had its own port. My guess is that the connection between the ITSP is registered with the user ID, but then that ID is no longer used, just the IP and port. Since FS had the same ip addr and port for both accounts there is no way to know what data belonged to what account. Making separate ports fixed the problem.
I also am very confused about FS ports. In vars.xml there is only one port that can be setup for internal and external. However, I have separate external profiles each with its own port that is required to make things work. But.... I only have 1 internal profile and yet all extensions work even though they are setup with different ports for each extension. You would think FS would require different internal profiles for each ID as it does for external. Go figure.... Hope this helps a little.
Keep in mind that the ports specified in vars.xml are for the SIP profiles. Each SIP profile is a user agent. A user agent can service exactly one IP:Port. So if your internal profile is set with IP of 10.10.1.1 and port 5060, then that's where internal is listening and responding. So, the internal profile is listening for traffic coming into 10.10.1.1:5060 and responds from the same IP:port. The phones in the above scenario have their own user agents who are doing the same thing with their own IPs and ports. So you could have line key 1 listening/responding on 10.10.1.2:5060 and line key 2 listening/responding on 10.10.1.2:5062. They both send their SIP traffic *to* 10.10.1.1:5060 (FS, internal profile) and FS knows which IP:port to use for responding to traffic "from" each line key. That's an imperfect explanation, but I hope it illustrates the point. -MC
As for using port in registrations I am not sure. The reason is while testing dual WAN I had a call going on one WAN then pulled the plug. The other took over and FS kept the conversation going. So in that case even the IP address changed! But... I am having other major FS problems trying to get a working backup so had to abandon the FS dual wan setup and stick to 1 wan connection for FS.
Mario G
On Mar 14, 2011, at 2:03 AM, Johan Helsingius wrote:
I remembered why I needed to use different ports in one case: Two of the three accounts are at the same ITSP, in this case since the IP address is the same on the two accounts you need to use different ports.
Ah, I have sort of the same case - 4 accounts with one ITSP providing 4 different incoming DID's (replacing an old ISDN connection), and 2 separate single ITSP accounts for international calls.
But I am still very confused about the need for different ports. This is not a complaint, just an observation, but I do think the multiple port thing is one of the more confusing aspects of FS, and something other SIP switches seem to do without.
On outgoing connections, we register with the ITSP gateway (by the way, does the SIP registration register both an ip address and a port number, or just the ip address?), and on incoming connections they either have a destination number/DID that routes them to the right place in the dialplan, or they register with us (using username/password) in the case of SIP clients. Security can be handled with ACL's. So I can't get my head around to why separate ports are needed - maybe someone can point out what I am missing?
Julf
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thanks! That clears it up for me. Mario G On Mar 14, 2011, at 1:32 PM, Michael Collins wrote:
On Mon, Mar 14, 2011 at 10:07 AM, Mario G <mario_fs@mgtech.com> wrote: I'll tell you what I know/observed: Based on web searches you need address and port. Here is an example of what happened to me during testing:
I have multiple user IDs on my internal phone, so each phone registers multiple times, one for each extension. When I configured the phone (SPA962) to use the same port (5060) for all extensions the phones had problems such as not ringing when they should. When I gave each extension its own port and problems solved.
As for ITSPs, I remember that I could not get the ITSP that had 2 accounts working right until each account had its own port. My guess is that the connection between the ITSP is registered with the user ID, but then that ID is no longer used, just the IP and port. Since FS had the same ip addr and port for both accounts there is no way to know what data belonged to what account. Making separate ports fixed the problem.
I also am very confused about FS ports. In vars.xml there is only one port that can be setup for internal and external. However, I have separate external profiles each with its own port that is required to make things work. But.... I only have 1 internal profile and yet all extensions work even though they are setup with different ports for each extension. You would think FS would require different internal profiles for each ID as it does for external. Go figure.... Hope this helps a little.
Keep in mind that the ports specified in vars.xml are for the SIP profiles. Each SIP profile is a user agent. A user agent can service exactly one IP:Port. So if your internal profile is set with IP of 10.10.1.1 and port 5060, then that's where internal is listening and responding. So, the internal profile is listening for traffic coming into 10.10.1.1:5060 and responds from the same IP:port. The phones in the above scenario have their own user agents who are doing the same thing with their own IPs and ports. So you could have line key 1 listening/responding on 10.10.1.2:5060 and line key 2 listening/responding on 10.10.1.2:5062. They both send their SIP traffic *to* 10.10.1.1:5060 (FS, internal profile) and FS knows which IP:port to use for responding to traffic "from" each line key. That's an imperfect explanation, but I hope it illustrates the point.
-MC
As for using port in registrations I am not sure. The reason is while testing dual WAN I had a call going on one WAN then pulled the plug. The other took over and FS kept the conversation going. So in that case even the IP address changed! But... I am having other major FS problems trying to get a working backup so had to abandon the FS dual wan setup and stick to 1 wan connection for FS.
Mario G
On Mar 14, 2011, at 2:03 AM, Johan Helsingius wrote:
I remembered why I needed to use different ports in one case: Two of the three accounts are at the same ITSP, in this case since the IP address is the same on the two accounts you need to use different ports.
Ah, I have sort of the same case - 4 accounts with one ITSP providing 4 different incoming DID's (replacing an old ISDN connection), and 2 separate single ITSP accounts for international calls.
But I am still very confused about the need for different ports. This is not a complaint, just an observation, but I do think the multiple port thing is one of the more confusing aspects of FS, and something other SIP switches seem to do without.
On outgoing connections, we register with the ITSP gateway (by the way, does the SIP registration register both an ip address and a port number, or just the ip address?), and on incoming connections they either have a destination number/DID that routes them to the right place in the dialplan, or they register with us (using username/password) in the case of SIP clients. Security can be handled with ACL's. So I can't get my head around to why separate ports are needed - maybe someone can point out what I am missing?
Julf
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (6)
-
covici@ccs.covici.com
-
Johan Helsingius
-
Madovsky
-
Mario G
-
Michael Collins
-
Steven Ayre