Asterisk not picking up my sound file.

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

Asterisk not picking up my sound file.

Postby PeterTaps » Sun Mar 06, 2011 7:37 pm

Folks,

I have been running an older version of Asterisk for the past three years. Never had to touch it.

Now, I am building a new Ubuntu box with the latest version of Asterisk.

In my extensions.conf, I have the following line:

exten => s,4,Background(MY/mainmenuannounce)

I also created a directory "MY" under /var/lib/asterisk/sounds and copied mainmenuannounce.gsm to that directory.

I also ensured that /var/lib/asterisk/sounds/MY and the file under it has asterisK:asterisk as the owner.

However, when I call in, I see that Asterisk is not able to locate my file:

file.c:650 ast_openstream_full: File MY/mainmenuannounce does on exist in any format
file.c:953 ast)streamfile; Unable to open MY/mainmenuannounce (format 0x4 (ulaw): No such file or directory

This setup is similar to what I had with my previous installation. I don't understand what has changed.

I would appreciate your help in identifying my problem.

Thank you in advance for your help.

Regards,
Peter

PS: Another interesting thing that I found is that asterisk plays vm-goodbye.gsm at the end. This file plays fine although
there is no such file under /var/lib/asterisk/sounds. Upon searching from the root, I found only one occurrence of vm-goodbye.gsm. This was under /usr/share/asterisk/sounds/en_US_f_Allison directory. Command "grep -i Allison /etc/asterisk/*conf" does not return any reference. Strange.
PeterTaps
Newsterisk
 
Posts: 25
Joined: Fri Jul 17, 2009 2:25 am

Re: Asterisk not picking up my sound file.

Postby mazzic » Mon Mar 07, 2011 3:11 pm

under sounds is languages directories. en = english, fr = french, es = spanish
put your MY under the en directory.

atleast this is what I do under 1.6.2. I haven't yet looked to see if the layout is different under 1.8.
-Mazzic
mazzic
Oldsterisk
 
Posts: 277
Joined: Wed May 05, 2010 8:55 am
Location: Waco, TX

Re: Asterisk not picking up my sound file.

Postby prod_user » Wed Mar 09, 2011 1:10 am

I'll tell something about vm-goodbye.

Playing of this file is hardwritten in source code. To get rid of it I had to modify sources (I've found it the only correct decision).
It's probably in app_voicemail.c source file (if you're interested).


p.s. We're using now asterisk 1.4.21.1)
prod_user
Newsterisk
 
Posts: 31
Joined: Sat Mar 05, 2011 5:28 am

Re: Asterisk not picking up my sound file.

Postby amobley118 » Thu Aug 04, 2011 11:53 am

I am having this same issue running Asterisk 1.6.2.7 on Ubuntu Server 10.04 LTS. When I looked in /var/lib/asterisk/sounds, the only thing that existed was an empty directory called custom. So I created the 'en' directory for english, downloaded the asterisk sounds from the downloads page on asterisk.org and added them to the en directory. Still no joy.

I am still getting...

Code: Select all
[Aug  4 13:27:24] WARNING[11537]: file.c:650 ast_openstream_full: File press-1 does not exist in any format
[Aug  4 13:27:24] WARNING[11537]: file.c:953 ast_streamfile: Unable to open press-1 (format 0x4 (ulaw)): No such file or directory
amobley118
Newsterisk
 
Posts: 24
Joined: Thu Aug 04, 2011 10:08 am

Re: Asterisk not picking up my sound file.

Postby david55 » Thu Aug 04, 2011 12:08 pm

Ubuntu users seem to have a lot of problems with the packages. Given that they seem to have been built non-root, are they actually maintained as part of Asterisk, or should you be getting support from Ubuntu? (Asterisk is not very comfortable running non-root and I think most technical users don't try.)

In terms of the search, maybe there is a symbolic link to the *Alison* directory?
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Asterisk not picking up my sound file.

Postby amobley118 » Thu Aug 04, 2011 1:50 pm

This seems like a fairly simple file location issue.

I have this code in my extensions.conf

Code: Select all
[demo-menu]
exten => s,1,Answer(500)
   same => n(loop),Background(press-1&or&press-2)
   same => n,WaitExten()

exten => 1,1,Playback(you-entered)
   same => n,SayNumber(1)
   same => n,Goto(s,loop)

exten => 2,1,Playback(you-entered)
   same => n,SayNumber(2)
   same => n,Goto(s,loop)


From my research, this file should be located in /var/lib/asterisk/sounds/en. The error, among others, is...

Code: Select all
WARNING[11537]: file.c:953 ast_streamfile: Unable to open [b]press-1[/b] (format 0x4 (ulaw)): No such file or directory


Now in /var/lib/asterisk/sounds/en, exists the following file...

-rw-r--r-- 1 asterisk asterisk 7360 2011-08-04 13:23 press-1.ulaw

So,in theory, this should work. However I am making two assumptions here.

1. Asterisk is trying to pull these files from /var/lib/asterisk/sounds/en as the user, asterisk.
2. Asterisk is trying to pull a file named press-1.ulaw

How can I confirm these two assumptions?
amobley118
Newsterisk
 
Posts: 24
Joined: Thu Aug 04, 2011 10:08 am

Re: Asterisk not picking up my sound file.

Postby mazzic » Thu Aug 04, 2011 6:10 pm

you could always code the full path to a sound file to make sure it can get there and play it...

exten => 1003,1,Answer
exten => 1003,n,Playback(/var/lib/asterisk/sounds/en/you-seem-impatient)
exten => 1003,n,Hangup


from the console a: core show settings might be helpful. It would show where a number of your directories are pointed to, in the event that they are not the defaults.

I haven't looked into the code yet for playback to see what it uses as its base directory, but I would suspect its the astvarlibdir setting.
-Mazzic
mazzic
Oldsterisk
 
Posts: 277
Joined: Wed May 05, 2010 8:55 am
Location: Waco, TX

Re: Asterisk not picking up my sound file.

Postby dejanst » Fri Aug 05, 2011 1:52 am

And check the user rights for the /var/lib/asterisk/sounds/en/. I think that Ubuntu package is made so the Asterisk is ran by a non-root user, so that user should have access to the sound files.
dejanst
Astmaster
 
Posts: 930
Joined: Tue Apr 27, 2010 7:14 am
Location: Ljubljana, Slovenia

Re: Asterisk not picking up my sound file.

Postby amobley118 » Fri Aug 05, 2011 7:34 am

mazzic wrote:you could always code the full path to a sound file to make sure it can get there and play it...

exten => 1003,1,Answer
exten => 1003,n,Playback(/var/lib/asterisk/sounds/en/you-seem-impatient)
exten => 1003,n,Hangup


Ok that helped. We are getting closer now. Here is what my extensions.conf looks like now...

Code: Select all
[demo-menu]
exten => s,1,Answer(500)
   same => n(loop),Background(/var/lib/asterisk/sounds/en/press-1&or&/var/lib/asterisk$
   same => n,WaitExten()

exten => 1,1,Playback(/var/lib/asterisk/sounds/en/you-entered)
   same => n,SayNumber(1)
   same => n,Goto(s,loop)

exten => 2,1,Playback(/var/lib/asterisk/sounds/en/you-entered)
   same => n,SayNumber(2)
   same => n,Goto(s,loop)


Here are the errors that I am seeing in CLI.

Code: Select all
== Using SIP RTP CoS mark 5
    -- Executing [3001@users:1] Goto("SIP/adam-00000007", "demo-menu,s,1") in new stack
    -- Goto (demo-menu,s,1)
    -- Executing [s@demo-menu:1] Answer("SIP/adam-00000007", "500") in new stack
    -- Executing [s@demo-menu:2] BackGround("SIP/adam-00000007", "/var/lib/asterisk/sounds/en/press-1&or&/var/lib/asterisk/sounds/en/press-2") in new stack
    -- <SIP/adam-00000007> Playing '/var/lib/asterisk/sounds/en/press-1.ulaw' (language 'en')
[Aug  5 09:19:47] WARNING[12040]: file.c:650 ast_openstream_full: File or does not exist in any format
[Aug  5 09:19:47] WARNING[12040]: file.c:953 ast_streamfile: Unable to open or (format 0x4 (ulaw)): No such file or directory
[Aug  5 09:19:47] WARNING[12040]: pbx.c:8860 pbx_builtin_background: ast_streamfile failed on SIP/adam-00000007 for /var/lib/asterisk/sounds/en/press-1&or&/var/lib/asterisk/sounds/en/press-2
    -- Executing [s@demo-menu:3] WaitExten("SIP/adam-00000007", "") in new stack
  == CDR updated on SIP/adam-00000007
    -- Executing [1@demo-menu:1] Playback("SIP/adam-00000007", "you-entered") in new stack
[Aug  5 09:19:54] WARNING[12040]: file.c:650 ast_openstream_full: File you-entered does not exist in any format
[Aug  5 09:19:54] WARNING[12040]: file.c:953 ast_streamfile: Unable to open you-entered (format 0x4 (ulaw)): No such file or directory
[Aug  5 09:19:54] WARNING[12040]: app_playback.c:471 playback_exec: ast_streamfile failed on SIP/adam-00000007 for you-entered
    -- Executing [1@demo-menu:2] SayNumber("SIP/adam-00000007", "1") in new stack
    -- <SIP/adam-00000007> Playing 'digits/1.gsm' (language 'en')
    -- Executing [1@demo-menu:3] Goto("SIP/adam-00000007", "s,loop") in new stack
    -- Goto (demo-menu,s,2)
    -- Executing [s@demo-menu:2] BackGround("SIP/adam-00000007", "/var/lib/asterisk/sounds/en/press-1&or&/var/lib/asterisk/sounds/en/press-2") in new stack
    -- <SIP/adam-00000007> Playing '/var/lib/asterisk/sounds/en/press-1.ulaw' (language 'en')
[Aug  5 09:19:55] WARNING[12040]: file.c:650 ast_openstream_full: File or does not exist in any format
[Aug  5 09:19:55] WARNING[12040]: file.c:953 ast_streamfile: Unable to open or (format 0x4 (ulaw)): No such file or directory
[Aug  5 09:19:55] WARNING[12040]: pbx.c:8860 pbx_builtin_background: ast_streamfile failed on SIP/adam-00000007 for /var/lib/asterisk/sounds/en/press-1&or&/var/lib/asterisk/sounds/en/press-2
    -- Executing [s@demo-menu:3] WaitExten("SIP/adam-00000007", "") in new stack
  == Spawn extension (demo-menu, s, 3) exited non-zero on 'SIP/adam-00000007'



The press-1 sound is playing. I am not sure why the rest of them are not playing. I am going to back double-check the file names but if you see anything else in here, let me know.
amobley118
Newsterisk
 
Posts: 24
Joined: Thu Aug 04, 2011 10:08 am

Re: Asterisk not picking up my sound file.

Postby mazzic » Fri Aug 05, 2011 9:31 am

in this case the error is caused because you didn't put the directory path on the "or" file.

Code: Select all
   same => n(loop),Background(/var/lib/asterisk/sounds/en/press-1&or&/var/lib/asterisk/sounds/en/press-2)


not the preferred solution you would need the path on all 3 files...
Code: Select all
   same => n(loop),Background(/var/lib/asterisk/sounds/en/press-1&/var/lib/asterisk/sounds/en/or&/var/lib/asterisk/sounds/en/press-2)


The Playback (and I would assume Background) application use the astdatadir variable for the base path to the sounds. Do you define this in your asterisk.conf file? if so were is it pointing to ? if its not defined try adding:

asterisk.conf
Code: Select all
astdatadir => /var/lib/asterisk


will probably need to restart asterisk to take effect. Then try your playback without the added path info.
-Mazzic
mazzic
Oldsterisk
 
Posts: 277
Joined: Wed May 05, 2010 8:55 am
Location: Waco, TX

Re: Asterisk not picking up my sound file.

Postby pverstraten » Tue Oct 14, 2014 5:23 am

For further reference:
Debian and Ubuntu packages create symlinks in /var/lib/asterisk/sounds as root. Chown them to your asterisk-user and everything is working, including foreign languages (if correctly installed)
pverstraten
Newsterisk
 
Posts: 2
Joined: Mon Sep 09, 2013 11:00 am


Return to Asterisk Support

Who is online

Users browsing this forum: MSN [Bot] and 1 guest