Asterisk dosen't generate ring tones

Hi all,

When I do

The calling party hears a ring tone and everything is fine.

But when the channel was answered before Asterisk is not generating ring tones.

exten => 1000,1,Answer(SIP/100,20,r) exten => 1000,n,Dial(SIP/100,20,r)
The calling party hears silence.

I tried to remove the dial option “r”, I used Ringing() or Progress() before and after Answer() and played with progressinband and prematuremedia in sip.conf. But Asterisk is never generating a ring tone.
The same problem occurs when an extension is doing a blind transfer. As soon as the target is ringing the calling party hears silence until the target answers and the call proceeds.

It seems like Asterisk is not able to generate ring tones at all. Dose Asterisk need something special for this? Like a module or an application? I see no error in /var/log/asterisk/messages.

I’m using Asterisk 11.8.0. Same problem with 11.5.0 and 11.7.0. It was working before upgrading from 1.4.43 to 11.x.

Any suggestions?

Parameters to Answer are wrong.
Try changing it to following and see.

exten => 1000,1,Answer()
exten => 1000,n,Dial(SIP/100,20,r)

–Satish Barot
satish4asterisk@gmail.com

Sorry, I copied the wrong Answer command… I did all my test with the correct Answer command (like you suggested). The problem still exists.

You mean ringback tone.

Asterisk can generate ringback, provided that there is a codec translation path between SLIN (8kHz, 16 bit mono, signed linear) and the codec used by the phone. (For example, if you are using G.729 in pass through mode, you will not be able to generate any tones.)

My phones are using G.711a. “core show translation” shows

(copy in a text editor to get a readable version)

            gsm  ulaw  alaw  g726 adpcm  slin lpc10  ilbc g726aal2  g722 slin16 testlaw slin12 slin24 slin32 slin44 slin48 slin96 slin192
      gsm     - 15000 15000 15000 15000  9000 15000 15000    15000 17250  17000   15000  17000  17000  17000  17000  17000  17000   17000
     ulaw 15000     -  9150 15000 15000  9000 15000 15000    15000 17250  17000   15000  17000  17000  17000  17000  17000  17000   17000
     alaw 15000  9150     - 15000 15000  9000 15000 15000    15000 17250  17000   15000  17000  17000  17000  17000  17000  17000   17000
     g726 15000 15000 15000     - 15000  9000 15000 15000    15000 17250  17000   15000  17000  17000  17000  17000  17000  17000   17000
    adpcm 15000 15000 15000 15000     -  9000 15000 15000    15000 17250  17000   15000  17000  17000  17000  17000  17000  17000   17000
     slin  6000  6000  6000  6000  6000     -  6000  6000     6000  8250   8000    6000   8000   8000   8000   8000   8000   8000    8000
    lpc10 15000 15000 15000 15000 15000  9000     - 15000    15000 17250  17000   15000  17000  17000  17000  17000  17000  17000   17000
     ilbc 15000 15000 15000 15000 15000  9000 15000     -    15000 17250  17000   15000  17000  17000  17000  17000  17000  17000   17000
 g726aal2 15000 15000 15000 15000 15000  9000 15000 15000        - 17250  17000   15000  17000  17000  17000  17000  17000  17000   17000
     g722 15600 15600 15600 15600 15600  9600 15600 15600    15600     -   9000   15600  17500  17000  17000  17000  17000  17000   17000
   slin16 14500 14500 14500 14500 14500  8500 14500 14500    14500  6000      -   14500   8500   8000   8000   8000   8000   8000    8000
  testlaw 15000 15000 15000 15000 15000  9000 15000 15000    15000 17250  17000       -  17000  17000  17000  17000  17000  17000   17000
   slin12 14500 14500 14500 14500 14500  8500 14500 14500    14500 14000   8000   14500      -   8000   8000   8000   8000   8000    8000
   slin24 14500 14500 14500 14500 14500  8500 14500 14500    14500 14500   8500   14500   8500      -   8000   8000   8000   8000    8000
   slin32 14500 14500 14500 14500 14500  8500 14500 14500    14500 14500   8500   14500   8500   8500      -   8000   8000   8000    8000
   slin44 14500 14500 14500 14500 14500  8500 14500 14500    14500 14500   8500   14500   8500   8500   8500      -   8000   8000    8000
   slin48 14500 14500 14500 14500 14500  8500 14500 14500    14500 14500   8500   14500   8500   8500   8500   8500      -   8000    8000
   slin96 14500 14500 14500 14500 14500  8500 14500 14500    14500 14500   8500   14500   8500   8500   8500   8500   8500      -    8000
  slin192 14500 14500 14500 14500 14500  8500 14500 14500    14500 14500   8500   14500   8500   8500   8500   8500   8500   8500       -

