MOH incorrect play order

All installation and configuration problems and questions

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

MOH incorrect play order

Postby PierreDeux » Fri Dec 06, 2013 11:21 am

VERSION: 2.8-417a BUILD: 131019-0849 built using Vicibox 5.0.3, no extra anything.

I'm trying to create some custom MOH entries and seems that either my version has some kind of a bug or I dunno what else I should check. Here is what I did (basically I've already done this on another vicidial verion and it worked fine):
1. I took a couple of recordings, cut them by several 9-seconds pieces and uploaded them to Audio store
2. Created MOH entry with random = N, added my .wav pieces one by one making sure that the order is correct.
3. Saving everything, waiting for a minute till MOH entries will get updated.
However when trying to make a test call I'm always getting my recordings played in the wrong order. My MOH plays the 3rd piece before any other. It's not random, it's the same every time. Once I have less, than 2 pieces in my MOH entry - they play fine, however every time I add third piece - it stats mixing them.

I've double checked the configs:
Code: Select all
; Go Down Moses - Louis Armstrong
[louis_armstrong]
mode=files
directory=/var/lib/asterisk/louis_armstrong

; La boheme- Charles Aznavour
[french]
mode=files
directory=/var/lib/asterisk/french


and files:
Code: Select all
voip13:/var/lib/asterisk/french # ls -l
total 724
-rw-r--r-- 1 root root     33 Dec  6 11:06 0000_sip-silence.gsm
-rw-r--r-- 1 root root 144312 Dec  6 11:06 0001_boheme9.wav
-rw-r--r-- 1 root root 144312 Dec  6 11:06 0002_boheme18.wav
-rw-r--r-- 1 root root 144312 Dec  6 12:00 0003_boheme27.wav
-rw-r--r-- 1 root root 144312 Dec  6 12:00 0004_boheme36.wav
-rw-r--r-- 1 root root 144312 Dec  6 12:01 0005_boheme45.wav

voip13:/var/lib/asterisk/louis_armstrong # ls -l
total 580
-rw-r--r-- 1 root root     33 Dec  5 11:13 0000_sip-silence.gsm
-rw-r--r-- 1 root root 144200 Dec  6 09:56 0001_1godown.wav
-rw-r--r-- 1 root root 144200 Dec  6 09:57 0002_2godown.wav
-rw-r--r-- 1 root root 144200 Dec  6 09:59 0003_3godown.wav
-rw-r--r-- 1 root root 144200 Dec  6 09:59 0004_4godown.wav


Files are good too: playing them manually one by one proves that they are properly cut and named.
Any ideas?
Last edited by PierreDeux on Fri Dec 06, 2013 12:03 pm, edited 1 time in total.
PierreDeux
 
Posts: 58
Joined: Tue Jul 20, 2010 8:18 am

Re: MOH incorrect play order

Postby PierreDeux » Fri Dec 06, 2013 11:58 am

As a part of my experiment I've added the same MOH entry to another vicidial server (VERSION: 2.8-403a BUILD: 130510-1350, asterisk 1.4) and it's working fine.
Last edited by PierreDeux on Tue Dec 10, 2013 12:05 pm, edited 1 time in total.
PierreDeux
 
Posts: 58
Joined: Tue Jul 20, 2010 8:18 am

Re: MOH incorrect play order

Postby PierreDeux » Tue Dec 10, 2013 9:53 am

Bump! Still fighting with the issue :(
PierreDeux
 
Posts: 58
Joined: Tue Jul 20, 2010 8:18 am

Re: MOH incorrect play order

Postby DomeDan » Tue Dec 10, 2013 10:14 am

try
sort=alpha
in the config file

or rename the files because apparently the files is sorted by file-name length
(in elastix at least, according to this post: http://www.freepbx.org/forum/freepbx/ti ... here-a-way)
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: MOH incorrect play order

Postby PierreDeux » Tue Dec 10, 2013 12:11 pm

DomeDan wrote:try
sort=alpha
in the config file

or rename the files because apparently the files is sorted by file-name length
(in elastix at least, according to this post: http://www.freepbx.org/forum/freepbx/ti ... here-a-way)



You are my saver :) It works with sort=alpha, but: considering "french" context had different file names length - it could be the reason of such behavior, so what's wrong with another context? (that was also buggy and got fixed with "alpha" sorting) All file names are of the same length there:
-rw-r--r-- 1 root root 144200 Dec 6 09:56 0001_1godown.wav
-rw-r--r-- 1 root root 144200 Dec 6 09:57 0002_2godown.wav
-rw-r--r-- 1 root root 144200 Dec 6 09:59 0003_3godown.wav
-rw-r--r-- 1 root root 144200 Dec 6 09:59 0004_4godown.wav
PierreDeux
 
Posts: 58
Joined: Tue Jul 20, 2010 8:18 am

Re: MOH incorrect play order

Postby DomeDan » Wed Dec 11, 2013 5:30 am

Good you had it solved!

the reason for the strange order might be that asterisk takes the files in the order they appear on disk, do a:
ls -f
to list files with no sorting order
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: MOH incorrect play order

Postby PierreDeux » Wed Dec 11, 2013 8:41 am

Looks like you are right :(
-rw-r--r-- 1 root root 144200 Dec 6 09:59 0004_4godown.wav
-rw-r--r-- 1 root root 144200 Dec 6 09:57 0002_2godown.wav
-rw-r--r-- 1 root root 33 Dec 5 11:13 0000_sip-silence.gsm
drwxr-xr-x 2 root root 4096 Dec 6 09:59 .
-rw-r--r-- 1 root root 144200 Dec 6 09:56 0001_1godown.wav
drwxr-xr-x 13 root root 4096 Dec 11 08:15 ..
-rw-r--r-- 1 root root 144200 Dec 6 09:59 0003_3godown.wav

Do you know which script modifies musiconhold-vicidial.conf? It's obviously easier to modify the scrip, rather then do full disk defrag every time I modify MOH entry :(
PierreDeux
 
Posts: 58
Joined: Tue Jul 20, 2010 8:18 am

Re: MOH incorrect play order

Postby DomeDan » Wed Dec 11, 2013 9:44 am

You could edit ADMIN_keepalive_ALL.pl like this:
Code: Select all
--- ADMIN_keepalive_ALL.pl.orig 2013-12-11 15:40:12.605636652 +0100
+++ ADMIN_keepalive_ALL.pl      2013-12-11 15:41:21.930993143 +0100
@@ -2860,7 +2860,7 @@
                $moh  .= "mode=files\n";
                $moh  .= "directory=/var/lib/asterisk/$moh_id[$j]\n";
                if ($random[$j] =~ /Y/)
-                       {$moh  .= "random=yes\n";}
+                       {$moh  .= "random=yes\n";} else { $moh  .= "sort=alpha\n";}
                $moh  .= "\n";
 
                $j++;

Then if random is not Y, it will be set to sort=alpha in the config file.

edit: just tested it and it works for me
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: MOH incorrect play order

Postby PierreDeux » Wed Dec 11, 2013 1:06 pm

Thanks, Dan, works for me too :) I suggest vicidial group should update ADMIN_keepalive_ALL.pl in the next release
PierreDeux
 
Posts: 58
Joined: Tue Jul 20, 2010 8:18 am

Re: MOH incorrect play order

Postby mflorell » Sun Jan 12, 2014 7:40 pm

Fixed in svn trunk now.

Thanks!
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: Majestic-12 [Bot] and 87 guests