You can create a context in extensions.conf
that just rings forever if you call it, and then dial both the extension you want to reach and that contex. This guarantees that it will always run the Dial()
application for 30 seconds before jumping to the voicemail. (Change the 30 seconds value as needed to get five ringtones... the period of ringtones can be found in the appropriate section of indications.conf
for your country, so you can calculate how much time five rings are supposed to be.)
It can look something like this:
[noop]
exten => s,1,Wait(30)
same => n,Hangup
[your_context]
exten => 1234,1,Dial(SIP/ivan&Local/s@noop,30)
exten => 1234,2,VoiceMail(777@mb_tutorial)
exten => 1234,3,PlayBack(vm-goodbye)
exten => 1234,4,HangUp()
Calling the noop context will basically have no effect, and if SIP/ivan
is available, then it will ring. If you are not hearing ringtones when calling the 1234 extensions, you can try different options:
First possibility, using call progress (avoiding answering the channel and thus having the caller possibly pay to hear ringtones... but does not always work, depending on the SIP provider):
[your_context]
exten => 1234,1,Progress
exten => 1234,2,Ringing
exten => 1234,3,Dial(SIP/ivan&Local/s@noop,30)
exten => 1234,4,VoiceMail(777@mb_tutorial)
exten => 1234,5,PlayBack(vm-goodbye)
exten => 1234,6,HangUp()
Second possibility, generating ringtones as sound on the answered channel (meaning that the caller pays for the call while waiting for an answer too, because the call is actually answered):
[your_context]
exten => 1234,1,Answer
exten => 1234,2,Playtones(ring)
exten => 1234,3,Dial(SIP/ivan&Local/s@noop,30)
exten => 1234,4,VoiceMail(777@mb_tutorial)
exten => 1234,5,PlayBack(vm-goodbye)
exten => 1234,6,HangUp()
If you do not hear the ring tones while waiting, try adding a ,r
parameter to the Dial
application:
exten => 1234,3,Dial(SIP/ivan&Local/s@noop,30,r)