Page 1 of 1

MOH File Format Issues

PostPosted: Tue Jan 14, 2014 12:48 pm
by ZeeTech
For an inbound campaign I define following music on hold context.

[pkpost]
mode=files
directory=/var/lib/asterisk/pkpost

Using following SOX command I converted file in gsm format and put in above directory.
sox PP_Queue_Wait_With_Music.wav -t raw -r 8000 -s -w -c 1 PP_Queue_Wait_With_Music.gsm

Now whenever asterisk start this music on hold it stop for a second and then start playing the file and calling party observe a slight pause in hold music.

CLI Logs.
[Jan 14 22:33:24] -- Started music on hold, class 'pkpost', on SIP/5515-000000db
[Jan 14 22:33:27] -- Stopped music on hold on SIP/5515-000000db
[Jan 14 22:33:27] -- Playing 'sip-silence' (escape_digits=) (sample_offset 0)\
[Jan 14 22:33:27] -- Playing 'sip-silence' (escape_digits=) (sample_offset 0)
[Jan 14 22:33:28] -- Playing 'sip-silence' (escape_digits=) (sample_offset 0)
[Jan 14 22:33:28] WARNING[16540]: file.c:665 ast_openstream_full: File PP_Queue_Wait_With_Music does not exist in any format
[Jan 14 22:33:29] -- Started music on hold, class 'pkpost', on SIP/5515-000000db

Please advise how to fix this problem.

Vicidial VERSION: 2.4-309a | BUILD: 110430-1642 | Asterisk 1.4.39.1-vici

Re: MOH File Format Issues

PostPosted: Wed Jan 15, 2014 1:59 am
by williamconley
the best method i can think of is to create all this in the GUI instead of trying to do it directly in asterisk.

the manual may or may not contain a section on MOH, but the web interface for vicidial definitely has a method to create a MOH definition. generally easiest to modify the default one. if you did set this up in the GUI, share your settings from that setup.

also handy is the knowledge that a WAV file in the wrong format will often cause confusion when the system goes looking for the GSM or other file. delete any files that are in the wrong format (or change their name to avoid conflict). also note that unless your call is in GSM, you should keep your MOH in WAV as that is closer to ulaw in format and requires less cpu to transcode. you can use sox to resample and keep it in WAV, but we usually upload from Audacity which does a pretty good job of saving in the proper format if requested.

Re: MOH File Format Issues

PostPosted: Wed Jan 15, 2014 2:38 pm
by ZeeTech
Creating MOH through web interface solved my problem. Thanks