No Audio For 10 Seconds And Then Comfort Noise
Hello,
We are running an Asterisk 13 server which is having a strange problem, where on calls which are received from the PSTN and then forwarded out to the PSTN again there is no audio for the first 10 seconds of the call. At the 10 second mark audio starts flowing fine, and in a PCAP we see that it starts with a few “comfort noise” packers before the real audio starts.
It can be reproduced with a very simple extension like this:
exten => 4081234567, 2, Dial(SIP/6501234567@bb.bb.bb.138)
where 4081234567 is the number we receive the call on, and 6501234567 is the number we’re forwarding it out to.
In the Asterisk log we don’t see any obvious reason for the audio to start flowing at the 10 second mark. All that is logged at that time is the following below.
Would anyone have any ideas? Historically Asterisk didn’t generate comfort noise – has that changed in version 13?
[May 17 20:26:24] VERBOSE[11933] res_rtp_asterisk.c: Sent Comfort Noise RTP
packet to aa.aa.aa.76:64280 (type 02, seq 009268, ts 000000, len 000001)
[May 17 20:26:24] VERBOSE[17794][C-00000027] res_rtp_asterisk.c: Got RTP
packet from aa.aa.aa.76:64280 (type 00, seq 000662, ts 105920, len 000160)
[May 17 20:26:24] DEBUG[17725][C-00000027] res_rtp_asterisk.c: Ooh, format changed from none to ulaw
[May 17 20:26:24] DEBUG[17725][C-00000027] res_rtp_asterisk.c: Starting RTCP transmission on RTP instance ‘0x14f4cc025998’
[May 17 20:26:24] VERBOSE[17725][C-00000027] res_rtp_asterisk.c: Sent RTP
packet to bb.bb.bb.20:35412 (type 00, seq 020934, ts 105920, len 000160)
[May 17 20:26:24] VERBOSE[17725][C-00000027] res_rtp_asterisk.c: Got RTP
packet from bb.bb.bb.20:35412 (type 00, seq 029996, ts 102760, len 000160)
Thanks very much,
6 thoughts on - No Audio For 10 Seconds And Then Comfort Noise
We found that the 10 seconds relates to the “rtpkeepalive ” in our sip.conf. If the rtpkeepalive is reduced then the delay reduces as well. If rtpkeepalive is removed from sip.conf then audio never starts flowing.
Does that help anyone make sense of what’s happening?
We have DAHDI running on the server:
# asterisk -rx ‘dahdi show version’
DAHDI Version: 3.0.0 Echo Canceller:
# asterisk -rx ‘dahdi show status’
Description Alarms IRQ bpviol CRC Fra Codi Options LBO
David,
Are you getting any RTP from the PSTN for either leg? If not it could be that they assume you are behind NAT and want to see where the SRC of the RTP before they send it back. We had a few carriers that did this. The easiest way to get around it was to play a 0.5 second audio clip to the incoming leg. This will send RTP to the inbound carrier, causing them to send RTP back to you which would then hit the terminating carrier, which then sends you back RTP completing the loop. The dialplan looks something like this.
same => n, Progress()
same => n, Playback(/var/lib//asterisk_custom/sounds/xc,noanswer)
same => n, Dial(SIP/+${EXTEN}@carrier,,)
I’ve also seen this happen due to networking equipment, specifically the equipment wanting Asterisk to send packets before allowing packets in. If both sides of the call are in this state, then you reach a stalemate and media won’t flow. Since rtp_keepalive is generated by Asterisk, it gets sent, and media starts flowing.
Hi Dovid and Joshua,
The PSTN is sending RTP immediately after the 200 OK, on both legs of the call. Since the PCAP taken on the Asterisk server itself shows this RTP
from the PSTN then presumably it can’t be a network issue preventing the RTP.
Having said that, the problem is not reproduced when the peer is another Asterisk server on the same network, and that does point to a network difference.
Is there any other way in which the RTP keepalive might affect Asterisk’s behaviour?
Thanks for your help on this.
No, the option only does anything if no RTP has been sent for a period of time. It doesn’t fundamentally alter the behavior of RTP in general.
Another thing to consider is that a PCAP is taken before any local firewall rules are applied, which can give a false impression that the firewall on the system is not an issue when in reality it can be. That’s something to check.
Hi Joshua,
You’re right, it was a firewall problem.