Ports and incoming calls from DIDs

Hello,

I’m in the learning stages of working with Asterisk and I have a question about ports and incoming calls from DIDs.

I have a DID number that is forwarding calls its calls to an extension on an Asterisk server which is behind a router with a firewall. I have opened port 5060 on the router and have set up port forwarding to the port and IP of the machine running Asterisk. Incoming calls are getting answered and the caller can hear the voice of a receiver on an internal phone. The voice of the caller however is not heard by the receiver.

I’ve been reading that media (and sound I presume) is passed via RTP ports which are selected at random by Asterisk and that the default range is 10000-20000. I have not (and may not even be able to) set up port forwarding for a range of ports on the router, it seems that that function has been disabled by the carrier. I can only forward individual ports.

Here, I’m confused as to why the receiver’s voice can even be heard by the caller since the only open and forwarded port is 5060. How is this so?

The router’s firewall does allow me to open a range of ports and define an internal IP as well as the external one of the DID service.

Can anyone please offer suggestions?

I’ll paste the sip.conf entry for the DID below, which requires 2 trunks.

Thank you,

[carrymy-1]
host=xx.xx.xx.xx
dtmfmode=rfc2833
dtmf=rfc2833
type=peer
context=from_carrymy
;insecure=very
insecure=port,invite
nat=never
allow=all

[carrymy-2]
host=xx.xx.xx.xx
dtmfmode=rfc2833
dtmf=rfc2833
type=peer
context=from_carrymy
;insecure=very
insecure=port,invite
nat=never
allow=all

The ports are chosen by the respective ends. The port to which the media is sent towards the caller is decided by the ITSP’s SIP implementation, not by Asterisk.

From a firewall point of view, you either need all UDP ports open towards the ITSP, without appropriate address translation, or you need something that parses the SIP, and dynamically opens the ports nominated by the caller.

Thanks David for your reply. I found the solution. The GUI for port forwarding on the router recommends to leave the “internal port” field blank to duplicate the range given in the external field. Doing this however results in an error as does respecifying a range with 10000:20000. The solution was to give only the first value of the range. I now have sound in both directions. All the best

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.