G. Paul Ziemba
2014-Feb-05 17:09 UTC
[asterisk-users] answering machine screening with MixMonitor
I'm using asterisk 1.8 as an answering machine. I'd like to hear the calls it answers aloud in case I want to pick up and interrupt the call. There are a few articles describing, for example, three-way calling a monitor phone set to auto-answer, but I couldn't find anything that described how to just send the audio to a local speaker. I am currently using MixMonitor to append the audio to a named pipe ("mkfifo /home/asterisk/var/soundpipe.au"), as follows (extensions.conf): [from-pstn] exten => s,1,Wait(20) exten => s,2,Answer exten => s,3,Wait(1) exten => s,4,Set(TIMEOUT(response)=10) exten => s,5,MixMonitor(/home/asterisk/var/soundpipe.au,av(2)) exten => s,6,Background(/home/asterisk/sounds/main) I wrote a small script to loop opening the named pipe and then copying to "/usr/bin/play" from the sox package. MixMonitor uses the filename extension to determine what format to use for the audio data. I tried all of the formats common to both asterisk ("core show file formats") and play (as described on the man page), except for "raw". I'm not sure if "raw" is compatible with sox "play" - I need to determine bit rates and other parameters before I can try it. I found that in all cases I tested, there was significant latency between the audio on the PSTN line vs. the audio played from the speakers, on the order of 3-10 seconds depending on the format specified. Based on some debug output from my pipe-reader script, it seemed that asterisk opened the write end of the pipe immediately but did not start writing data until the aforementioned delay had passed. "au" and "sln" had the lowest latency (3 seconds), so I'm using "au" for now. Is there any way to reduce the startup latency and make MixMonitor write the audio stream to the output file immediately? I looked briefly at apps/app_mixmonitor.c and main/file.c but I don't fully understand the code. Is mixmonitor forking an external conversion process to generate the audio data? thanks for any insights! -- G. Paul Ziemba FreeBSD unix: 9:06AM up 10 days, 11:05, 4 users, load averages: 1.39, 1.50, 1.54
Chad Wallace
2014-Feb-05 18:56 UTC
[asterisk-users] answering machine screening with MixMonitor
On Wed, 5 Feb 2014 17:09:34 +0000 (UTC) "G. Paul Ziemba" <pz-asterisk-users at ziemba.us> wrote:> I'm using asterisk 1.8 as an answering machine. I'd like to > hear the calls it answers aloud in case I want to pick up and > interrupt the call. > > There are a few articles describing, for example, three-way > calling a monitor phone set to auto-answer, but I couldn't > find anything that described how to just send the audio to > a local speaker.Have you considered using chan_alsa or chan_oss? I don't know much about it, but I've heard that you can use the sound card in the computer as a phone. If you only want to listen, you wouldn't need a microphone. -- C. Chad Wallace, B.Sc. The Lodging Company http://www.lodgingcompany.com/ OpenPGP Public Key ID: 0x262208A0
James Sharp
2014-Feb-05 18:56 UTC
[asterisk-users] answering machine screening with MixMonitor
On 2/5/2014 12:09 PM, G. Paul Ziemba wrote:> I'm using asterisk 1.8 as an answering machine. I'd like to > hear the calls it answers aloud in case I want to pick up and > interrupt the call. > > There are a few articles describing, for example, three-way > calling a monitor phone set to auto-answer, but I couldn't > find anything that described how to just send the audio to > a local speaker.A local speaker connected to the Asterisk box itself? Console channel driver, chan_alsa (or chan_oss for old drivers). You'll probably end up with kind of a Rube Goldbergish approach, probably something involving ChanSpy or a conferencebridge to take the place of mixmonitor.
Seemingly Similar Threads
- Asterisk 13.4.0 - mixmonitor only records one side's perspective
- [asterisk-dev] MixMonitor doesn't work right with SIP and Zap/Flash transfers
- [Asterisk 1.8.3.2] Mixmonitor not working on member(calling part) channel of Queue.
- MixMonitor Problems -- sssshh, don't be too loud
- MixMonitor + Originate