Port confusion

Status
Not open for further replies.

MrGlasspoole

Member
Nov 11, 2017
31
0
6
46
I don't really understand that port thing.

1. Why is external 5080 if most providers use 5060?
My provider says: TCP/UDP SIP Port 5060 (alternative 5064)
So why does it work while FreeSwitch is using 5080?

2. All phones have the random option.
Can it not happen that 2 phones trying to use the same port if the chose a random one?
Also the open ports on Fusion are 16384 - 32768 - can it not happen that the phone chooses one that is outside that range?
Why is there a random SIP Port option if the Freeswitch port (internal) is 5060?

3. I have multiple phones. They all have there own extension. So do i set a different SIP Port on every phone?

Also this port settings are always in the global settings of the phones.
So what if i have Zoiper or my Snom's registered to different accounts (one to Fusion and one to a provider)?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,038
556
113
@MrGlasspoole I think you are getting the basics a little confused.

Regarding the Freeswitch port 5060 and 5080 thing these are the LISTENING ports that the internal profile and external profile listen on respectively.

This dates back to when you would have primarily found Freeswitch on a LAN.

The external profile, ie the one that listens on 5080 deals with unauthenticated traffic ie traffic from the carrier whilst the internal profile ie 5060 authenticates all traffic.

The external profile only handles DIDs and therefore exposing it to the internet presented no opportunities for hackers and in a LAN environment, this port was the only one you needed to be internet facing.

Nowadays many of us have boxes out on the internet so both are exposed, it still in my opinion is a much cleaner way to do things having the two separate profiles. I didn't think this at first, it was only as I got a deeper understanding of Freeswitch that I realised the benefits.

To a carrier, it doesn't matter, you can still send traffic to their 5060 or 5064 or whatever they want it sent to. Its also not important when using registration on your gateways as the inbound traffic will come back in through the registered port anyway.

Where it will matter is if you want not to use registration for inbound traffic, in that case if the carrier is unable to send traffic directly to port 5080 you will need to add an entry to the ACL and have them send to 5060.

Now on to the 16384 - 32768. These are the media ports, asterisk uses 10000 -20000. These ports are used for the media, ie audio/video and are dynamically negotiated between the two endpoints during call setup. Thes e have nothing to do with ports on phones or anything like that, these are the ports that Freeswitch wants audio sent to and Freeswitch will tell the phone which port to use during the session negotiation. Similarly, Freeswitch does not care what ports the phones want their media on, it will just send to whatever the phone requests.

Your third question is a non starter when you understand these earlier things above.
 

MrGlasspoole

Member
Nov 11, 2017
31
0
6
46
I'm still not sure what ports to use on the phones.

This is what my provider writes:
Code:
Registrar_________________: sip.easybell.de
TLS SIP Port______________: 5061
TCP/UDP SIP Port__________: 5060 (alternative 5064)
Proxy_____________________: sip.easybell.de (use only in exceptional cases)
Outbound Proxy Mode_______: Automatic
STUN______________________: No (leave blank)
SIP Session Timer_________: default value 3600, minimum 600
SIP Max Forwards__________: default value 70
RTP Portrange_____________: 20.000 - 50.000
RTCP support exists_______: Yes
RTP Keepalive_____________: Yes
Long SIP Contact (RFC3840): supported/recommended
DTMF via SIP INFO_________: Off
DTMF______________________: Outband (RFC2833) or Inband
SRTP supported (RFC 3711)_: configure it as 'optional'

So in pfSense i have NAT/Firewall
TCP/UDP 5080 and TCP/UDP 5081 open/forwarded to the IP of my Fusion installation.

From reading a lot of stuff it always sounds you have to give every device other ports.
The manual from my DECT station says:
Use SIP and RTP Ports that are not used by other hosts in your LAN and that are faraway from the other normally used SIP and RTP Ports. This is helpful if other VoIP phones are connected to your router.
Also i remember ~4 years ago i did read somewhere that every phone needs its own ports and they should not overlap.

On that DECT station i can set:
Code:
Use random ports: Yes/No
SIP Port Range__: from - to
RTP Port Range__: from - to

On the Snom phones i can set:
Code:
Network identity (port): xxxx
Dynamic RTP port start_: xxxxx
Dynamic RTP port stop__: xxxxx

And Zoiper is most confusing because there is no range.
You can just set a fixed port for SIP, RTP or TLS or random.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,038
556
113
You should not need to touch the ports on the phones at all. Just leave everything at the defaults.
 

sokalsondha

Member
Nov 6, 2019
37
1
8
sir greetings from me. i am new user from ireland of the fusionpbx. i am trying to setup a cloudpbx system so i can use multitanent feature.
sir i want to use different different sip port for for my different different tanent. like tanent A i want to give port 5062 , tanent B port 5063 etc etc like this.
i know i can use the defautl 5060 port it just my plan is different. i go to Advanced---->SIP Profiles and found the SIP port. and there i found sip port $${internal_sip_port} and change the value to 5061 and i restart the freeswitch
but sir i can't connect to the extension.

can you please give me a little guideline sir how can i use different SIP port for each tanent?

also sir can you help me with the fusionpbx in skype? as i really want to learn this project. its very interesting. i wanted to make some API but i dont know how to work with the postgresql . i am familiar with mysql.

but please help on the port now sir..

Thanks
Mahim
 
Status
Not open for further replies.