xishuiye / asterisk-voicemail-for-iphone

Automatically exported from code.google.com/p/asterisk-voicemail-for-iphone
0 stars 0 forks source link

Empty mp3 being created #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. select play message
2.
3.

What is the expected output? What do you see instead?

I should be able to hear the voicemail, but instead I get an empty mp3 file
(0 bytes)

What version of the product are you using? On what operating system?

Version 0.13 on RHEL 5.3

Please provide any additional information below.

I don't think this is a Lame issue because I run the following to create
the mp3 it works.

lame --resample 11.025
/var/spool/asterisk/voicemail/default/216/INBOX/msg0000.wav
/var/spool/asterisk/voicemail/default/216/INBOX/msg0000.mp3

But when I try any other messages it just creates the empty file as shown
from the debug:

2009-06-12 11:37:35 - listen.php - Calling doSendFileWithResume
/var/spool/asterisk/voicemail/default/216/INBOX/msg0001.mp3
2009-06-12 11:37:35 - HTTP_RANGE 
2009-06-12 11:37:35 - HTTP/1.1 200 OK
2009-06-12 11:37:35 - Content-Range: bytes 0--1/0
2009-06-12 11:37:35 - Content-Length: 0
2009-06-12 11:37:35 - how_many_bytes_to_send: 0
2009-06-12 11:37:35 - Sending bits from 0 to 0
2009-06-12 11:37:35 - Sent Byte Count: 0

While testing I also noticed that if I listen to a voicemail from our
asterisk servers web page before I try and listen to it using
asterisk-voicemail-for-iphone it will not create the mp3 file at all, not
even an empty one. 

Only change to the default files form version 0.13 that I have made is from
comments 5 & 7 in issue 15. Otherwise it would fail with a "listen.php -
FAILED SECURITY TEST!" error. 

http://code.google.com/p/asterisk-voicemail-for-iphone/issues/detail?id=15#c5

Michael

Original issue reported on code.google.com by michael.biven on 12 Jun 2009 at 7:46

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Figured it out. If you have the format set to wav49 vs raw wav, the section in
i_functions.php doesn't see the actual voicemail file. This is due to wav49 
having an
extension of .WAV vs .wav.

You can either tell the system to save the files as regular .wav or change the 
line
where lame is called (line # 401) in i_functions.php to look for .WAV. I have 
tested
both and both seem to work.

You can change the voicemail format in voicemail.conf under "format =". See 
below for
more clarification from the voip-info wiki entry.
Hope this helps someone

KSM

voicemail.conf

format

The format setting selects audio file format(s) to use when storing voice mail
messages. The value is a string defining the audio format(s) of the message 
file. The
default format string is wav49|gsm|wav, meaning that Asterisk will save the 
voicemail
message in all three supported formats. When emailing the attachment, however, 
it
will send only the first of the formats defined here. When playing back (as 
with all
file playback) Asterisk will attempt to use the optimum format based on the 
codec
used for the current channel, in order to provide the best sound quality and to
reduce transcoding processing time.

    * wav49: In this format, the file size will be small, the quality good, and it's
a good choice for sending voicemail messages in email. The file will have a .WAV
extension, which all Windows users should have no problems with, and users on 
other
platforms should also be able to easily play these sound files.
    * gsm: Voicemail saved in this format will have about the same file size and same
audio quality as wav49. It may be less well supported by client operating 
systems if
sent to users in email, however.
    * wav: This is an uncompressed sound format with a .wav extension, so the file
size is very large. Sound quality will be great, but you probably don't want to 
email
it, and you must have adequate disk space.
    * g723sf: The sample voicemail.conf file has this option commented out. If you
try to activate it, you will find that it doesn't work. 

If you're running Asterisk on Mac OS X, which has a case-preserving but
case-insensitive file system, you can use .wav but you won't be able to use
.WAV(wav49). Asterisk tries to pick the best file in the Playback command based 
on
the encoding of your channel, and then looks for the file by file type in a 
specific
order. In either case, asterisk will look for filename.wav, and if there is a
filename.WAV, the file lookup will succeed. Asterisk will then try to play the 
file
as "wav", and choke on the format. This is especially noticeable in voicemail. 
If you
have both wav49 and wav in the format= option, one will replace the other. You 
must
remove wav49 from the format= option in voicemail.conf.
maxgreet 

Original comment by kenneth....@gmail.com on 16 Jul 2009 at 9:59

GoogleCodeExporter commented 8 years ago
I had the same problem for a different reason.
Apache’s $PATH is set [/usr/bin:/bin:/usr/sbin:/sbin] on my machine (a MacOSX 
box).
My Lame was installed using MacPorts, so it was not being found.
The solution was to soft link :
$ sudo ln -s /opt/local/bin/lame /usr/bin/lame

Original comment by jerm.qu...@gmail.com on 23 Oct 2009 at 9:17

GoogleCodeExporter commented 8 years ago
In my case I solve it after looking at the apache log
apache lame: command not found

You need to add the path to lame

Edit  i_functions.php
from
$cmd = "lame --resample                     ...............
to
$cmd = "/usr/local/bin/lame --resample

Original comment by gvarga...@gmail.com on 26 Jan 2011 at 2:09