Making an extension number while it ring. is it possible?


i have a :

exten => s,1, answer
exten => s,2, background(…
exten => s,3,dial(zap/1,20)

exten => 30,1,…
exten => 31,1,…

i have 2 questions

first… is there a way that while the the zap/1 is ringing (in this 20 seconds) the caller make extension 30 without waiting that the 20 seconds rings finish ?

Second question…

When the caller arrive to s3 he hear the ring tone… can i replace the ring tone by a prompt ? Someting that would be a lot better is that if the background prompt of s,2 is 40 seconds longs… i start the ringing of zap/1 phones after 20 seconds the playing of the s,2 prompt and i finish the s,2 prompt at the same time that the 20 seconds ringing in the zap/1 finish…
is it possible ?

I hope you’ll understand what i want because my english is not good at all.

Thank you very much.

The background() command waits for ${RESPONSETIMOUT} seconds (set via Set(TIMEOUT(response=20)) for DTMF digits. If the caller presses 30 on their phone during the ring then it should call extension 30.

To replace the ringtone, make an mp3 of the prompt you want to play and put it in /var/lib/asterisk/mohmp3/custom. Configure a musiconhold class in musiconhold.conf to point to the custom directory (you can call it whatever you like). The put the following in extensions.conf

exten => s,3,SetMusicOnHold(custom)
exten => s,4,Dial(Zap/1,20,m(custom))

This will play the mp3.