(If you don't care about how I got there and limitations, and just
want to see some dialplan, scroll down to the *** section and click on
the pastebin link; expires in 2 days)

On 10/4/07, Simon P. Ditner <[EMAIL PROTECTED]> wrote:
> PLASE NOTE: Renovations are complete; we're back at our usual North York
> location!
>
> Topic:
>
> The voicemail application in Asterisk is one of the oldest of the
> dialplan applications. It is often critisized as one of the
> less-than-compelling parts of Asterisk, and, because it's functionality
> is locked up in a very complex, messy and poorly-documented bit of code
> (app_voicemail.c), no one has the nerve to touch it.
>
> Jim Van Meggelen believes there is a way to fix app_voicemail, and the
> way to do it is to completely get rid of it. Rather than treat voicemail
> as a closed application, and try and design an app that handles every
> possible thing that anyone might want to use it for, it makes more sense
> to see voicemail as a complex (very complex, in fact) IVR application,
> and break it down into dialplan components that can be delivered through
> dialplan logic.
>
> This is easy to say; not so easy to do. Replacing app_voicemail with
> dialplan code is going to require a lot of code, and there are several
> dialplan apps that will need to be created or modified in order to allow
> this to happen.
>
> This session will introduce TAUGs first community development project:
> Voicemail TNG. Everyone is more than welcome, but this session will be
> geared towards people with a solid knowledge of asterisk architecture, so
> bring your thinking cap.

Jim and I have been discussing this project for over a year! (This was
going to be *THE* reason you would by the Asterisk Cookbook.) After
hearing Jim at TAUG speak about this, and the reaction from the
community (overwhelmingly positive), I decided to start playing with
the idea. I've got some simple GoSub() routines built, and have a
simple Voicemail() application replacement.

I seriously got 3 lines into this when I hit a roadblock. In 1.4 (but
not in trunk -- the developers really do fix things), you can't use \n
(newline) as a parsing character. This has been opened in bug
http://bugs.digium.com/view.php?id=10903 where I've been having a
discussion about this being considered a bug and not a feature. I'm
waiting on a ruling from Russell (the maintainer of 1.4).

The limitation of CUT() not accepting \n in 1.4 was a major factor to
not being able to parse the data from the msg0000.txt file (I call it
the envelope). This didn't end up being necessary for the Voicemail()
implementation, but is absolutely required for the VoicemailMain()
implementation. Luckily, I've developed a work around which works
surprisingly well! Check out bug 10903 on the tracker for a comment I
posted with the work around.

So now I can parse text files, one line at a time. Great! That means I
can start working on VoicemailMain() today.

I've got a request in with Simon for an SVN account, but it's the
weekend, so I don't expect to have anything back from him until Monday
(and I don't really have any expectations as to when Simon will get
around to it, since it's volunteer :)).

However, I'd love to get some opinions about my approach thus far. I'm
putting in some comments where necessary, and will go back through and
document when I'm more satisfied with the Voicemail() application (for
example, you can't save to multiple mailboxes, and not all dialplan
options work; on that note, I'll probably skip the 'j' option since
you shouldn't be using n+101!!! -- but if someone needs it, I'll try
and work something out).

There is a limitation to Record() that if someone hangs up, then the
recording is lost, but Qwell on IRC gave me an idea I'm going to play
with today.

*** OK, so without further ado: http://www.pastebin.ca/727936

The post will expire in 2 days, because by that time there should be
something in SVN, and that post will be awfully out of date since I
plan on hacking on it some more today.

Comments, questions, concerns, and constructive criticism are encouraged!

-- 
Leif Madsen.
http://www.leifmadsen.com
http://www.oreilly.com/catalog/asterisk

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to