Match ports in the phone config and PBX?

Discussion in '3CX Phone System - General' started by Techops, Mar 9, 2018.

Thread Status:
Not open for further replies.
  1. Techops

    Joined:
    Feb 5, 2018
    Messages:
    30
    Likes Received:
    0
    Heys,

    Read the manual section and watched the training vids but couldn't find this info.

    Extensions > Phone Provisioning > Local SIP Port of phone = some number

    Settings > Network > Ports > SIP Port used by PBX = a different number

    Wouldn't these port numbers need to match?
     
  2. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,730
    Likes Received:
    277
    Each end has a "listening port". the default at the PBX end is 5060. When the set/device that contacts the PBX is provisioned, you tell it to use that port.

    In the device, you also have a listening port, it can be 5060, or 5061, or 5070, etc. as long as it doesn't conflict with something else on the network IF you don't use an SBC or VPN. If the device is simply behind a router with other SIP devices, then the ports must be unique as they are seen by the PBX as (publicIP+port). When the device registers with the PBX it will let 3CX know what port it is listening on.
     
    YiannisH_3CX likes this.
  3. Techops

    Joined:
    Feb 5, 2018
    Messages:
    30
    Likes Received:
    0
    Interesting. So, would the PBX then be using Port Forwarding internally?

    The PBX receives all SIP on traffic on 5060 then forwards the packets to each different phone/port as needed?

    Fyi, thinking about STUN extensions in this use case.
     
  4. Saqqara

    Saqqara Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    1,094
    Likes Received:
    165
    If only one stun phone at the location , then you leave settings

    If more than one, than each phone requires different local sip port , local rdp audio ports start and end - configured under Phone Provisioning (no two phones can have the same settings), on the remote firewall you need to setup port forwarding for the correct ports to the relevant internal IP address of the phone

    Another option to overcome multiply phones at the same location is SBC - https://www.3cx.com/blog/releases/session-border-controller-sbc-update

    What phones are you think about installing ?
     
  5. Techops

    Joined:
    Feb 5, 2018
    Messages:
    30
    Likes Received:
    0
    Thanks for the info, I actually just saw this same thing last week. Multiple phones need to have unique SIP and RTP ports.

    An SBC does indeed looks like a good solution.

    We're installing some multiple Yealink sets.
     
  6. YiannisH_3CX

    YiannisH_3CX Support Team
    Staff Member 3CX Support

    Joined:
    May 10, 2016
    Messages:
    6,016
    Likes Received:
    420
    It is phones using STUN that benefit from this configuration. When multiples phones are in the same location then you need to have different sip ports for each phones so that the PBX can signal each phone individually. The port forwarding is done in the firewall that is in front of the phones so the firewall can forward messages to the correct phone depending on the port the message arrived from.

    The PBX has only one sip port and all phones can communicate with the PBX to that port. When a phone registers it sends the server a registration message and tells the server my public is 1.1.1.1 and my port is 5065. Then the server will reply with a 200 OK message saying to the phone OK i see you and you can reach me at IP 2.2.2.2 and port 5060. Now the PBX knows that phone A is located at that IP 1.1.1.1 address and uses port 5065.
    If a second phone is located at the same location the public IP will the same but the port has to be different. So the second phone will have to tell the PBX that it's IP is 1.1.1.1 but the port is 5066. The response of the server however will be the same as both phones can find the server to IP 2.2.2.2.

    Hope this makes sense
     
  7. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,730
    Likes Received:
    277
    Yes, but routing (or "forwarding"), in this case, will be based on information in the SIP message and rules you create in the PBX.
     
  8. Techops

    Joined:
    Feb 5, 2018
    Messages:
    30
    Likes Received:
    0
    Yup, that does make sense.

    So given what you said and what Saqqara said, we'll need to make sure the phones are set with a static IP less the port forwarding on the firewall breaks due to the phone changing it's IP.
     
  9. Techops

    Joined:
    Feb 5, 2018
    Messages:
    30
    Likes Received:
    0
    Rules you create in the PBX: are you meaning Inbound Rules?
     
  10. Saqqara

    Saqqara Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    1,094
    Likes Received:
    165
    Yes, you need to setup fixed IP's for the phones (normally can be done via your dhcp server, where you reserve the IP for the IP mac address), else port forwarding may fail due to the phone ip address changing

    Sometimes called Port forwarding or inbound rules
     
    YiannisH_3CX likes this.
  11. Saqqara

    Saqqara Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    1,094
    Likes Received:
    165
    How many Yealink phones are your setting up ?
     
  12. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,730
    Likes Received:
    277
    Since you were talking about calls coming into 3CX on port 5060, it is assumed that the port was already forwarded to the PBX by the router.

    This could be an incoming trunk call from a provider (in which case, inbound rules), or a call being placed by an extension. All (messaging) comes in on port 5060 (or another fixed port, if you have changed it). These are SIP messages, and what is in that message determines what the PBX does with the call. I hope I'm understanding correctly, your original question.
     
Thread Status:
Not open for further replies.