Playtones() not working

I’m quite new to Asterisk and I’ve been experimenting a fair bit and everything I’ve tried has worked so far (calls, voicemail, etc). But now I’m having a problem getting the system to play tones.

I’ve used this in extensions.conf:


exten => 500,1,Answer
exten => 500,n,PlayTones(congestion)[/b]

I get this on the Asterisk CLI:

== Using SIP RTP CoS mark 5
– Executing [500@phones:1] Answer(“SIP/vmtest-00000008”, “”) in new stack
– Executing [500@phones:2] PlayTones(“SIP/vmtest-00000008”, “congestion”) in new stack
– Auto fallthrough, channel ‘SIP/vmtest-00000008’ status is ‘UNKNOWN’

but I don’t hear any sounds. I’ve tried different tones i.e. (35/440). I am running Ubuntu Server 14.04.2 LTS and Asterisk 13.1.1

Any ideas please? Thanks

What works? (So we can consider how PlayTones differs from that, and eliminate common problems like NAT or firewall issues.)

Are you using any codecs in passthrough mode (playtones requires a codec translation path from signed linear, so won’t work if you are using G.729 without a licence)?

I can use the Playback application to play files of both .gsm and .g722 format. I can use VoiceMail and VoiceMailMain without any problems. I can use Dial with default settings.

I haven’t made any changes to the default settings that have come with the package. I installed and compiled Asterisk from source.


Just realised. You need to keep the call up if you are going to play a tone.

Really you shouldn’t even be answering here. If you call Hangup with an ISDN cause code for congestion, the network or the phone should generate the tone for you without the risk of anyone getting charged for the call. I think calling Congestion as the last action on an unanswered call ought to do the same.

Getting the network or the phone to do this is only possible if you don’t answer.

If there is some reason why you must answer, you need to use Wait for however long you want the tone to play.

Ah it’s working now. I was using Answer() first as that’s what the wiki page said ( … +Playtones)

However when I add a Wait() it seems to give the tones a chance to play

exten => 500,1,Answer
exten => 500,n,PlayTones(congestion)
exten => 500,n,Wait(2)

Many thanks for the help!

If you don’t answer, you shouldn’t use playtones, you should just exit with the correct cause code so that the upstream system will do the right thing.