Music on hold while ringing, until answering the call

Hello frineds.
I faced another problem, maybe it will seem unserious to you.

I want the music being played for the person who dials, and the called phone being ringing at he same time.

With the ‘MusicOnHold’ application only the music plays in the phone. Another phone is not ringing.
Of corse I can use Background with seconds specified, but it’s not so useful.

There are a lot of information about MOH, but I can not understand how to achieve these simultaneously:
the music being played for the person who dials, and the called phone being ringing at he same time.

Something should be changed but I can not understand, what exactly.

exten => _XXXX,1,Answer
exten => _XXXX,n,MusicOnHold(default)
exten => _XXXX,1,Dial(SIP/${EXTEN},15)
exten => {EXTEN},n,Hangup()

Skip your MusicOnHold and use the Dial() application with the ‘m’ flag

voip-info.org/wiki/view/Asterisk+cmd+Dial
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.

Also, your dialplan priorities are messed up, you got 2 lines with the 1 priority.

exten => _XXXX,1,Answer
exten => _XXXX,n,Dial(SIP/${EXTEN},15,m)

Regards,
Constantin

constantinp, many thanks!
I’ve read some time ago about ‘m’, but the mistake was that I used ... m,15 but not ... 15,m
That’s why the music was not playing :slight_smile:
Now it’s OK

Oops, really. But in real dialplan priorities are OK, it was edited with mistake only here, in the quote.
Thank you.