PDA

View Full Version : How-To: configure the Warp audio in/out for Music on Hold and Paging



vfadmin
06-17-09, 03:29 PM
Music on Hold and Paging


If you wish to use the audio line in (for Music on Hold) and line out (for Paging) with Asterisk,
then you will need to modify a few configuration files.

musiconhold.conf

The musiconhold.conf files specifies the music-on-hold configuration rules.
The default is currently set to:

[default]
mode=files
directory=/var/lib/asterisk/moh

The pika rule is set to:

[pika-linein]
mode=custom
application=/bin/streamplayer 127.0.0.1 8888
format=ulaw

pika.conf

For the fxo and fxs groups the musiconhold tag can be set appropriately

[fxo]
musiconhold=pika-linein

[fxs]
musiconhold=pika-linein

sip.conf

For each agent, specify the musiconhold desired configuration.
For example:

[Agent1]
musiconhold=pika-linein

extensions.conf
In the extensions file you will notice that it includes some same code on how to use it.

;
; Warp linein (Music on Hold) and lineout (Paging)
; Extensions.
;

;
; Listen to linein audio via MoH and streamplayer
;

exten => 2222,1,Set(CHANNEL(musicclass)=pika-linein)
exten => 2222,n,MusicOnHold()

;
; Live connection to the lineout audio port
;

exten => 2233,1,Dial(PIKA/audio/1)

;
; Fork the call after making a connection to the lineout audio port
;

exten => 2244,1,Dial(PIKA/audio/1||G(warp^lineout-dial-file^100))
exten => 2244,n,Goto(dial-${DIALSTATUS},1)

;
; To terminate the audio playback on the audio out initiated via 2244
;

exten => 2255,1,SoftHangup(PIKA/audio/1)
exten => 2255,n,Congestion(5)

;
; To handle G option in Dial command, calling party to 100, called party to 101
;

exten => lineout-dial-file,100,Goto(calling-party,1)
exten => lineout-dial-file,101,Goto(called-party,1)

;
; calling party, play message and go back to start
;

exten => calling-party,1,PlayBack(demo-thanks)
exten => calling-party,n,Goto(s,1)

;
; called party (audio port), play message and hangup
;

exten => called-party,1,PlayBack(demo-congrats)
exten => called-party,n,Hangup()