Play a custom prompt as caller enters a queue?

Is there a way to play a custom prompt as a caller enters the queue? Something like “Thanks for calling XYZ all of our representatives are helping other customers, please stay on the line and your call will be answered in the order in which it was received”

It would be nice if it only played this message when there were other callers in the queue and bypass the prompt if an agent was available.

I guess I could just create a custom MOH audio file for the queue that contained this message?

Is it possible to customize the periodic messages? Is there a mapping between the “queue-periodic-announce” attribute in queues.conf to an audio file in the asterisk sounds directory? Or is there another way to do it?

Thanks guy’s!

Somenting like: -

exten => s,1, GotoIf($[${QUEUE_MEMBER_COUNT(queue1)} = 0]?enterqueue) exten => s,n, Playback(custom-message) exten => s,n(enterqueue), Queue(queue1)
You should be able to set, in queues.conf: -

periodic-announce = some-message-of-my-own periodic-announce-frequency = 60
but I have not actually tried this.

Update: the GotoIf command will not work as intended. The general idea is sound but the QUEUE_MEMBER_COUNT() func returns agents not calls. Anyone got a better idea here?

Thanks that gives me something to work with. I guess I just need to see if there is some function that returns how many callers are in the queue? Assuming one exists.

Thanks again!

Looks like this should do the job? QUEUE_WAITING_COUNT()

What do you think?

Dam Asterisk is amazing. And this coming from a 11 year CCIE Cisco bigot!

Here’s the config:

exten => 380,1,Playback(pls-hold-while-try)
exten => 380,n,SayDigits(${QUEUE_WAITING_COUNT(dispatch)}) ; just a test to see how many callers in queue! Remove in production.
exten => 380,n,GotoIF($[${QUEUE_WAITING_COUNT(dispatch)} = 0]?enterqueue) ;note no space after the ? mark!
exten => 380,n,Playback(custom/thankyouforholding)
exten => 380,n(enterqueue),Queue(dispatch|t|||120)
exten => 380,n,Voicemail(301,u)

Arghhhhh! The trusty wiki I rely on was out of date. The QUEUE_WAITING_COUNT() was missing and for some reason I didn’t check the real func list. Getting lazy!

As penance I’ll have to up date the voip-info.org wiki function list!

Glad you got something running anyway.