MUSIC ON HOLD

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

MUSIC ON HOLD

Postby asterguy » Thu Aug 07, 2008 4:40 pm

Hi,

I have installed the new version of vicidial (2.0.4.rc3).
My goal is to play files in a specific order in the music on hold portion.

What I did is modify the agi-script for the inbound call.

file: agi-VDAD_ALL_inboundlui1.agi

---part of the script START---

if ($hold_message_counter > $prompt_interval)
{
# $AGI->stream_file('sip-silence'); # stop music-on-hold process
# $AGI->stream_file("$onhold_prompt_filename"); # this prompt must be less than 10 seconds long
$hold_message_counter = 0;
$start_moh=1;
if ($drop_timer > 3) {$drop_timer = ($drop_timer + 5);} # add propmt play time to total queue time
}
else {$hold_message_counter++;}
if ($hold_tone_counter > 3)
{
$hold_tone_counter = 0;
}
else {$hold_tone_counter++;}

if ($drop_timer < 3)
{
### sleep for 23 hundredths of a second
usleep(1*230*1000);
$drop_timer = ($drop_timer + 0.25);
}
else
{
if ($start_moh > 0)
{
$start_moh=1;
print "SET MUSIC ON $moh_context\n";
checkresult($result);
}
### sleep for 99 hundredths of a second
usleep(1*990*1000);

$drop_timer++;
}

---part of the script END--


Modification:
1. I removed the generic_hold part so that it will only play the music on hold files I made.

Questions:
1. How will I know the order of the native music on hold context? Is it alphabetically? Is it by date modified? Is it by file size?

[native]
mode=files
directory=/var/lib/asterisk/moh-native

- its playing my list but i don't know the specific order.



THANKS!!


-
asterguy
 
Posts: 41
Joined: Thu Aug 07, 2008 4:30 pm

Postby mflorell » Thu Aug 07, 2008 7:18 pm

In the musicohhold conf file I believe that you just need to set "random=no"
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby asterguy » Thu Aug 07, 2008 10:38 pm

ok... i'll test it tonight. hope it works! is it alphabetical order?
asterguy
 
Posts: 41
Joined: Thu Aug 07, 2008 4:30 pm

Postby mflorell » Fri Aug 08, 2008 12:02 am

I would recommend naming the files with a 1, 2, 3 at the beginning to see if that helps.

Let us know how it goes.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby asterguy » Fri Aug 08, 2008 12:02 pm

I renamed the files to 1,2,3,4,5,6,7,8. And then reboot the asterisk.

Result: it first plays number 1 and plays 2nd number 4.
asterguy
 
Posts: 41
Joined: Thu Aug 07, 2008 4:30 pm

Postby mflorell » Fri Aug 08, 2008 1:23 pm

What audio format are the files?
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby asterguy » Fri Aug 08, 2008 2:13 pm

gsm
asterguy
 
Posts: 41
Joined: Thu Aug 07, 2008 4:30 pm

Postby mflorell » Fri Aug 08, 2008 2:31 pm

Can you post your mosiconhold.conf file and let me know what version of Asterisk you are running?
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby asterguy » Fri Aug 08, 2008 2:54 pm

-----start of musiconhold.conf-----
;
; Music on Hold -- Sample Configuration
;

[default]
mode=quietmp3
directory=/var/lib/asterisk/moh-native

; valid mode options:
; quietmp3 -- default
; mp3 -- loud
; mp3nb -- unbuffered
; quietmp3nb -- quiet unbuffered
; custom -- run a custom application
; files -- read files from a directory in any Asterisk supported format

;[manual]
;mode=custom
; Note that with mode=custom, a directory is not required, such as when reading
; from a stream.
;directory=/var/lib/asterisk/mohmp3
;application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s

;[ulawstream]
;mode=custom
;application=/usr/bin/streamplayer 192.168.100.52 888
;format=ulaw

; mpg123 on Solaris does not always exit properly; madplay may be a better
; choice
[solaris]
mode=custom
directory=/var/lib/asterisk/mohmp3
application=/site/sw/bin/madplay -Q -o raw:- --mono -R 8000 -a -12
;

;
; File-based (native) music on hold
;
; This plays files directly from the specified directory, no external
; processes are required. Files are played in normal sorting order
; (same as a sorted directory listing), and no volume or other
; sound adjustments are available. If the file is available in
; the same format as the channel's codec, then it will be played
; without transcoding (same as Playback would do in the dialplan).
; Files can be present in as many formats as you wish, and the
; 'best' format will be chosen at playback time.
;
; NOTE:
; If you are not using "autoload" in modules.conf, then you
; must ensure that the format modules for any formats you wish
; to use are loaded _before_ res_musiconhold. If you do not do
; this, res_musiconhold will skip the files it is not able to
; understand when it loads.
;

[native]
mode=files
directory=/var/lib/asterisk/moh-native

[moh-lui]
mode=files
directory=/var/lib/asterisk/moh-lui
random=no



-----end of musiconhold.conf-----

I'm using moh-lui as my music on hold context.

astrc3*CLI> show version
Asterisk SVN-branch-1.2-r133577M built by root @ astrc3 on a i686 running Linux on 2008-07-30 23:50:24 UTC
asterguy
 
Posts: 41
Joined: Thu Aug 07, 2008 4:30 pm

Postby mflorell » Fri Aug 08, 2008 4:33 pm

Any idea what release version of Asterisk is closest to that SVN snapshot?
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby asterguy » Fri Aug 08, 2008 4:38 pm

maybe version 1.2

I tried to modify the time to check if its sorting by time. I found out that it's not. I'm still checking what sorting does this files context does.
asterguy
 
Posts: 41
Joined: Thu Aug 07, 2008 4:30 pm


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 108 guests