[Asterisk-Users] Voicemail2 unified messaging
David Carr
dac1 at drgutah.com
Wed Jul 30 09:43:58 MST 2003
We have built this in-house and it works well but we had to overcome some
challenges along the way. For example,
1) Your voicemail server may be off-net (behind NAT or using private ip
addresses) while your email users are on-net. The way we approached this was
to abstract the functionality such that an always on-net script accepts the
request and then calls a cgi on the off-net server.
2) The link in email needs VM_CONTEXT because that's the directory the
voicemail is stored in. The current source code doesn't pass this into the
sendmail function so we added this for ourselves but didn't request it added
to cvs because we weren't sure it would be valuable for others.
3) The email link also needs a unique voicemail ID so it knows which one to
delete. However, in the current voicemail implementation there is no such
thing. MsgID certainly isn't it because as soon as you delete msg0000 then
the messages get reordered and msg0001 becomes msg0000, et cetera. So if you
delete msg0000 and then reorder three times in a row, you are literally
deleting three distinct messages. The best we've found - which isn't really
all that good - is a variable in msgXXXX.txt called origtime. We hacked
voicemail.c to pass this variable to the sendmail function too.
So our implementation goes something like this...
in voicemail.conf we have
emailbody=Dear ${VM_NAME},\n\nYou were just left a ${VM_DUR} long message
(number ${VM_MSGNUM}) in mailbox ${VM_MAILBOX} from ${VM_CALLERID}, on
${VM_DATE}. You can listen to the message by clicking on the attached
file.\n\nOnce you listen to the attached sound file, you may optionally
delete the message from your voicemail box on the phone system by clicking
here:\n\nTO DELETE:
http://www.abc.com/login/rmvm.html?mailbox=${VM_MAILBOX}&origtime=${VM_START
}&context=${VM_CONTEXT}.
As this is a password-protected page within our intranet, we now do a
database query to ensure that the person currently logged in actually owns
the mailbox passed in by the link. This protects us from one user hacking
the http get string to delete someone else's email.
At this point our rmvm.html script executes a DeleteVoicemail script (via
ssh) on our off-net asterisk server. The Delete Voicemail script greps
directory /var/lib/asterisk/sounds/voicemail/VM_CONTEXT/VM_MAILBOX for
VM_START (origtime) and finds the MsgID to delete (let's say msg0001). Then
it does an rm on msg0001.* and finally reorders all of the messages so
msg0002.* becomes msg0001.*, msg0003.* becomes msg0002.*, et cetera.
This system is pretty convoluted but works great for us. It's fun to see our
vm indicator light come on, get an email, click on a link in the email body,
and then watch the vm indicator light go off without ever calling into
voicemail. I just don't think a universal solution is going to help much
unless everybody puts their asterisk servers on-net and you don't want
things like intranet user authentication.
> -----Original Message-----
> From: asterisk-users-admin at lists.digium.com
> [mailto:asterisk-users-admin at lists.digium.com]On Behalf Of Todd
> Lieberman
> Sent: Wednesday, July 30, 2003 10:09 AM
> To: asterisk-users at lists.digium.com
> Subject: RE: [Asterisk-Users] VoiceMail2 Wish List
>
>
> Will there be a way to delete messages from email. I love
> getting voicemail
> in wav to my email, but I hate having to delete them when I call in to get
> my messages. If we could add a link and have a cgi delete the
> messages that
> would be a nice time saver. TL
>
> -----Original Message-----
> From: asterisk-users-admin at lists.digium.com
> [mailto:asterisk-users-admin at lists.digium.com]On Behalf Of Brad Bergman
> Sent: Wednesday, July 30, 2003 4:18 AM
> To: asterisk-users at lists.digium.com
> Subject: Re: [Asterisk-Users] VoiceMail2 Wish List
>
>
> On July 29, 2003 01:57 am, Roy Sigurd Karlsbakk wrote:
> > > Ah, now that you mention it, I implemented this in my patch also and
> then
> > > forgot about it: messages that are too short (less than 3 seconds) or
> all
> > > silence
> >
> > Perhaps this should be configurable?
>
> Yeah, I suppose it should. I added minlength (in seconds) and removesilent
> (yes/no) as [general] options, with 3 and yes as defaults, respectively.
>
> Brad
> _______________________________________________
> 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