Asterisk Listen on Multiple Ports

I am testing to get asterisk listen on 2 ports using port forwarding as per below.

iptables -t nat -A PREROUTING -i em1 -p udp --dport 5062 -j REDIRECT --to-ports 5060

Asterisk is on Public IP and nat is off. Test scenarios

  1. Changed sip client to use 5062 and I could able to connect to the asterisk server and make calls but around 30 to 32seconds, it gets disconnected with below message**(happens only on particular mobile operator connection)**
    _WARNING[1810] chan_sip.c: Retransmission timeout reached on transmission 304768-c01a8c0-13c4-45026-4f02-29dd718-4f02 for seqno 2 (Critical Response)

  2. With the exact same set up but switched the client to different operator’s data connection or wifi connection, there is no issue at all on 5060 or 5062.

  3. That particular mobile operator blocks 5060 and I am assuming they might have blocked other ports that affecting the proper sip/rtp messages ?

Kindly advise what could possibly be the problem.

1 Like

The Contact header will contain the real port number.

In any case, it appears that you are in breach of your terms of service, so the the correct solution is to find a provider that does allow the use of SIP.

Thanks David for the reply. I have emailed the provider and also the respective governing body to ask why the voip was working before and not now after service provider upgraded their network.

Aside from that,trying to understand technically, even tho port forwarding has forwarded from 5062 to 5060. As far as asterisk concerns, its only see 5060 from the originating client, Is that correct?