[Asterisk-Users] Hangups after voicemail
Christian Hecimovic
checimovic at qworks.ca
Wed Sep 17 08:59:20 MST 2003
Hi Martin,
Yes, silence detection in voicemail is working. I am using Voicemail2 with the
silencethreshold set to 256. However, the line doesn't hang up after the
silence is detected; instead, Voicemail2 exits after recording the voicemail
correctly, and Asterisk loops back into the main menu as if the # key was
pressed because the channel is still alive. Then it times out after 15
seconds, as you can see below.
From extensions.conf:
[incoming]
exten => s,1,Answer
exten => s,2,DigitTimeout,5
exten => s,3,ResponseTimeout,10
exten => s,4,BackGround(corp_greeting)
include => locals
include => errors
The locals context consists of macros which look like this:
exten => s,1,Playback(transfer,skip)
exten => s,2,Dial(${ARG2},20)
exten => s,3,Voicemail2(u${ARG1})
exten => s,4,Goto(incoming,s,1)
exten => s,103,Voicemail2(b${ARG1})
exten => s,104,Goto(incoming,s,1)
So after a voicemail is left, there is a Goto back into the incoming context.
It all works great, except for when the line gets tied up by the DigitTimeout
and ResponseTimeout bits when hangups aren't detected.
I've tried using BUSYDETECT_MARTIN with busydetect=yes and it didn't work. The
channel stays up after the outside caller hangs up.
Since all of our inside phones are SIP lines, there is no problem detecting
hangups when a voice conversation is taking place, since Asterisk obviously
detects SIP hangups correctly whether it's SIP to SIP or SIP to outside line.
The problem is really only when outside callers leave voicemail.
Thanks,
Chris
On Wednesday 17 September 2003 08:09, Martin Pycko wrote:
> Do you have silence in the channel when the remote user hangs up or busy
> tone ?
>
> If you have silence you can use maxsilence=x_seconds in voicemail.conf
> with
> Voicemail2 application and that will make sure the calls are hanged up
> after x_seconds of silence in the channel.
>
> If you have busy tone then use the busydetect=yes in zapata.conf.
> You can also limit the length of the voicemail message with
> maxmessage=x_seconds in the voicemail.conf
>
> regards
> Martin
>
> On Tue, 16 Sep 2003, Christian Hecimovic wrote:
> > Hi,
> >
> > Try as I might, I can't get hangups detected on a Zap channel with loop
> > start lines. So, after someone leaves a voicemail and then hangs up,
> > Asterisk doesn't know it, exits VoicemailMain2, and loops back to the
> > corporate greeting, tying up the line even though the outside caller has
> > hung up.
> >
> > Therefore, I've added the following hideous hack - er, code - to
> > voicemail2.c. It starts right after the call to play_and_record() in
> > leave_voicemail().
> >
> > if (res != '#' && chan != NULL && !strncmp(chan->name, "Zap", 3)) {
> > /* Hang up the Zap channel only */
> > ast_softhangup(chan, AST_SOFTHANGUP_EXPLICIT);
> > }
> >
> > Obviously, it hangs up the channel after the voicemail has been recorded,
> > if the # key wasn't pressed, if the channel still exists, and if it's a
> > Zap channel. I couldn't see a way to do this with AGI.
> >
> > Question: is this safe? I used a soft hangup because the channel is
> > controlled by another thread. I also modified channel.c so that
> > ast_channel_free() sets chan to NULL after it's freed, just in case. Is
> > there anything else I should be aware of? The code seems to work in my
> > testing, resulting in a proper hangup right after the voicemail has been
> > recorded. I'm not up on my Asterisk internals, so I'm not totally
> > confident about this.
> >
> > Thanks,
> >
> > Chris
> >
> >
> > _______________________________________________
> > Asterisk-Users mailing list
> > Asterisk-Users at lists.digium.com
> > http://lists.digium.com/mailman/listinfo/asterisk-users
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
More information about the asterisk-users
mailing list