Does the SIP of Asterisk use TCP or UDP port 5060?

Hi there,

When a phone (e.g. a Cisco or Linksys phone) registers with Asterisk on port 5060, does it use TCP or UDP?

The reason I am asking is that I have trouble making a phone register with an Asterisk PBX(let’s call it machine A) when I moved it from an internal network to an network exposed externally. I had to do that because A has problems connecting with VoicePulse’s IAX servers( the UDP 4569 ports are blocked/filtered somewhere internally by a proxy ). After moving to another network, it registers fine with VoicePulse but now the phone won’t register any more > : (

So, I ssh-ed into the phone and found out that the phone cannot even reach that PBX’s IP at all.

Therefore, my plan is to have an intermediate machine(let’s call it B) that the phone can access and set up a tunnel between A and B.

Essentially, the configuration will be :

Phone <----> B <----Tunnel----> A

Now my question is whether the Tunnel should be transfering UDP or TCP SIP packets between the ports 5060.

When I ran nmap on B to test A, I see :

5060/tcp closed sip
5060/udp open|filtered sip

B can ssh to A fine, but A does not see B’s IP address.
So, I then ran nmap on another internal machine to test B, and I also get:

5060/tcp closed sip
5060/udp open|filtered sip

Nmap finished: 1 IP address (1 host up) scanned in 0.504 seconds

Please advise, thanks!

Should be UDP–as far as I know there is still only limited support for SIP/TCP.

There’s no advantage to using TCP for SIP, so it’s always UDP.

Thanks for the replies

Regarding the SSH tunnel between machines A and B , is it possible for it to work as a two-way tunnel when you can SSH from B to A, but not the other way round?