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

6.1.2.50. MP3Player (dialplan application)

1. MP3Player - this application allows you to play a mp3 file.

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

 


Syntax:

MP3Player(pathfilename.mp3)

 


Purpose and usage

With this application you can play a mp3 file, thanks to the mpg123 UNIX program.

We will show you a simple example below.

 


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.

Also, you need to install the mpg123 package when you compile the asterisk package during the installation of the Asterisk PBX.

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 two 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 and user1

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.



On the picture above you can see our extensions.conf file.

So, in our example when somebody dials 222, the call will be answered by the Answer application. Then the caller will hear the mp3 file. In our example the caller will hear the mp3 file - music.mp3. Then the call will be connected to the user user1 through the IAX2 channel, thanks to the Dial application.

In the brackets of the MP3Player application, as argument you have to write the full path to the mp3 file, the name of the mp3 file and it extension. For example: /tmp/music/music.mp3

We recommend you always to make an extension for hanging up in order to be sure that the Asterisk PBX will close the line after the conversation is over.

NOTE: Please, pay attention, that in order to use this application you need to have an installed mpg123 package on your system. So, do not forget to install it, when you compile the asterisk package, during the installation of the Asterisk PBX. For more information about the installation of the package please read our tutorial about the installation of the Asterisk.

 


2. Screenshots of what you can see 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.

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

 


4. Similar dialplan applications

BackgroundDetect()
Playback()
Background()
Playtones()
ControlPlayback()
StopPlaytones()

 

 
User Comments
amoxicillin 500 mg cost walgreens (romaine_weidner at xikohogum dot cf)
15 September 2020 09:27:21
amoxicillin 500 mg cost walgreens https://amoxycillin1st.com/
mingming (ming at ming dot com)
09 April 2017 02:50:13
Ming ming!!!!
andrey (andrey at khomp dot com)
05 April 2017 00:26:28
Good Nigth, first excuse my english.
I need it when there is a call from another extension that is playing the music, stop music and come back soon after the call is disconnected.

Help, Best regards
fcois93 (fcois93 at hotmail dot com)
12 October 2007 16:38:43
can we play to music during the dial?
 
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™