SIP Source Port

Home » Asterisk Users » SIP Source Port
Asterisk Users 6 Comments

Hi All. We have a provider that requires us to SOURCE the SIP connection on TCP 5061. I honestly have no clue how to force Asterisk to always SOURCE the SIP connection on a certain port.

Can anybody point me in the right direction? I am using PJSIP.

Thank you, Alex

6 thoughts on - SIP Source Port

  • I don’t think I’ve seen that requirement before, so someone else may have to answer if there is a PJSIP specific setting

    However, if not then it may be simple to achieve the same result by using your firewall NAT rules.

    From: asterisk-users [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Alexander Perkins Sent: Saturday, July 10, 2021 1:39 PM
    To: asterisk-users@lists.digium.com Subject: [asterisk-users] SIP Source Port

    Hi All. We have a provider that requires us to SOURCE the SIP connection on TCP 5061. I honestly have no clue how to force Asterisk to always SOURCE the SIP connection on a certain port.

    Can anybody point me in the right direction? I am using PJSIP.

    Thank you,

    Alex

  • If you are referring to an outgoing connection, it’s not possible to configure PJSIP to do this. For an outgoing connection the system uses an ephemeral port as the source.

  • Kamailio is useful when you want to do weird, non-standard, or unusual stuff with SIP. You could send your outgoing connections to Kamailio, which could then send the connection out with the required source port.

    Have you considered using a not stupid provider?


    http://help.nyigc.net/

  • That would definitely be my preferred solution to this “problem”.

    Antony.


    René Descartes walks in to a bar. The barman asks him “Do you want a drink?”
    Descartes says “I think not,” and disappears.

    Please reply to the list;
    please *don’t* CC me.

  • El Sat, 10 Jul 2021 23:02:10 +0200
    Antony Stone escribió:

    I’ve seen this stupid thing before. It was a requirement of a solution from a Israeli vendor named Cassiopea. port 5060 was for customers and 5061 was for peers. But not only locally, it had to be the same for the remote port lol!

    Yes, sems or kamailio in the middle might be the way to go. In my base it was two sip-isdn gateways b2b lol!! It was 11 years ago.

    cheers


    PekePBX, the multitenant PBX solution https://pekepbx.com

  • This is a multipart message in MIME format.

    ——=_NextPart_000_0037_01D77779.942DD9E0
    Content-Type: text/plain;
    charset=”UTF-8″
    Content-Transfer-Encoding: quoted-printable

    Maybe it could be accomplished in the firewall? Tell the firewall to NAT the source port of packets to 5061?

    Från: asterisk-users-bounces@lists.digium.com För Alexander Perkins Skickat: den 10 juli 2021 19:39
    Till: asterisk-users@lists.digium.com
    Ämne: [asterisk-users] SIP Source Port

    Hi All. We have a provider that requires us to SOURCE the SIP connection on TCP 5061. I honestly have no clue how to force Asterisk to always SOURCE the SIP connection on a certain port.

    Can anybody point me in the right direction? I am using PJSIP.

    Thank you, Alex

    ——=_NextPart_000_0037_01D77779.942DD9E0
    Content-Type: text/html;
    charset=”UTF-8″
    Content-Transfer-Encoding: quoted-printable