The voicemail 4 example

This example extends the voicemail_3 example by giving the additional option of deleting each message after playing it.

It also adds the option to record a welcome message to be played after the call is answered.

For this sample it is important that you also read the section about media files which describes some of the effects of Eventual Consistency.

Summary

An inbound application that answers the call and says a welcome message. The welcome message defaults to “Welcome to the voicemail server for <name>” but can be changed. <name> is obtained from the application_parameters and must be registered on the inbound services page of the CWP.

The application uses <name> to determine whether the caller owns the voicemail box. It does this by comparing <name> with the <call_from> property of the inbound call.

If the caller owns the voicemail box, the top level options given are:

  1. Play all existing messages with the option to delete each one individually
  2. Delete all existing messages
  3. Record a new welcome message

If the caller does not own the voicemail box, he can leave a new message. The name of the .wav file to save to will be “samples/voicemail3/<name>/msg<counter>.wav”. The <counter> is a variable, initialised to 1, which increments each time a message is successfully saved.

View the source code here:

Table Of Contents

Previous topic

The voicemail 3 example

Next topic

The outbound reminder example