A sample voice message application

The sample called VoiceMessagingSample is a voice application that includes messaging. The sample called RecordAudionameSample allows you to record the name of the owner of a mailbox for a voice application to speak to a caller (an audio name).

To use these samples, you must:

  1. Import the VoiceMessagingSample.imp and RecordAudionameSample.imp files. The import file is located in the /usr/lpp/dirTalk/sw/samples directory.
  2. Create an application profile for it (see Creating an application profile).
  3. Create the mailboxes for which you plan to record the audio names (see Creating mailboxes for application use).
  4. Use RecordAudionameSample to record some audio names.

RecordAudionameSample

RecordAudionameSample enables you to record an audio name for an application profile mailbox.

Note: This sample includes a state table and a prompt that are both named RecordAudioName. This is a reserved word in the ASCII state table language, so if you export these files for use as the basis for a new application, you must rename them.

VoiceMessagingSample

VoiceMessagingSample is an example of a messaging application that allows callers to:

The flow of control in VoiceMessagingSample is illustrated in Figures Figure 1 through Figure 3. The application is modular, with the state table VoiceMsgMenu as the main controlling loop that calls the other state tables according to the caller’s input.

Figure 1. VoiceMsgMenu and VoiceMsgAnswer
The graphic includes flow charts of VoiceMsgMenu and VoiceMsgAnswer. VoiceMsgMenu progresses through Answer the call; Get the profile ID; Get the password; and Home state. Home state includes five choices according to selected keypad numbers, as follows: Press 1 to Record a message (this invokes state table VoiceMsgRecord);Press 2 to Listen to your messages (this invokes state table VoiceMsgListen); Press 3 for Personal options (this invokes state table VoiceMsgOptions); Press 9 for Help; Press 0 to Exit.VoiceMsgAnswer progresses through Answer the call; Play the greeting; Invoke VoiceMsgRecord; Exit.
Figure 2. VoiceMsgRecord and VoiceMsgListen
The graphic includes flow charts of VoiceMsgRecord and VoiceMsgListen. VoiceMsgRecord progresses through Record the message; Annotate the message: options under this action are by selecting keypad numbers, as follows: Press 1 to Append, Press 2 to Prefix, Press 3 to Re-record, Press 5 to Send, Press 7 to Listen; Special delivery: keypad options under this action are: Press 1 for Acknowledgement, Press 2 for Future delivery, Press 5 for Send; Destination: keypad options under this action are: Press 1 To single recipient, Press 2 To distribution list; Send (there are no keypad options under this action); Resend: keypad options under this action are: Press 1 to Send again (this option flows back to before Annotate the message), Press 2 for Finished.VoiceMsgListen progresses through Listen; Summary; Message type: keypad options under this action are: Press 1 for New, Press 2 for Saved, Press 3 for Outgoing; Play the message (there are no keypad options for this action); Message options: keypad options under this action are: Press 1 to Reply (this option invokes Voice MsgRecord), Press 2 for Next message, Press 3 for Save, Press 5 to Delete, Press 7 to Listen, Press 9 to Forward (this option invokes VoiceMsgRecord); Check next message (there are no keypad options for this action;this action flows back to Play the message).
Figure 3. VoiceMsgOptions
The graphic shows a flow chart of the state table, VoiceMsgOptions. The options shown are:Choose a personThis has the following keypad selection sub-options: Press 1 for Greeting (which launches the Greeting option, Press 3 for Password, Press 5 for Distribution lists (which launches the Distribution lists option) Distribution listsThis has the following keypad selection sub-options: Press 1 to Modify distribution list (which launches the Modify distribution list), Press 2 to Review distribution list, Press 6 to Delete distribution list.Modify distribution listThis has the following keypad selection sub-options: Press 1 to Add recipient, Press 2 to Review recipient, Press 6 to Delete recipientGreetingThis has the following keypad selection sub-options: Press 1 to Record new greeting, Press 2 to Listen to current greeting, Press 6 to Select standard greeting.

An example state table

Figure 4 shows an example of the listing you get when you print a state table from Blueworx Voice Response. For each state, the listing has three sections:

  1. The optional state State Label, the Action, and an optional Description.

    In Figure 4, the first state in the table is labeled summary, its action is a PlayPrompt, and its description is Play summary of messages prompt. The second state is unlabeled, it is also a PlayPrompt, and its description is Play message type selection prompt.

  2. TRANSITIONS

    This section tells you the possible results that can be returned by the action, with the label of the state specified as the Goto State (the next state for that result). A blank in the Goto State column indicates that the state that follows this one will be the next state for that result.

    For example, the first action (summary) has four possible results:

    • If the action succeeds, the state table proceeds with the state that follows this one.
    • If there is a line problem, the next state is the state labeled error.
    • If nothing is played, the next state is the state labeled error.
    • If the caller hangs up, the next state is the state labeled end.
  3. PARAMETER VALUES

    This section lists the parameters and the values set for them. In the first action (summary), the Prompt parameter specifies the name of the prompt (in this case, the Summary prompt) and the Force Play parameter, which is set to False, specifies that the prompt can be interrupted by the caller.

    Figure 4. Example listing of the first two states in a state table
           State Table - VoiceMsgListen
           Voice Messaging Sample - "Listen"
     
    State Label       Action                 Description
    ===============   ====================   ======================================
    summary           PlayPrompt             Play summary of messages prompt
     
       TRANSITIONS
         Result                           Goto State
         ------------------------------   ---------------
         Succeeded
         Line Problem                     error
         Nothing Played                   error
         Caller Hung Up                   end
     
      PARAMETER VALUES
         Parameter                        Value
         ------------------------------   ------------------------------
         Prompt                           Summary
         Force Play                       False
    State Label       Action                 Description
    ===============   ====================   ======================================
                      PlayPrompt             Play message type selection prompt
     
       TRANSITIONS
         Result                           Goto State
         ------------------------------   ---------------
         Succeeded
         Line Problem                     error
         Nothing Played                   return
         Caller Hung Up                   end
     
       PARAMETER VALUES
         Parameter                        Value
         ------------------------------   ------------------------------
         Prompt                           MessageType
         Force Play                       False

An example prompt

The prompt for VoiceMsgSummary is typical of those you will write when creating a Blueworx Voice Response application.

IF SV28 = 0 AND SV29 = 0 AND SV31 =0 THEN
       VOICE VoiceMsg (200); # You have no...
       VOICE VoiceMsg (220); # ...messages

If the caller’s mailbox contains no new messages (SV28), saved messages (SV29), or outgoing messages (SV31), this section plays “You have no messages” (voice segment 200 followed by voice segment 220 in the VoiceMsg voice directory).

ELSE
       VOICE VoiceMsg (210);         # You have...
       IF SV28 != 0 THEN
           SYSPROMPT Whole_number (SV28);
           VOICE VoiceMsg (250);   # ...new...
           PROMPT Message_s (SV28);
 
            

This section plays “You have” (voice segment 210). It then checks SV28 to see if the caller has any new messages. If there are new messages, the Whole_number system prompt plays the value of SV28.

This is followed by voice segment 250, which plays the word “new” and then the Message_s prompt. Message_s is a subroutine that determines whether the value passed as a parameter is 1, or >1. If this value is 1, the word “message” is played, otherwise the word “messages” is played.

           IF (SV29 = 0 AND SV31 !=0) OR
                (SV29 != 0 AND SV31 = 0) THEN
              VOICE System (301); # ...and...
           ENDIF
       ENDIF
ENDIF

Next, SV29 (saved messages) and SV31 (outgoing messages) are checked. If either variable contains a number other than 0, the system prompt 301, which contains the word “and”, is played.

IF SV29 != 0 THEN
        SYSPROMPT Whole_number (SV29);
        VOICE VoiceMsg (250); # ...saved...
        PROMPT Message_s (SV29);
 
        # Determine whether to say “and”
        IF SV31 = !0 THEN
               VOICE System (301); # ...and...
        ENDIF
ENDIF

This section checks SV29 to determine if the caller has saved messages. If so, it calls the system prompt Whole_number to play the value in SV29, followed by voice segment 250, which plays the word “saved”. The prompt Message_s again determines whether to play the work “message” or the word “messages”.

Next, SV31 (outgoing messages) is checked. If it contains a number other than 0, the system prompt 301, which contains the word “and”, is played.

IF SV31 != 0 THEN
        SYSPROMPT Whole_number (SV31);
        VOICE VoiceMsg (270); # ...outgoing...
        PROMPT Message_s (SV31);
ENDIF

This section checks SV31 to determine if the caller has outgoing messages. If so, it calls the system prompt Whole_number to play the value in SV31, followed by voice segment 270, which plays the word “outgoing”. The prompt Message_s again determines whether to play the word “message” or the word “messages”.