Shouldn’t be a problem, right?

You need to use sip debug to find out the codec in use.
[b]

‘core show translation’ can be used in two ways.[/b]

   1. 'core show translation [recalc [<recalc seconds>]]
      Displays known codec translators and the cost associated
      with each conversion.  If the argument 'recalc' is supplied along
      with optional number of seconds to test a new test will be performed
      as the chart is being displayed.

   2. 'core show translation paths [codec]'
       This will display all the translation paths associated with a codec

In the general section of sip.conf I put

disallow=all
allow=alaw

At the time I expect a ring tone I see the following in the sip messages:

Audio is at 10224
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

and

m=audio 10224 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

Nothing else regarding codecs. And still no ring tone.

core show translation paths alaw
--- Translation paths SRC Codec "alaw" sample rate 8000 ---
	alaw       To g723      : No Translation Path
	alaw       To gsm       : (alaw)->(slin)->(gsm)
	alaw       To ulaw      : (alaw)->(ulaw)
	alaw       To g726      : No Translation Path
	alaw       To adpcm     : No Translation Path
	alaw       To slin      : (alaw)->(slin)
	alaw       To lpc10     : No Translation Path
	alaw       To g729      : No Translation Path
	alaw       To speex     : No Translation Path
	alaw       To speex16   : No Translation Path
	alaw       To ilbc      : (alaw)->(slin)->(ilbc)
	alaw       To g726aal2  : No Translation Path
	alaw       To g722      : (alaw)->(slin)->(g722)
	alaw       To slin16    : (alaw)->(slin)->(g722)->(slin16)
	alaw       To siren7    : No Translation Path
	alaw       To siren14   : No Translation Path
	alaw       To testlaw   : (alaw)->(slin)->(testlaw)
	alaw       To g719      : No Translation Path
	alaw       To speex32   : No Translation Path
	alaw       To slin12    : No Translation Path
	alaw       To slin24    : No Translation Path
	alaw       To slin32    : No Translation Path
	alaw       To slin44    : No Translation Path
	alaw       To slin48    : No Translation Path
	alaw       To slin96    : No Translation Path
	alaw       To slin192   : No Translation Path
core show translation recalc
         Recalculating Codec Translation (number of sample seconds: 1)

         Translation times between formats (in microseconds) for one second of data
          Source Format (Rows) Destination Format (Columns)

            gsm  ulaw  alaw  slin  ilbc  g722 slin16 testlaw
      gsm     - 15000 15000  9000 15000 17250  26250   15000
     ulaw 15000     -  9150  9000 15000 17250  26250   15000
     alaw 15000  9150     -  9000 15000 17250  26250   15000
     slin  6000  6000  6000     -  6000  8250  17250    6000
     ilbc 15000 15000 15000  9000     - 17250  26250   15000
     g722 15600 15600 15600  9600 15600     -   9000   15600
   slin16 21600 21600 21600 15600 21600  6000      -   21600
  testlaw 15000 15000 15000  9000 15000 17250  26250       -

Problem solved!

I had this in indications.conf

[general]
country=de

[de]
ringcadence = 1000,4000
dial = 425
busy = 425/480,0/480
ring = 425/1000,0/4000
congestion = 425/240,0/240
callwaiting = !425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,0
dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
record = 1400/80,0/15000
info = 950/330,1400/330,1800/330,0/1000
stutter = 425+400

“description” was missing. So I changed it to

[general]
country=de

[de]
description = Germany
ringcadence = 1000,4000
dial = 425
busy = 425/480,0/480
ring = 425/1000,0/4000
congestion = 425/240,0/240
callwaiting = !425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,0
dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
record = 1400/80,0/15000
info = 950/330,1400/330,1800/330,0/1000
stutter = 425+400

Now everything is working. Thanks for helping me!