Daniel Hazelbaker
2008-Jun-30 17:24 UTC
[asterisk-users] Voicemail- Recorded Mesage Low Volume
> Hi Daniel, > > I'm intrigued by this and wanted to try it out - but I'm wondering how > you get Asterisk to call sox at all during Voicemail()? Our server > doesn't even have sox installed, so I'm not sure how to go about > tricking Asterisk into running a different one.To do anything useful you would have to get sox installed on your server. But to get asterisk to run a different/fake sox, just install whatever you want to run as /usr/local/bin/sox and then edit your safe_asterisk script as I mentioned below. Asterisk runs the program 'sox' using the first match in your $PATH, so by updating the $PATH before asterisk runs you can direct it to run a different sox program. Be aware that this could pose a security issue as some systems allow regular users to modify /usr/local/bin. So people could install other programs that asterisk runs into that directory as well to get elevated privileges. For me it is not a concern as the machine is used only for Asterisk and only accessed by our IT department. Daniel> CP > > Daniel Hazelbaker wrote: >> On Apr 1, 2008, at 5:22 PM, asterisk-users-request at lists.digium.com >> wrote: >> >>> Can the volume of the recorded voice mail message be changed? If >>> so, what I am doing wrong? Any input would be greatly appreciated. >>> Thanks. >> >> I had a similar problem in our setup where we e-mail the recorded >> messages to e-mail retrieval. But this also helps standard phone >> retrieval too. What I did was edit the /usr/sbin/safe_asterisk >> script >> and add: >> >> PATH="/usr/local/bin:$PATH" >> >> At the top of the script. This would let me override the default sox >> implementation that Asterisk uses. Then I loaded in a script (called >> sox) that would compress and normalize the recorded audio (It >> compresses to deal with the spikes of the noise of the handset being >> hung up, etc.). It works pretty well for us and makes the volume >> pretty good so we don't have to crank up the volume on our computers >> or phones to listen to voicemail messages. And we can't adjust the >> rxgain as it is already a good volume for normal calls. >> >> Daniel >> >> --CUT-- >> #!/bin/sh >> # >> # $1 = -v >> # $2 = number >> # $3 = inFile >> # $4 = outFile >> # >> REALSOX="/usr/bin/sox" >> >> if [ "$1" != "-v" ]; then >> $REALSOX $* >> exit $? >> fi >> >> INFILE="$3" >> OUTFILE="$4" >> >> # >> # Perform the gain adjustment. >> # >> $REALSOX "$INFILE" "$OUTFILE" compand 0.1,0.3 >> -60,-60,-30,-15,-20,-12,-4,-8,-2,-7 0 0 0.2 >> --CUT-- >> >> >> _______________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080630/58a4b9c9/attachment.htm
Steve Edwards
2008-Jun-30 18:32 UTC
[asterisk-users] Voicemail- Recorded Mesage Low Volume
On Mon, 30 Jun 2008, Daniel Hazelbaker wrote:>> I'm intrigued by this and wanted to try it out - but I'm wondering how >> you get Asterisk to call sox at all during Voicemail()? Our server >> doesn't even have sox installed, so I'm not sure how to go about >> tricking Asterisk into running a different one.> To do anything useful you would have to get sox installed on your > server.If you are using RedHat or CentOS, installing sox should be as simple as: sudo yum install sox Other distros have similar commands.> But to get asterisk to run a different/fake sox, just install whatever > you want to run as /usr/local/bin/sox and then edit your safe_asterisk > script as I mentioned below.I think this is a bad approach. It's going to be a big "gotcha" down the road for somebody :)> Asterisk runs the program 'sox' using the first match in your $PATH, so > by updating the $PATH before asterisk runs you can direct it to run a > different sox program.A quick grep through the Asterisk (1.2.28) sources shows res_monitor using soxmix if the channel variable MONITOR_EXEC is not defined -- but nothing in app_voicemail. Am I missing something? Thanks in advance, ------------------------------------------------------------------------ Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
Tzafrir Cohen
2008-Jun-30 18:55 UTC
[asterisk-users] Voicemail- Recorded Mesage Low Volume
On Mon, Jun 30, 2008 at 11:32:58AM -0700, Steve Edwards wrote:> > To do anything useful you would have to get sox installed on your > > server. > > If you are using RedHat or CentOS, installing sox should be as simple as: > > sudo yum install sox > > Other distros have similar commands.One gotcha with Debian Lenny: libsox-dev - Development files for the SoX library libsox-fmt-all - All SoX format libraries libsox-fmt-alsa - SoX alsa format I/O library libsox-fmt-ao - SoX Libao format I/O library libsox-fmt-base - Minimal set of SoX format libraries libsox-fmt-ffmpeg - SoX ffmpeg format library libsox-fmt-flac - SoX FLAC format library libsox-fmt-gsm - SoX GSM format library libsox-fmt-mp3 - SoX MP3 format library libsox-fmt-ogg - SoX OGG Vorbis format library libsox-fmt-oss - SoX OSS format I/O library libsox-fmt-sndfile - SoX libsndfile format library libsox0 - SoX library sox - Swiss army knife of sound processing Installing "sox" does not automatically install support for all the formats. To install support for all the output formats, install libsox-fmt-all as well, or just the specific libsox-fmt packages you need. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
Well, that was sorta my point..... CP Steve Edwards wrote:> A quick grep through the Asterisk (1.2.28) sources shows res_monitor using > soxmix if the channel variable MONITOR_EXEC is not defined -- but nothing > in app_voicemail. Am I missing something? >
Daniel Hazelbaker
2008-Jun-30 23:20 UTC
[asterisk-users] Voicemail- Recorded Mesage Low Volume
On Jun 30, 2008, at 1:04 PM, asterisk-users-request at lists.digium.com wrote:>> But to get asterisk to run a different/fake sox, just install >> whatever >> you want to run as /usr/local/bin/sox and then edit your >> safe_asterisk >> script as I mentioned below. > > I think this is a bad approach. It's going to be a big "gotcha" down > the > road for somebody :)Agreed. :) It would be nice if there was something similar to externnotify that was not just a notification but a pipe that you could modify/filter etc the audio file before it continues on its merry way.>> Asterisk runs the program 'sox' using the first match in your >> $PATH, so >> by updating the $PATH before asterisk runs you can direct it to run a >> different sox program. > > A quick grep through the Asterisk (1.2.28) sources shows res_monitor > using > soxmix if the channel variable MONITOR_EXEC is not defined -- but > nothing > in app_voicemail. Am I missing something?It is possible this is a 1.4.x feature, and specifically it is for the e-mail sending system which as I am thinking about it is a 1.4 feature. I don't use 1.2.x and never have, I started with 1.4. The other option, again I don't know if this is available in 1.2, is to use the externnotify option. When a voicemail is left this script/ program is called with the context, extension and number of new voicemail messages. With a little bit of shell scripting you could walk the list of all messages and process any left (modified) within the last 20 seconds via sox. It is a little more iffy and prone to race conditions, but it should work. Unfortunately I couldn't give you a specific example of doing it this way as I use the e-mail style. Daniel> > Thanks in advance, > ------------------------------------------------------------------------ > Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 > PST-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080630/97c83637/attachment.htm