• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
Back to Tutorials

6.1.2.105. WaitMusicOnHold (dialplan application)

1. WaitMusicOnHold - this application plays music during the time for waiting.

NOTE: This application is valid for Asterisk version 1.0.9 and above.

 


Syntax:

WaitMusicOnHold(delay) ; The delay is in seconds


When done, returns 0 or -1 on hang up. If no hold music is available, the delay will still occur with no sound.

 


Purpose and usage

This application is an expand version of the Wait application. It makes the same thing but instead of silence the caller will hear an music.

 


Prerequisites

To use this application you need a working Asterisk PBX with registered users in iax.conf, sip.conf or mgcp.conf(It depends on which protocol you would like to use) and made extensions.

To see how the application works we recommend to use our IAX softphone Idefisk. You can download it from here. Please also read our tutorial to learn how to configure it to work with Asterisk PBX.

 


Asterisk PBX configurations

NOTE: This is only an example of what for you can use this application. Of course you can use it and for other things.

We need three registered users in iax.conf file. This is because we are going to use the IAX2 protocol. If you want to use other protocol such as SIP or MGCP, you have to do the configurations below respectively in sip.conf or mgcp.conf.



So, we have registered the users anatoliy, user1 and user2.

Type=friend means that this user can make and receive calls. Host=dynamic means that the IP is not static but dynamic through a DHCP server. Allow=all means that the line which this user will use, could support all audio codecs. Context=test - this shows that this user is working with the extensions in this context of the configuration file extensions.conf.



When somebody dials 111 the first executed application is Answer. Then it comes WaitMusicOnHold. This application will set a timer for 10 seconds(because we have set 10 in the brackets). The next extension will be executed when this period of time expire.

The difference between Wait and WaitMusicOnHold is that with the second, you the caller will hear not silence but music. So, we need music. The file where we have to set the path to the music folder is musiconhold.conf



By default the music folder is in /var/lib/asterisk/mohmp3.
The supported format for music files is mp3
If there are more than one music files and the delay is long enough , they will be played one by one starting from the first one to the last one. And this action will be repeated until the time expires.

With the next extension according to priority, we will send a message to the caller. For that purpose we will use the SendText application. The message in our case is: Thank you for your patience.

Then it is always a good idea to make an extension for hanging up. In this way you will be sure that after the conversation is over the Asterisk PBX will close the line.

 


2. Screenshots of what you can see on your Idefisk and on the CLI of the Asterisk PBX






 


3. Additional information

For more information about extensions.conf you can check here.
For more information about iax.conf you can check here.
For more information about musiconhold.conf you can check here.
For more information about MusicOnHold application you can check here.
For more information about SetMusicOnHold application you can check here.

This application is tested with our IAX softphone Idefisk. You can download it from here. For more information about this softphone please read our tutorial.

If you would like to test this application with the SIP channel you can read our tutorials about the SIP Softphones to learn how to configure them to work with Asterisk PBX

 


 
User Comments
Dave H (nospam at spammy dot com)
11 March 2006 23:05:04
Fix the broken links please...

>> configurations below respectively in *sip.conf* or *mgcp.conf*.
 
Add Comment
Name:
Email:
Comment:
In order to prevent automatic posting on our website, we kindly request you to type in the number you see in the picture below.
Image Verification:
 

Latest Headlines:

  • T.38 faxing with Zoiper 2.15 is now easier than ever
    section: voip software
  • Asterisk 1.4.21 Released
    section: Asterisk
  • Asterisk 1.4.20 Released
    section: Asterisk
  • Asterisk 1.4.20-rc2 Released
    section: Asterisk
  • Asterisk 1.4.20-rc1 Now Available
    section: Asterisk
  • News Archives (older news)

Latest Tutorials:

  • Sending Fax from Zoiper to Zoiper using T.38
    added 08/Dec/2008 18:16
  • VMAuthenticate (dialplan application)
    added 01/Mar/2008 15:57
  • Siptronic ST-530
    added 06/Nov/2007 17:57
  • Siemens C455 IP hardphone
    added 05/Nov/2007 10:24
  • Zoiper
    added 22/Oct/2007 17:53

Latest Comments:

  • https://git-ce.rwth-aachen.de/mbd/kiste_...
    tutorial: Basic Information
  • https://git-ce.rwth-aachen.de/mbd/kiste_...
    tutorial: Basic Information
  • https://www.thebeachlittlehampton.co.uk/...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://www.viessmann-community.com/t5/R...
    tutorial: Asterisk Installation
  • https://d2l.msu.edu/d2l/eP/presentations...
    tutorial: Asterisk Realtime configuration
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™