Option to leave a VM or stay in queue

I have not been able to figure this out:

When a customer is is the waiting queue, there is no way out except to hang up. Is there a way for a customer to press a key after which they will be sent to a prompt or VM box “if you would like to continue to hold please” do nothing or "if you would like to leave a message dial 1 and send them to voicemail?/


There should be a way to do this with the dial plan. The part i’m not sure of is putting a specified time to wait in the queue, or as you said, setting a button to press to bring up the options, once we have this, we could use something like below:

exten => s,1,Answer
exten => s,2,Background(options)

exten => 1,1,Voicemail(u1002)
exten => 1,2,Hangup

exten => 2,1,Queue(myqueue) #can we specify a wait time here?
exten => 2,2,Playback(apologies)
exten => 2,3,Goto(mainmenu,s,2)

I havn’t tested the above, just thought of this. Try it out and see how you go. There are a few ways around this through the dial plan…


This all goes in the extension.conf file?? What needs to be done in the queues.conf? I will try and play with this.

I assume you have Queues working? If so, I think it should all be done from the dial plan.

Here you go, I think I found it (as usual on voip-info):


Two parts relating to extensions.conf and queues.conf that show the use of a timeout:

exten => 129,1,Playback(some_announce) ; Important, see notes
exten => 129,2,Queue(example_queue|tT|||300) ;dont set n option until really needed
exten => 129,3,Playback(some_announce_after_leaving_queue)
exten => 129,4,Voicemail(s1234)


music = default
strategy = ringall
context = queue-out ; Here we go when the caller presses a single digit, while in the queue
timeout = 15
announce-frequency = 30
announce-holdtime = yes
joinempty = yes
member => Agent/1234
member => Agent/1235 [/color]

Let us know how it goes.

This is an old topic I know but I have not gotten this to work. I have tried putting this in but it doesn’t work. Perhaps because I dont have a queue-out context? Putting the files back the way they were, they look like this:


exten => s,1,Background(tlab-quality)
exten => s,2,Background(billing1)
exten => s,n,WaitExten(5)
exten => s,n,Goto(billing,s,2)
exten => 1,1,GotoIfTime(8:00-17:00|mon-fri||?billing,5763,1)
exten => 1,n,Wait(2)
exten => 1,n,Voicemail(7214)
exten => 2,1,Dial(Zap/g1/18003656988)
exten => 3,1,Queue(temp-cyn|t|||300) ; cyn temp for old Brandx
exten => t,1,Goto(sales,s,1)
exten => 5763,1,Queue(bhs-billing|t|||300)
exten => 5763,n,Voicemail(7214)

and queues.conf
music = default
monitor-format = wav
strategy = ringall
;context = default ; Here we go when the caller presses a single digit, while in the queue
timeout = 15
announce-frequency = 30
announce-holdtime = no
joinempty = yes
member => SIP/7214

I had context = queues-out but I didn’t have such a context anywhere. Thought maybe this was an exit command of some sort to get back to where I was in the extensions.conf. So, can anyone clarify how this is done? I would like that if a customer entered the queue they had an option to leave a voicemail rather than remain in the queue forever.


in your queues.conf, you need to set a context - you currently have that commented out.

so, change ‘;context=default’ to ‘context=queue-out’ and add this to your extensions.conf

exten => s,1,Playback(whatever-message-you-want)
exten => s,n,Wait,15 ; wait 15 secs for response
exten => s,n,Goto(1) ; send user to VM box
exten => 1,1,Voicemail(u101)

Thanks whoiswes. Two more questions if you will. The caller is not notified while they are in the queue that they can press a digit (say 1) to leave a message. Is there a way to do that?
Second, since I have several queues such as billing, sales, tech support, is there a way to create and pass a variable for the extension number that the caller is wanting back to the queue-out context? That way I only have to create one rather than one for each extension.

Again, thanks for the help.


  1. should be - just record any one of the annoucement files to include that message, and it will be played back to the user.

  2. should be able to - use the SET command to set a variable like QUEUE_NAME, then in your queue-out context, you can route based on that variable’s value.

good luck!