[Asterisk-Dev] Pulling a call out of voicemail, and monitoring voicemail entry

Thomas Horsten thomas at horsten.com
Mon Sep 20 02:19:28 MST 2004


Hi,

I am new to the list, and fairly new (1 week) with Asterisk, so please
excuse me if I am stating something stupid :-)

I'm using Asterisk as a home PBX with a Sipura SPA-3000 adapter for my
PSTN and analog phones.

I had an idea that I posted on the voxilla.com forum, basically I want to
use Asterisk's voicemail system instead of our answering machine, but I
have an issue with WAF (Wife Acceptance Factor) that I need to resolve
before I can do it:

When our old-fashioned answering machine takes a call you can hear the
caller in the other end and if you pick up the handset, the answering
machine stops.

This has 2 purposes:

1) If you are running around to find the cordless phone it gives you some
extra time after the answering machine kicks in.

2) You can hear who is calling and if it's someone important you can pick
it up even if you weren't bothered otherwise.

I would like to emulate this functionality with *, by making it possible
to monitor a call over the soundcard of the * box (with a suitable speaker
attached), and to "grab" the call from another extension by dialing a
code.

What I envision to do is something like this:

; My master extension
exten => 100,1,Dial(SIP/101&SIP/102,120)
; Is there something like this:?
exten => 100,2,SetGlobalVar(CallInVoicemail=${UNIQUE_CHANNEL_ID})
exten => 100,3,MonitorCustom("/usr/bin/mymixerscript")
exten => 100,4,VoiceMail(u100)

; Code for grabbing call in voicemail
exten => 199,1,GrabChannel(${CALLINVOICEMAIL})
exten => 199,102,Playback(custom/no-call-in-voicemail)

So I'd need two "new" commands (correct me if I'm wrong):

MonitorCustom - Like Monitor, but will pass to the program two file
descriptors or unix sockets with the raw audio of the two sides of the
call. A small standalone app would then mix the channels and play them via
/dev/dsp or something.

GrabChannel - Would behave a bit like Dial, but instead connect the caller
to an existing call in the system by it's ID. Whatever application was
currently using the call would get signalled that the user has hung up.

I don't know if this is possible and I would like some feedback from you
devs about how/if you think this could be implemented.

Since I'm new I haven't looked much at * source code yet, and I don't know
if what I'm suggesting is even possible.

Any suggestions and help appreciated.

Regards,

Thomas Horsten




More information about the asterisk-dev mailing list