Thursday, November 24, 2011

A simple IVR and Queue example where customer listens to marketing materials and also can leave voice message by '*'

A customer asks for an automated greeting system where callers listen to marketing messages before being picked up by agents.  They can also press '*' anytime to quit waiting in the queue and leave voice message.

1.    In the dial plan, we use the option 'Hn' in the Queue command.  The 'H' allows caller to hangup a ringing call by whatever defined as the disconnect sequence in features.conf.  Note that we also need 'n' such that the retry cycle is skipped and the Queue command exits.


exten => 12345,1,noop
; answer before playing the sound files
exten => 12345,n,answer
exten => 12345,n,wait(1)
exten => 12345,n,Set(TIMEOUT(digit)=2)
exten => 12345,n,Set(TIMEOUT(response)=10)
exten => 12345,n,Background(custom-ivr/custom-welcome)
;exten => 12345,n,Set(TIMEOUT(digit)=5)
; use H to let caller hangup a ringing call to agent by disconnect key seq in features.conf
; use n such that caller skips the retry cycle and exits the queue command
; otherwise, caller still stays in the queue redialing to agent
exten => 12345,n,Queue(custom-queue,Hn,,,300)
; customer leaves voice message by keying '*' or upon wait timeout of 300s
exten => 12345,n,VoiceMail(custom-vm@custom-ivr)

; we still need this extension to handle '*' pressed during the welcome greeting
exten => *,1,noop(i quit waiting)
exten => *,n,VoiceMail(custom-vm@custom-ivr)

To verify the current disconnect sequence, we can use 'feature show' in the CLI.

2.    The marketing messages are specified as a MOH class 'custom-ivr' in the queue definition.  


strategy = ringall
musicclass = custom-ivr
ringinuse = no
wrapuptime = 30
joinempty = yes

3.    Then we can put the marketing messages in a directory /var/lib/asterisk/moh/custom-ivr.  These sound files are preferably formatted to minimize transcoding. 



We can use 'core show translation' in CLI to show how costly Asterisk performs the transcoding.

4.    Alternatively, the queue 'context=' also allows caller to quit by keying a defined extension.  For example, with below configurations, caller can also quit the queue by '*'.


context = custom-ivr


; no need for Hn
exten => 12345,n,Queue(custom-queue,,,,300)

exten => *,1,noop(i quit waiting)


  1. Interested in advertising?


    We can offer you up to $60 for a link on one of your site’s internal pages. We are working on a project to increase our page rank and site visibility. We just need to turn words that are already in the article into links for us. Let us know if you are interested. We can pay you within 48 hours of the link being up.

    We basically require space for small text based ads that will not use that much space of your site. We assure you the relevance of the ads to your website and its content. Moreover, we will also help you in generating income from your website by placing the advertisements of our 7-8 clients. We can help you grow your revenue via placement of relevant advertisements on your site.
    Additionally, if you needed sponsored content, we are ready to offer you that as well. The payment is done via PayPal.

    So, what are you waiting for? Let us develop business and grow together!

    Best Regards,


    Derek Miller
    Inventory Manager


  2. Thank you very much for your information.
    Australia ETA/eVisitor Visa
    is quiet easy to apply online from Singapore,
    Malaysia, United Kingdom, United States, Canada, France and including all others ETA Eligible Countries from our website.

  3. admire views of the Yas Marina Formula 1 circuit and Ferrari World, and visit the Heritage Village to learn about Abu Dhabi’s pre-oil past and Bedouin beginnings. Informative guided commentary, round-trip transport, and Dubai hotel pickup and drop-off are included.abu dhabi city tour

  4. Dubai city tour is all about remarkable transformation – from a small pearl village to a world class epicenter of 5 star experiences – that is Dubai, UAE’s pride! Over the years Dubai has become the leading destination for holidays around the world. It has to be; with so many attractions and beautiful sandy beaches to claim, no wonder that millions flock to this city to see what it’s about. Take a city tour Dubai and experience for yourself.
    Dubai city tour