Summary:ASTERISK-07547: Coloring Ring Back Tone (early media)
Reporter:Peng Yong (ppyy)Labels:
Date Opened:2006-08-17 22:23:08Date Closed:2006-12-30 00:23:36.000-0600
Versions:Frequency of
Description:when the caller call users of asterisk from Zap, he will nevel hear music ring before the call is answered.

caller <---> PSTN <---> PRI <---> Digium T410 <---> asterisk <--> extension

i found Dial command has a option:

m: Provide Music on Hold to the calling party until the
called channel answers. This is mutually exclusive with option 'r',
obviously. Use m(class) to specify a class for the music on hold.

exten => 81206802,1,Dial(SIP/6802|120|m)

and asterisk console shows:

-- Started music on hold, class 'default', on Zap/77-1

but caller hears nothing, no ring and no music.
if i remove 'm' option, the caller can hear ring.

Background also has 'n' option and Playback has 'noanswer' option to play sounds before answer. following dial play also not work.

exten = 8001,1,PlayBack(demo-congrats|noanswer)
exten = 8001,n,Hangup

exten = 8002,1,Background(demo-congrats|n)
exten = 8002,n,Hangup

Comments:By: Peng Yong (ppyy) 2006-08-17 22:28:09

the PRI provider told me we should send the Q.931 "ALERTING" before we play the sounds to them.

and i find a good document from Cisco to explain the ring back tone:


it also says we should send "Alerting" message.

and here is my patch, it will works fine with 'm' option of Dial, 'n' option of Background and 'noanswer' option of PlayBack. Tested with Huawei C&C 08 switch.

By: Serge Vecher (serge-v) 2006-08-18 08:15:35

AFAIK Progress() app will send the "alerting message."

By: Peng Yong (ppyy) 2006-08-18 08:38:04

thanks for vechers.

it works with Ringing() or Progress()

i think we should:

add a document to dial/playback/backgroud
apply the patch to do it automaticlly

By: Serge Vecher (serge-v) 2006-09-06 12:01:56

ppyy: can you please make a patch for the documentation, as I think, that would be the preferred solution ....

By: Peng Yong (ppyy) 2006-09-07 08:32:54

english is not my native language, so i can't document it clearly.

serge-v, would you like to do it?

By: jmls (jmls) 2006-11-01 12:57:58.000-0600

ppyy: would you make an initial change to the documentation, and someone else (me or serge-v) will tidy it up. Thanks.

Can we also remove the attached patch seeing as this is not a bug.

By: Joshua C. Colp (jcolp) 2006-11-07 12:53:10.000-0600

Removed evil patch per jmls' request.

By: Nic Bellamy (nic_bellamy) 2006-12-29 17:09:38.000-0600

Is this still an issue in 1.2.14 / the latest 1.2 branch?

Reason I ask is the following commit:

r48192 | kpfleming | 2006-12-02 12:30:59 +1300 (Sat, 02 Dec 2006) | 2 lines

if Dial() is going to send music-on-hold to the calling party, it has to send PROGRESS first to ensure that the reverse audio path has been setup first (BE-106)

This commit patches Dial() to indicate PROGRESS when doing music-on-hold ringing:

Index: apps/app_dial.c
--- apps/app_dial.c     (revision 48191)
+++ apps/app_dial.c     (revision 48192)
@@ -1197,6 +1197,7 @@
               strcpy(status, "NOANSWER");
               if (ast_test_flag(outgoing, OPT_MUSICBACK)) {
+                       ast_indicate(chan, AST_CONTROL_PROGRESS);
                       ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK]);
               } else if (ast_test_flag(outgoing, OPT_RINGBACK)) {
                       ast_indicate(chan, AST_CONTROL_RINGING);

By: Joshua C. Colp (jcolp) 2006-12-30 00:23:36.000-0600

Thank you for finding that commit nic_bellamy, nobody had clued in on this bug in relation to it and I'm fairly sure that it was the cause of this bug and also fixed the issue for the customer who reported it. To that extent I am closing out this bug. If it is still an issue please feel free to reopen this ppyy. Peace!