If you search the archives, you'll see other postings on this problem.
Here's
what I did:
Add the following to voicemail.conf:
maxsilence=10
silencethreshold=256
The higher the silencethreshold, the less sensitive the silence detection
stuff is. You may have to fiddle with this value a bit. When the voicemail
app detects silence, it stops recording and rewinds itself to erase the
silence.
So now the voicemails record correctly, with no silence at the end. However,
the line is still tied up because the Zap channel has not detected the hangup
at the other end.
To force a hangup after leaving a voicemail, I added the following to
app_voicemail.c in leave_voicemail(), right after the call to
play_and_record():
if (res != '#' && chan != NULL &&
!strncmp(chan->name, "Zap", 3)) {
/* Hang up the Zap channel only */
free_user(vmu);
ast_softhangup(chan, AST_SOFTHANGUP_EXPLICIT);
}
This is a despicable hack, but it does the job. Basically, if the user
hasn't
pressed #, the channel is up, and the channel is a Zap channel, then hang up
after the voicemail has been recorded.
Hopefully this helps.
Christian
On Wednesday 24 September 2003 18:15, Ben Bloomberg
wrote:> I'm running the a very recent CVS version of asterisk on an RH9
> machine. My problem is that my x100p takes about 10 seconds to detect a
> hangup. After that it takes about 10 more seconds for the the zaptel
> device to release the line. Here's an example of my console report:
>
> == Parsing
> '/var/spool/asterisk/voicemail/default/101/INBOX/msg0000.txt':
=> Parsing
'/var/spool/asterisk/voicemail/default/101/INBOX/msg0000.txt':
> Found
> -- Playing '/var/lib/asterisk/sounds/vm-received'
> -- Playing '/var/lib/asterisk/sounds/digits/at'
> -- Playing '/var/lib/asterisk/sounds/digits/8'
> -- Playing '/var/lib/asterisk/sounds/digits/40'
> -- Playing '/var/lib/asterisk/sounds/digits/7'
> -- Playing '/var/lib/asterisk/sounds/digits/p-m'
> -- Playing
'/var/spool/asterisk/voicemail/default/101/INBOX/msg0000'
> -- Playing 'vm-repeat'
> -- Playing 'vm-next'
> -- Playing 'vm-deleted' <<== I hungup here
> -- Playing 'vm-repeat'
> -- Playing 'vm-next'
> -- Playing 'vm-undelete'
> -- Playing 'vm-toforward'
> -- Playing 'vm-savemessage'
> == Spawn extension (default, 105, 1) exited non-zero on
'Zap/1-1'
> -- Hungup 'Zap/1-1'
> asterisk*CLI>
> =========================> Here's an expample of when someone leaves
a message:
>
> == CDR updated on Zap/1-1
> -- Executing VoiceMail2("Zap/1-1", "u101") in new
stack
> -- Playing 'voicemail/default/101/unavail'
> -- Playing 'beep'
> -- x=0, open writing:
> /var/spool/asterisk/voicemail/default/101/INBOX/msg0001 format: wav,
> 0x80c72e0
> -- x=1, open writing:
> /var/spool/asterisk/voicemail/default/101/INBOX/msg0001 format: gsm,
> 0x80c77a8
> (about a ten second delay after actual hangup)
> -- User hung up
> (another ten second delay)
> == Spawn extension (vmmenu, 2, 1) exited non-zero on 'Zap/1-1'
> -- Hungup 'Zap/1-1'
>
>
> As a result I get about 10 seconds of silence on the end of every
> voicemail message, and because my machine has a fairly small hd, this
> can become a problem very quickly. I was wondering if anyone else had
> this problem or a good fix.
>
> Thanks,
> -Ben
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users