This article focuses on the voice transmission on the PBX side regarding to an extension use public IP address and register from external network. That you might have one way audio problem or no audio in both way.
First to see the network scenario of remote extension.
NAT is Network Address Translation. This is router or firewall translate one IP to another, Usually is translate private address to public address.
PAT is Port Address Translation. This is all devices from inside network is presented as the same IP in the outside address, but use a different source port.
Why there is no voice?
SIP is an application layer protocol which means what list in the headers and SDP might not match the actual IP packet.
For example, when PBX sends an INVITE request to an extension which registers from external network.
- The address info sending from inside ---->
source IP address:192.168.9.150
c line in SDP:192.168.9.150
- The address info received on outside---->
source IP address:188.8.131.52:34232
c line in SDP:192.168.9.150
When SIP INVITE message sends out to external network the source IP address changed but the IP address in the headers and SDP remain the same.
- Contact header is used for SIP entity sending a request in-dialog like ACK or re-INVITE.
- The c (connection type and address) parameter in SDP is the IP address used for SIP entity sending RTP stream.
- The m (media definitions including media type e.g.'audio', transport details and formats) parameter in SDP contains the port for SIP entity sending RTP stream.
For this INVITE message is like PBX tells the other side that: Please send me the audio to 192.168.9.150:4060, and send me the next request to 192.168.9.150:5060.
So the problem comes, there is no route for the device from external remote extension to send the voice data to a private IP address.
How do we fix this?
Put the real public IP address in the sip headers and SDP.
As we can configure the NAT option on PBX web interface. Go to the menu: Settings> General> SIP> NAT
- If you have a public IP address pool and have a domain for that, External Host is the one you can choose.
- If you have a fixed public IP address you can select External IP Address.
- If you don't know the public IP address of your network you can try to use STUN.
- STUN stands for Simple Traversal Utilities for NAT, is a protocol for discovering the public IP address. STUN Server must be deployed in the outside network so it can see the public source IP address and port from the router.
- Simply saying is PBX send Binding Request to STUN Server from local RTP port, asking I want to know my public IP address and port for my RTP port. The STUN Server send Binding Response says OK, your public IP address and port is 184.108.40.206:34232.
Also you can try to enable NAT in extension Advanced setting
When endpoint device is behind a router or firewall PBX will send media stream back to where it receives the stream from other peers. In some environment when IP Phone sends sip message with private IP address PBX can still send RTP to the IP Phone.
It may help to solve the one-way audio problem.
SRTP should be enabled on both IP Phone and PBX, otherwise will cause call establishment issue.
Below is a configuration sample when using the External IP Address option.
Fill the fixed public IP address in the External IP Address.
Put your local network segment address in the Local Network Identification. So that when the destination is not within the local network segment PBX will use external IP address in the headers and SDP. That will provide a reachable address for the device located in external network.