[asterisk-commits] brushtyler: branch brushtyler/voicemail_menu_branch r204068 - in /team/brusht...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 29 12:06:15 CDT 2009


Author: brushtyler
Date: Mon Jun 29 12:06:11 2009
New Revision: 204068

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=204068
Log:
Created 2 voicemail_menu.conf that reproduce the actual behaviour

Added:
    team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_0.conf   (with props)
    team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_1.conf   (with props)
Modified:
    team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu.conf.sample
    team/brushtyler/voicemail_menu_branch/apps/newvoicemail.c

Added: team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_0.conf
URL: http://svn.asterisk.org/svn-view/asterisk/team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_0.conf?view=auto&rev=204068
==============================================================================
--- team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_0.conf (added)
+++ team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_0.conf Mon Jun 29 12:06:11 2009
@@ -1,0 +1,393 @@
+; Voice Mail Menu' configuration file
+;
+; In this configuration the menu is considered as organized
+; in more parts named "menu_name" the behaviour of the menu
+; is set by tha association 'digit = actions', where 'digits'
+; is a pattern present in the dialplan by the user, and
+; 'actions' is a list of "function(arguments)" separated by
+; 'comma. Comments are precedeed by ';'.
+;
+;------------------- global settings -----------------------;
+
+[general]
+    start = start_menu  ; starting menu name
+    end   = exit_menu   ; ending menu name
+
+    max_retries  = 3    ; max number of consecutive default 
+                        ; action's execution before exit
+
+    forward_key             = #       ; playing command
+    reverse_key             = *
+    pause_key               = 0
+    stop_key                = 13456789 ; it's correct???
+    restart_key             = 2
+
+;--------------------- menu section ------------------------;
+;
+; Main Menu
+; In the init action is used the VMCOUNT dialplan function
+; to get the number of messages stored in a mailbox folder;
+; if there are new messages, new messages folder is selected 
+; as actual folder, otherwise old messages one are selected. 
+; This permit to set a quick key to access these messages.
+;
+; Some channel vars are setted in the voicemail app code.
+; VM_USER:  called mailbox's number
+; VM_CONTEXT:  called context
+; MSG_SELECTED:  1 if a messege are selected, NULL otherwise
+; NOT_FIRST_MSG:  1 if the selected message is not the first, NULL otherwise
+; NOT_LAST_MSG:  1 if the selected message is not the last, NULL otherwise
+; VMU_NOT_DELETED:  1 if the selected message is not deleted, NULL otherwise
+; VMU_DELETED:  1 if the selected message is deleted, NULL otherwise
+; VMU_CALLBACK:  1 if callback is permitted, NULL otherwise
+; VMU_DIALOUT:  1 if dialout is permitted, NULL otherwise
+; VMU_LEAVEMESS:  1 if you can leave a message to another voicemail, NULL otherwise
+;
+; Note that some of the actions associated to digits are conditional,
+; so that they are enabled or disabled depending on the status
+; of the voice mailbox
+
+[start_menu]
+    init  = SET(VM_FOLDER=${IF(${VMCOUNT(${VM_USER}@${VM_CONTEXT},INBOX)}?INBOX:Old)}),
+    init += change_to(${VM_FOLDER}), 
+    init += SET(VM_MSGS_NUM=${VMCOUNT(${VM_USER}@${VM_CONTEXT},${VM_FOLDER})}), 
+    init += call(start_menu_intro)
+
+    default = call(start_menu_instruction)
+            ; play instructions
+
+    1  = IF(${MSG_SELECTED}), call(play_mess_menu)
+       ; if there are new messages, go to the new messages folder, 
+       ; else open the old messages folder and go to Play Messages Menu
+    2  = call(change_to_folder_menu),
+    2 += play(vm-${VM_FOLDER}), play(vm-messages)
+       ; go to Change Folder Menu
+    3  = call(adv_menu)
+       ; go to Advanced Menu Options
+    0  = call(opts_menu)
+       ; go to Voicemail Menu Options
+    *  = ; help
+    _# = exit()
+       ; exit
+
+[start_menu_intro]
+    init  = play(vm-youhave), 
+    init += ${IF(${VM_MSGS_NUM}?play(digits/${VM_MSGS_NUM}):play(vm-no))}, 
+    init += ${IF(${VM_MSGS_NUM}?play(vm-${VM_FOLDER}))}, 
+    init += ${IF($[${VM_MSGS_NUM}=1]?play(vm-message):play(vm-messages))}, 
+    init += jump(start_menu_instruction)
+
+[start_menu_instruction]
+    init  = ${IF(${VM_MSGS_NUM}?play(vm-onefor))}, 
+    init += ${IF(${VM_MSGS_NUM}?play(vm-${VM_FOLDER}))}, 
+    init += ${IF(${VM_MSGS_NUM}?play(vm-messages))}, 
+    init += play(vm-opts), 
+    init += play(vm-helpexit), 
+    init += return(1)
+
+
+;-----------------------------------------------------------;
+;
+; Full Main Menu
+
+[start_menu_full]
+    init = call(start_menu_full_instruction)
+    default = call(start_menu_full_instruction)
+            ; play instructions
+
+    1  = IF(${MSG_SELECTED}), jump(play_mess_menu)
+       ; if there are new messages, go to the new messages folder, 
+       ; else open the old messages folder and go to Play Messages Menu
+    2  = jump(change_to_folder_menu),
+    2 += play(vm-${VM_FOLDER}), play(vm-messages)
+       ; go to Change Folder Menu
+    3  = jump(adv_menu)
+       ; go to Advanced Menu Options
+    4  = IF(${NOT_FIRST_MSG}), set_msg(-1), jump(play_mess_menu)
+    4  = play(vm-nomore)
+       ; play previous message
+    5  = jump(play_mess_menu)
+       ; play current message
+    6  = IF(${NOT_LAST_MSG}), set_msg(+1), jump(play_mess_menu)
+    6  = play(vm-nomore)
+       ; play next message
+    7  = IF(${VMU_NOT_DELETED}), delete(), play(vm-deleted)
+       ; mark selected message for deletion
+    7  = IF(${VMU_DELETED}), undelete(), play(vm-undeleted)
+       ; unmark a previous marked message for deletion
+    8  = forward_message()
+       ; forward a message
+    9  = jump(save_to_folder_menu)
+       ; go to Save To Folder Menu
+    0  = jump(opts_menu)
+       ; go to Voicemail Menu Options
+    *  = ; help
+    _# = exit()
+       ; exit
+
+
+[start_menu_full_instruction]
+    init  = ${IF(${VM_MSGS_NUM}?play(vm-onefor-full))}, 
+    init += ${IF(${VM_MSGS_NUM}?play(vm-${VM_FOLDER}))}, 
+    init += ${IF(${VM_MSGS_NUM}?play(vm-messages))}, 
+    init += play(vm-opts-full), 
+    init += ${IF(${ISNULL(${NOT_FIRST_MSG})}?:play(vm-prev))}, 
+    init += play(vm-repeat), 
+    init += ${IF(${ISNULL(${NOT_LAST_MSG})}?:play(vm-next))}, 
+    init += ${IF(${ISNULL(${VMU_NOT_DELETED})}?:play(vm-delete))}, 
+    init += ${IF(${ISNULL(${VMU_DELETED})}?:play(vm-undelete))}, 
+    init += play(vm-toforward), 
+    init += play(vm-savemessage), 
+    init += play(vm-helpexit), 
+    init += return(1)
+
+
+;-----------------------------------------------------------;
+;
+; Play Messages Menu
+
+[play_mess_menu]
+    init = call(play_mess_menu_intro)
+    default = call(play_mess_menu_instruction)
+
+    3  = call(adv_menu)
+       ; go to Advanced Menu Options
+    4  = IF(${NOT_FIRST_MSG}), set_msg(-1), jump(play_mess_menu)
+       ; play previous message
+    4  = play(vm-nomore)
+    5  = jump(play_mess_menu)
+       ; play current message
+    6  = IF(${NOT_LAST_MSG}), set_msg(1), jump(play_mess_menu)
+       ; play next message
+    6  = play(vm-nomore)
+    7  = IF(${VMU_NOT_DELETED}), delete(), play(vm-deleted)
+       ; mark selected message for deletion
+    7  = IF(${VMU_DELETED}), undelete(), play(vm-undeleted)
+       ; unmark a previous marked message for deletion
+    8  = forward_message()
+       ; forward a message
+    9  = call(save_to_folder_menu)
+       ; go to Save To Folder Menu
+    *  = jump(start_menu_full)
+       ; help
+    _# = exit()
+       ; exit
+
+[play_mess_menu_intro]
+    init  = envelope(), 
+    init += play_msg(),
+    init += jump(play_mess_menu_instruction)
+
+[play_mess_menu_instruction]
+    init  = play(vm-advopts), 
+    init += ${IF(${ISNULL(${NOT_FIRST_MSG})}?:play(vm-prev))}, 
+    init += play(vm-repeat), 
+    init += ${IF(${ISNULL(${NOT_LAST_MSG})}?:play(vm-next))}, 
+    init += ${IF(${ISNULL(${VMU_NOT_DELETED})}?:play(vm-delete))}, 
+    init += ${IF(${ISNULL(${VMU_DELETED})}?:play(vm-undelete))}, 
+    init += play(vm-toforward), 
+    init += play(vm-savemessage), 
+    init += play(vm-helpexit), 
+    init += return(1)
+
+
+;-----------------------------------------------------------;
+;
+; Advanced Menu Options
+; Contains the message advanced operations o user operation 
+; related to a message 
+
+[adv_menu]
+    init    = call(adv_menu_instruction)
+    default = call(adv_menu_instruction)
+
+    1  = IF(${MSG_SELECTED}), reply()
+       ; reply to sender
+    2  = IF(${VMU_CALLBACK}), callback()
+       ; call the sender
+    3  = IF(${MSG_SELECTED}), envelope()
+       ; play additional message information
+    4  = IF(${VMU_DIALOUT}), call(dialout_menu)
+       ; make an external call
+    5  = IF(${VMU_LEAVEMESS}), leave_mess()
+       ; leave a message
+    *  = return(1)
+       ; return to Main Menu
+
+
+[adv_menu_instruction]
+    init  = ${IF(${ISNULL(${MSG_SELECTED})}?:play(vm-toreply))}, 
+    init += ${IF(${ISNULL(${VMU_CALLBACK})}?:play(vm-tocallback))}, 
+    init += ${IF(${ISNULL(${MSG_SELECTED})}?:play(vm-tohearenv))}, 
+    init += ${IF(${ISNULL(${VMU_DIALOUT})}?:play(vm-tomakecall))}, 
+    init += ${IF(${ISNULL(${VMU_LEAVEMESS})}?:play(vm-leavemsg))}, 
+    init += play(vm-starmain), 
+    init += return(1)
+
+;-----------------------------------------------------------;
+;
+; Dialout Menu
+; In this menu, the user input pattern is used as phone 
+; number to call. 
+
+[dialout_menu]
+    init    = call(dialout_menu_instruction)
+    default = call(dialout_menu_instruction)
+
+    _X. = dialout()
+        ; make a call
+    *   = return(1)
+        ; return to Main Menu
+    _#  = exit()
+        ; exit
+
+
+[dialout_menu_instruction]
+    init  = play(vm-dialout), 
+    init += return(1)
+
+;-----------------------------------------------------------;
+;
+; Save To Folder Menu
+; By this menu user can store a message in another folder:
+; the played audio file explain to users the folder related
+; to each pattern. After changing or typing '*', user can 
+; return to Main Menu.
+
+[save_to_folder_menu]
+    init    = call(save_menu_instruction)
+    default = call(save_menu_instruction)
+
+    0       = save_msg(INBOX), return(1)
+    1       = save_msg(Old), return(1)
+    2       = save_msg(Work), return(1)
+    3       = save_msg(Family), return(1)
+    4       = save_msg(Friends), return(1)
+    _#      = exit()   ; exit
+
+
+[save_menu_instruction]
+    init  = play(vm-savefolder), 
+    init += play(vm-press), 
+    init += play(digits/0), 
+    init += play(vm-for), 
+    init += play(vm-INBOX), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/1), 
+    init += play(vm-for), 
+    init += play(vm-Old), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/2), 
+    init += play(vm-for), 
+    init += play(vm-Work), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/3), 
+    init += play(vm-for), 
+    init += play(vm-Family), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/4), 
+    init += play(vm-for), 
+    init += play(vm-Friends), 
+    init += play(vm-messages), 
+    init += play(vm-tocancel), 
+    init += return(1)
+
+;-----------------------------------------------------------;
+;
+; Change Folder Menu
+; By this menu user can change his actual working folder: 
+; the played audio file explain to users the folder related
+; to each pattern. After changing or typing '*', user can 
+; return to Main Menu.
+
+[change_to_folder_menu]
+    init    = call(change_menu_instruction)
+    default = call(change_menu_instruction)
+
+    0  = SET(VM_FOLDER=INBOX), jump(change_menu_exec)
+    1  = SET(VM_FOLDER=Old), jump(change_menu_exec)
+    2  = SET(VM_FOLDER=Work), jump(change_menu_exec)
+    3  = SET(VM_FOLDER=Family), jump(change_menu_exec)
+    4  = SET(VM_FOLDER=Friends), jump(change_menu_exec)
+    _# = return(1) ;return to Main Menu
+
+
+[change_menu_exec]
+    init  = change_to(${VM_FOLDER}), return(1)
+
+
+[change_menu_instruction]
+    init  = play(vm-changeto), 
+    init += play(vm-press), 
+    init += play(digits/0), 
+    init += play(vm-for), 
+    init += play(vm-INBOX), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/1), 
+    init += play(vm-for), 
+    init += play(vm-Old), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/2), 
+    init += play(vm-for), 
+    init += play(vm-Work), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/3), 
+    init += play(vm-for), 
+    init += play(vm-Family), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/4), 
+    init += play(vm-for), 
+    init += play(vm-Friends), 
+    init += play(vm-messages), 
+    init += play(vm-tocancel), 
+    init += return(1)
+
+;-----------------------------------------------------------;
+;
+; Voicemail Menu Options
+; In this menu there are the voicemail manage operations as
+; recording a welcome message or changing the password.
+
+[opts_menu]
+    init    = call(opts_menu_instruction)
+    default = call(opts_menu_instruction)
+
+    1  = record(unavailable)
+       ; record a unavailable message
+    2  = record(busy)
+       ; record a busy message
+    3  = record(name)
+       ; record a welcome message
+    4  = changepassword()
+       ; change the user password
+    *  = return(1)
+       ; return to Main Menu
+    _# = exit()	; exit
+
+
+[opts_menu_instruction]
+    init  = play(vm-options), 
+    init += return(1)
+
+;-----------------------------------------------------------;
+;
+; Exit Menu
+; This menu are called when the voicemail app is ending, 
+; either by exit() function in another menu, calling this 
+; menu by a call() function and when max_retries are reached. 
+; The exit() function in this menu terminate the voicemail.
+
+
+[exit_menu]
+    init  = play(vm-goodbye), 
+    init += exit()
+          ; exit from Voicemail Application
+

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_0.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_0.conf
------------------------------------------------------------------------------
    svn:keywords = brushtyler 2009-06-29

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_0.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_1.conf
URL: http://svn.asterisk.org/svn-view/asterisk/team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_1.conf?view=auto&rev=204068
==============================================================================
--- team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_1.conf (added)
+++ team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_1.conf Mon Jun 29 12:06:11 2009
@@ -1,0 +1,347 @@
+; Voice Mail Menu' configuration file
+;
+; In this configuration the menu is considered as organized
+; in more parts named "menu_name" the behaviour of the menu
+; is set by tha association 'digit = actions', where 'digits'
+; is a pattern present in the dialplan by the user, and
+; 'actions' is a list of "function(arguments)" separated by
+; 'comma. Comments are precedeed by ';'.
+;
+;------------------- global settings -----------------------;
+
+[general]
+    start = start_menu  ; starting menu name
+    end   = exit_menu   ; ending menu name
+
+    max_retries  = 3    ; max number of consecutive default 
+                        ; action's execution before exit
+
+    forward_key             = #       ; playing command
+    reverse_key             = *
+    pause_key               = 0
+    stop_key                = 13456789 ; it's correct???
+    restart_key             = 2
+
+;--------------------- menu section ------------------------;
+;
+; Main Menu
+; In the init action is used the VMCOUNT dialplan function
+; to get the number of messages stored in a mailbox folder;
+; if there are new messages, new messages folder is selected 
+; as actual folder, otherwise old messages one are selected. 
+; This permit to set a quick key to access these messages.
+;
+; Some channel vars are setted in the voicemail app code.
+; VM_USER:  called mailbox's number
+; VM_CONTEXT:  called context
+; MSG_SELECTED:  1 if a messege are selected, NULL otherwise
+; NOT_FIRST_MSG:  1 if the selected message is not the first, NULL otherwise
+; NOT_LAST_MSG:  1 if the selected message is not the last, NULL otherwise
+; VMU_NOT_DELETED:  1 if the selected message is not deleted, NULL otherwise
+; VMU_DELETED:  1 if the selected message is deleted, NULL otherwise
+; VMU_CALLBACK:  1 if callback is permitted, NULL otherwise
+; VMU_DIALOUT:  1 if dialout is permitted, NULL otherwise
+; VMU_LEAVEMESS:  1 if you can leave a message to another voicemail, NULL otherwise
+;
+; Note that some of the actions associated to digits are conditional,
+; so that they are enabled or disabled depending on the status
+; of the voice mailbox
+
+[start_menu]
+    init  = IF(${IF(${ISNULL(${VM_MENU_TYPE})}?1)}),    ; enabled if VM_MENU_TYPE is null
+    init += SET(VM_MENU_TYPE=init), 
+    init += SET(VM_FOLDER=${IF(${VMCOUNT(${VM_USER}@${VM_CONTEXT},INBOX)}?INBOX:Old)}),
+    init += change_to(${VM_FOLDER}), 
+    init += SET(VM_MSGS_NUM=${VMCOUNT(${VM_USER}@${VM_CONTEXT},${VM_FOLDER})}), 
+    init += call(start_menu_intro)
+    init  = call(start_menu_intro)  ; enabled otherwise
+
+    default = call(start_menu_instruction)
+            ; play instructions
+
+    1  = IF(${MSG_SELECTED}), SET(VM_MENU_TYPE=play), jump(start_menu)
+       ; if there are new messages, go to the new messages folder, 
+       ; else open the old messages folder and go to Play Messages Menu
+    2  = SET(VM_MENU_TYPE=init), call(change_to_folder_menu)
+    2 += play(vm-${VM_FOLDER}), play(vm-messages)
+       ; go to Change Folder Menu
+    3  = SET(VM_MENU_TYPE=init), call(adv_menu)
+       ; go to Advanced Menu Options
+    4  = IF(${NOT_FIRST_MSG}), SET(VM_MENU_TYPE=play), 
+    4 += set_msg(-1), jump(start_menu)
+    4  = play(vm-nomore)
+       ; play previous message
+    5  = jump(start_menu)
+       ; play current message
+    6  = IF(${NOT_LAST_MSG}), SET(VM_MENU_TYPE=play), 
+    6 += set_msg(+1), jump(start_menu)
+    6  = play(vm-nomore)
+       ; play next message
+    7  = IF(${VMU_NOT_DELETED}), SET(VM_MENU_TYPE=play), 
+    7 += delete(), play(vm-deleted)
+       ; mark selected message for deletion
+    7  = IF(${VMU_DELETED}), SET(VM_MENU_TYPE=play), 
+    7 += undelete(), play(vm-undeleted)
+       ; unmark a previous marked message for deletion
+    8  = forward_message()
+       ; forward a message
+    9  = SET(VM_MENU_TYPE=init), call(save_to_folder_menu)
+       ; go to Save To Folder Menu
+    0  = SET(VM_MENU_TYPE=init), call(opts_menu)
+       ; go to Voicemail Menu Options
+    *  = ${IF($[${VM_MENU_TYPE}=play]?SET(VM_MENU_TYPE=full))}
+       ; help
+    _# = exit()
+       ; exit
+
+[start_menu_intro]
+    init  = ${IF($[${VM_MENU_TYPE}=play]?jump(start_menu_play_intro))},
+    init += play(vm-youhave), 
+    init += ${IF(${VM_MSGS_NUM}?play(digits/${VM_MSGS_NUM}):play(vm-no))}, 
+    init += ${IF(${VM_MSGS_NUM}?play(vm-${VM_FOLDER}))}, 
+    init += ${IF($[${VM_MSGS_NUM}=1]?play(vm-message):play(vm-messages))}, 
+    init += jump(start_menu_instruction)
+
+[start_menu_instruction]
+    init  = ${IF($[${VM_MENU_TYPE}=full]?jump(start_menu_full_instruction))},
+    init += ${IF($[${VM_MENU_TYPE}=play]?jump(start_menu_play_instruction))},
+    init += ${IF(${VM_MSGS_NUM}?play(vm-onefor))}, 
+    init += ${IF(${VM_MSGS_NUM}?play(vm-${VM_FOLDER}))}, 
+    init += ${IF(${VM_MSGS_NUM}?play(vm-messages))}, 
+    init += play(vm-opts), 
+    init += play(vm-helpexit), 
+    init += return(1)
+
+[start_menu_full_instruction]
+    init  = ${IF(${VM_MSGS_NUM}?play(vm-onefor-full))}, 
+    init += ${IF(${VM_MSGS_NUM}?play(vm-${VM_FOLDER}))}, 
+    init += ${IF(${VM_MSGS_NUM}?play(vm-messages))}, 
+    init += play(vm-opts-full), 
+    init += ${IF(${ISNULL(${NOT_FIRST_MSG})}?:play(vm-prev))}, 
+    init += play(vm-repeat), 
+    init += ${IF(${ISNULL(${NOT_LAST_MSG})}?:play(vm-next))}, 
+    init += ${IF(${ISNULL(${VMU_NOT_DELETED})}?:play(vm-delete))}, 
+    init += ${IF(${ISNULL(${VMU_DELETED})}?:play(vm-undelete))}, 
+    init += play(vm-toforward), 
+    init += play(vm-savemessage), 
+    init += play(vm-helpexit), 
+    init += return(1)
+
+[start_menu_play_intro]
+    init  = envelope(), 
+    init += play_msg(),
+    init += jump(start_menu_play_instruction)
+
+[start_menu_play_instruction]
+    init  = play(vm-advopts), 
+    init += ${IF(${ISNULL(${NOT_FIRST_MSG})}?:play(vm-prev))}, 
+    init += play(vm-repeat), 
+    init += ${IF(${ISNULL(${NOT_LAST_MSG})}?:play(vm-next))}, 
+    init += ${IF(${ISNULL(${VMU_NOT_DELETED})}?:play(vm-delete))}, 
+    init += ${IF(${ISNULL(${VMU_DELETED})}?:play(vm-undelete))}, 
+    init += play(vm-toforward), 
+    init += play(vm-savemessage), 
+    init += play(vm-helpexit), 
+    init += return(1)
+
+
+;-----------------------------------------------------------;
+;
+; Advanced Menu Options
+; Contains the message advanced operations o user operation 
+; related to a message 
+
+[adv_menu]
+    init    = call(adv_menu_instruction)
+    default = call(adv_menu_instruction)
+
+    1  = IF(${MSG_SELECTED}), reply()
+       ; reply to sender
+    2  = IF(${VMU_CALLBACK}), callback()
+       ; call the sender
+    3  = IF(${MSG_SELECTED}), envelope()
+       ; play additional message information
+    4  = IF(${VMU_DIALOUT}), call(dialout_menu)
+       ; make an external call
+    5  = IF(${VMU_LEAVEMESS}), leave_mess()
+       ; leave a message
+    *  = return(1)
+       ; return to Main Menu
+
+
+[adv_menu_instruction]
+    init  = ${IF(${ISNULL(${MSG_SELECTED})}?:play(vm-toreply))}, 
+    init += ${IF(${ISNULL(${VMU_CALLBACK})}?:play(vm-tocallback))}, 
+    init += ${IF(${ISNULL(${MSG_SELECTED})}?:play(vm-tohearenv))}, 
+    init += ${IF(${ISNULL(${VMU_DIALOUT})}?:play(vm-tomakecall))}, 
+    init += ${IF(${ISNULL(${VMU_LEAVEMESS})}?:play(vm-leavemsg))}, 
+    init += play(vm-starmain), 
+    init += return(1)
+
+;-----------------------------------------------------------;
+;
+; Dialout Menu
+; In this menu, the user input pattern is used as phone 
+; number to call. 
+
+[dialout_menu]
+    init    = call(dialout_menu_instruction)
+    default = call(dialout_menu_instruction)
+
+    _X. = dialout()
+        ; make a call
+    *   = return(1)
+        ; return to Main Menu
+    _#  = exit()
+        ; exit
+
+
+[dialout_menu_instruction]
+    init  = play(vm-dialout), 
+    init += return(1)
+
+;-----------------------------------------------------------;
+;
+; Save To Folder Menu
+; By this menu user can store a message in another folder:
+; the played audio file explain to users the folder related
+; to each pattern. After changing or typing '*', user can 
+; return to Main Menu.
+
+[save_to_folder_menu]
+    init    = call(save_menu_instruction)
+    default = call(save_menu_instruction)
+
+    0       = save_msg(INBOX), return(1)
+    1       = save_msg(Old), return(1)
+    2       = save_msg(Work), return(1)
+    3       = save_msg(Family), return(1)
+    4       = save_msg(Friends), return(1)
+    _#      = exit()   ; exit
+
+
+[save_menu_instruction]
+    init  = play(vm-savefolder), 
+    init += play(vm-press), 
+    init += play(digits/0), 
+    init += play(vm-for), 
+    init += play(vm-INBOX), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/1), 
+    init += play(vm-for), 
+    init += play(vm-Old), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/2), 
+    init += play(vm-for), 
+    init += play(vm-Work), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/3), 
+    init += play(vm-for), 
+    init += play(vm-Family), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/4), 
+    init += play(vm-for), 
+    init += play(vm-Friends), 
+    init += play(vm-messages), 
+    init += play(vm-tocancel), 
+    init += return(1)
+
+;-----------------------------------------------------------;
+;
+; Change Folder Menu
+; By this menu user can change his actual working folder: 
+; the played audio file explain to users the folder related
+; to each pattern. After changing or typing '*', user can 
+; return to Main Menu.
+
+[change_to_folder_menu]
+    init    = call(change_menu_instruction)
+    default = call(change_menu_instruction)
+
+    0  = SET(VM_FOLDER=INBOX), jump(change_menu_exec)
+    1  = SET(VM_FOLDER=Old), jump(change_menu_exec)
+    2  = SET(VM_FOLDER=Work), jump(change_menu_exec)
+    3  = SET(VM_FOLDER=Family), jump(change_menu_exec)
+    4  = SET(VM_FOLDER=Friends), jump(change_menu_exec)
+    _# = return(1) ;return to Main Menu
+
+
+[change_menu_exec]
+    init  = change_to(${VM_FOLDER}), return(1)
+
+
+[change_menu_instruction]
+    init  = play(vm-changeto), 
+    init += play(vm-press), 
+    init += play(digits/0), 
+    init += play(vm-for), 
+    init += play(vm-INBOX), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/1), 
+    init += play(vm-for), 
+    init += play(vm-Old), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/2), 
+    init += play(vm-for), 
+    init += play(vm-Work), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/3), 
+    init += play(vm-for), 
+    init += play(vm-Family), 
+    init += play(vm-messages), 
+    init += play(vm-press), 
+    init += play(digits/4), 
+    init += play(vm-for), 
+    init += play(vm-Friends), 
+    init += play(vm-messages), 
+    init += play(vm-tocancel), 
+    init += return(1)
+
+;-----------------------------------------------------------;
+;
+; Voicemail Menu Options
+; In this menu there are the voicemail manage operations as
+; recording a welcome message or changing the password.
+
+[opts_menu]
+    init    = call(opts_menu_instruction)
+    default = call(opts_menu_instruction)
+
+    1  = record(unavailable)
+       ; record a unavailable message
+    2  = record(busy)
+       ; record a busy message
+    3  = record(name)
+       ; record a welcome message
+    4  = changepassword()
+       ; change the user password
+    *  = return(1)
+       ; return to Main Menu
+    _# = exit()	; exit
+
+
+[opts_menu_instruction]
+    init  = play(vm-options), 
+    init += return(1)
+
+;-----------------------------------------------------------;
+;
+; Exit Menu
+; This menu are called when the voicemail app is ending, 
+; either by exit() function in another menu, calling this 
+; menu by a call() function and when max_retries are reached. 
+; The exit() function in this menu terminate the voicemail.
+
+
+[exit_menu]
+    init  = play(vm-goodbye), 
+    init += exit()
+          ; exit from Voicemail Application
+

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_1.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_1.conf
------------------------------------------------------------------------------
    svn:keywords = brushtyler 2009-06-29

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual_1.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu.conf.sample
URL: http://svn.asterisk.org/svn-view/asterisk/team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu.conf.sample?view=diff&rev=204068&r1=204067&r2=204068
==============================================================================
--- team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu.conf.sample (original)
+++ team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu.conf.sample Mon Jun 29 12:06:11 2009
@@ -35,7 +35,7 @@
 ; of the voice mailbox
 
 [vm_menu]
-    init = SET(FOLD=${IF(${VMCOUNT(id at mb,INBOX)}?NEW_FOLDER:OLD_FOLDER)}),play(vm_intro)
+    init = SET(FOLD=${IF(${VMCOUNT(${VM_USER}@${VM_CONTEXT},INBOX)}?NEW_FOLDER:OLD_FOLDER)}),play(vm_intro)
         ; set in FOLD var the working folder
     default = play(vm_intro)
         ; play instructions

Modified: team/brushtyler/voicemail_menu_branch/apps/newvoicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/brushtyler/voicemail_menu_branch/apps/newvoicemail.c?view=diff&rev=204068&r1=204067&r2=204068
==============================================================================
--- team/brushtyler/voicemail_menu_branch/apps/newvoicemail.c (original)
+++ team/brushtyler/voicemail_menu_branch/apps/newvoicemail.c Mon Jun 29 12:06:11 2009
@@ -262,6 +262,8 @@
 /*! Voicemail mailbox state */
 struct vm_state {
 	char str_dig[80];		/*!< Buffer representing pattern digited by user >*/
+    int retries;
+    int exiting;
 	char curbox[80];
 	char username[80];
 	char curdir[PATH_MAX];
@@ -312,7 +314,6 @@
 static int vms_debug(struct vm_state* vms);
 #endif
 
-static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms);
 static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms);
 /*static int forward_message(struct ast_channel *chan, char *context, struct vm_state *vms,
 			   struct ast_vm_user *sender, char *fmt, int flag,signed char record_gain);*/
@@ -1157,25 +1158,390 @@
 	return 0;
 }
 
+static int say_and_wait(struct ast_channel *chan, int num, const char *language)
+{
+	int d;
+	d = ast_say_number(chan, num, AST_DIGIT_ANY, language, NULL);
+	return d;
+}
+
+static int wait_file2(struct ast_channel *chan, struct vm_state *vms, char *file)
+{
+	int res;
+	if ((res = ast_stream_and_wait(chan, file, AST_DIGIT_ANY)) < 0) 
+		ast_log(AST_LOG_WARNING, "Unable to play message %s\n", file); 
+	return res;
+}
+
+static int wait_file(struct ast_channel *chan, struct vm_state *vms, char *file) 
+{
+	return ast_control_streamfile(chan, file, listen_control_forward_key, listen_control_reverse_key, listen_control_stop_key, listen_control_pause_key, listen_control_restart_key, skipms, NULL);
+}
+
+static int play_message_category(struct ast_channel *chan, const char *category)
+{
+	int res = 0;
+
+	if (!ast_strlen_zero(category))
+		res = ast_play_and_wait(chan, category);
+
+	if (res) {
+		ast_log(AST_LOG_WARNING, "No sound file for category '%s' was found.\n", category);
+		res = 0;
+	}
+
+	return res;
+}
+
+static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, const char *origtime, const char *filename)
+{
+	int res = 0;
+	struct vm_zone *the_zone = NULL;
+	time_t t;
+
+	if (ast_get_time_t(origtime, &t, 0, NULL)) {
+		ast_log(AST_LOG_WARNING, "Couldn't find origtime in %s\n", filename);
+		return 0;
+	}
+
+	/* Does this user have a timezone specified? */
+	if (!ast_strlen_zero(vmu->zonetag)) {
+		/* Find the zone in the list */
+		struct vm_zone *z;
+		AST_LIST_LOCK(&zones);
+		AST_LIST_TRAVERSE(&zones, z, list) {
+			if (!strcmp(z->name, vmu->zonetag)) {
+				the_zone = z;
+				break;
+			}
+		}
+		AST_LIST_UNLOCK(&zones);
+	}
+
+/* No internal variable parsing for now, so we'll comment it out for the time being */
+#if 0
+	/* Set the DIFF_* variables */
+	ast_localtime(&t, &time_now, NULL);
+	tv_now = ast_tvnow();
+	ast_localtime(&tv_now, &time_then, NULL);
+
+	/* Day difference */
+	if (time_now.tm_year == time_then.tm_year)
+		snprintf(temp,sizeof(temp),"%d",time_now.tm_yday);
+	else
+		snprintf(temp,sizeof(temp),"%d",(time_now.tm_year - time_then.tm_year) * 365 + (time_now.tm_yday - time_then.tm_yday));
+	pbx_builtin_setvar_helper(chan, "DIFF_DAY", temp);
+
+	/* Can't think of how other diffs might be helpful, but I'm sure somebody will think of something. */
+#endif
+	if (the_zone) {
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, the_zone->msg_format, the_zone->timezone);
+	}
+	else if (!strcasecmp(chan->language,"pl"))       /* POLISH syntax */
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Q HM", NULL);
+	else if (!strcasecmp(chan->language,"se"))       /* SWEDISH syntax */
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' dB 'digits/at' k 'and' M", NULL);
+	else if (!strcasecmp(chan->language,"no"))       /* NORWEGIAN syntax */
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Q 'digits/at' HM", NULL);
+	else if (!strcasecmp(chan->language,"de"))       /* GERMAN syntax */
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Q 'digits/at' HM", NULL);
+	else if (!strcasecmp(chan->language,"nl"))      /* DUTCH syntax */
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/nl-om' HM", NULL);
+	else if (!strcasecmp(chan->language,"it"))      /* ITALIAN syntax */
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' 'digits/hours' k 'digits/e' M 'digits/minutes'", NULL);
+	else if (!strcasecmp(chan->language,"gr"))
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q  H 'digits/kai' M ", NULL);
+	else if (!strcasecmp(chan->language,"pt_BR"))
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Ad 'digits/pt-de' B 'digits/pt-de' Y 'digits/pt-as' HM ", NULL);
+	else if (!strcasecmp(chan->language,"tw"))      /* CHINESE (Taiwan) syntax */
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "qR 'vm-received'", NULL);		
+	else {
+		res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' IMp", NULL);
+	}
+#if 0
+	pbx_builtin_setvar_helper(chan, "DIFF_DAY", NULL);
+#endif
+	return res;
+}
+
+static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms, char *cid, const char *context, int callback)
+{
+	return 0;
+}
+
+static int play_message_duration(struct ast_channel *chan, struct vm_state *vms, const char *duration, int minduration)
+{
+	int res = 0;
+	int durationm;
+	int durations;
+	/* Verify that we have a duration for the message */
+	if (duration == NULL)
+		return res;
+
+	/* Convert from seconds to minutes */
+	durations=atoi(duration);
+	durationm=(durations / 60);
+
+	ast_debug(1, "VM-Duration: duration is: %d seconds converted to: %d minutes\n", durations, durationm);
+
+	if ((!res) && (durationm >= minduration)) {
+		res = wait_file2(chan, vms, "vm-duration");
+
+		/* POLISH syntax */
+		if (!strcasecmp(chan->language, "pl")) {
+			div_t num = div(durationm, 10);
+
+			if (durationm == 1) {
+				res = ast_play_and_wait(chan, "digits/1z");
+				res = res ? res : ast_play_and_wait(chan, "vm-minute-ta");
+			} else if (num.rem > 1 && num.rem < 5 && num.quot != 1) {
+				if (num.rem == 2) {
+					if (!num.quot) {
+						res = ast_play_and_wait(chan, "digits/2-ie");
+					} else {
+						res = say_and_wait(chan, durationm - 2 , chan->language);
+						res = res ? res : ast_play_and_wait(chan, "digits/2-ie");
+					}
+				} else {
+					res = say_and_wait(chan, durationm, chan->language);
+				}
+				res = res ? res : ast_play_and_wait(chan, "vm-minute-ty");
+			} else {
+				res = say_and_wait(chan, durationm, chan->language);
+				res = res ? res : ast_play_and_wait(chan, "vm-minute-t");
+			}
+		/* DEFAULT syntax */
+		} else {
+			res = ast_say_number(chan, durationm, AST_DIGIT_ANY, chan->language, NULL);
+			res = wait_file2(chan, vms, "vm-minutes");
+		}
+	}
+	return res;
+}
+
 static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_size,
-			   struct ast_vm_user *res_vmu, const char *context, const char *prefix,
-      int skipuser, int maxlogins, int silent)
-{
+			struct ast_vm_user *res_vmu, const char *context, const char *prefix,
+			int skipuser, int max_logins, int silent)
+{
+	int useadsi=0, valid=0, logretries=0;
+	char password[AST_MAX_EXTENSION]="", *passptr;
+	struct ast_vm_user vmus, *vmu = NULL;
+
+	/* If ADSI is supported, setup login screen */
+#if 0
+	adsi_begin(chan, &useadsi);
+	if (!skipuser && useadsi)
+		adsi_login(chan);
+#endif
+	if (!silent && !skipuser && ast_streamfile(chan, "vm-login", chan->language)) {
+		ast_log(AST_LOG_WARNING, "Couldn't stream login file\n");
+		return -1;
+	}
+	
+	/* Authenticate them and get their mailbox/password */
+	
+	while (!valid && (logretries < max_logins)) {
+		/* Prompt for, and read in the username */
+		if (!skipuser && ast_readstring(chan, mailbox, mailbox_size - 1, 2000, 10000, "#") < 0) {
+			ast_log(AST_LOG_WARNING, "Couldn't read username\n");
+			return -1;
+		}
+		if (ast_strlen_zero(mailbox)) {
+			if (chan->cid.cid_num) {
+				ast_copy_string(mailbox, chan->cid.cid_num, mailbox_size);
+			} else {
+				ast_verb(3,"Username not entered\n");	
+				return -1;
+			}
+		}
+#if 0
+		if (useadsi)
+			adsi_password(chan);
+#endif
+
+		if (!ast_strlen_zero(prefix)) {
+			char fullusername[80] = "";
+			ast_copy_string(fullusername, prefix, sizeof(fullusername));
+			strncat(fullusername, mailbox, sizeof(fullusername) - 1 - strlen(fullusername));
+			ast_copy_string(mailbox, fullusername, mailbox_size);
+		}
+
+		ast_debug(1, "Before find user for mailbox %s\n",mailbox);
+		vmu = find_user(&vmus, context, mailbox);
+		if (vmu && (vmu->password[0] == '\0' || (vmu->password[0] == '-' && vmu->password[1] == '\0'))) {
+			/* saved password is blank, so don't bother asking */
+			password[0] = '\0';
+		} else {
+			if (ast_streamfile(chan, "vm-password", chan->language)) {
+				ast_log(AST_LOG_WARNING, "Unable to stream password file\n");
+				return -1;
+			}
+			if (ast_readstring(chan, password, sizeof(password) - 1, 2000, 10000, "#") < 0) {
+				ast_log(AST_LOG_WARNING, "Unable to read password\n");
+				return -1;
+			}
+		}
+
+		if (vmu) {
+			passptr = vmu->password;
+			if (passptr[0] == '-') passptr++;
+		}
+		if (vmu && !strcmp(passptr, password))
+			valid++;
+		else {
+			ast_verb(3, "Incorrect password '%s' for user '%s' (context = %s)\n", password, mailbox, context ? context : "default");
+			if (!ast_strlen_zero(prefix))
+				mailbox[0] = '\0';
+		}
+		logretries++;
+		if (!valid) {
+			if (skipuser || logretries >= max_logins) {
+				if (ast_streamfile(chan, "vm-incorrect", chan->language)) {
+					ast_log(AST_LOG_WARNING, "Unable to stream incorrect message\n");
+					return -1;
+				}
+			} else {
+#if 0
+				if (useadsi)
+					adsi_login(chan);
+#endif
+				if (ast_streamfile(chan, "vm-incorrect-mailbox", chan->language)) {
+					ast_log(AST_LOG_WARNING, "Unable to stream incorrect mailbox message\n");
+					return -1;
+				}
+			}
+			if (ast_waitstream(chan, ""))	/* Channel is hung up */
+				return -1;
+		}
+	}
+	if (!valid && (logretries >= max_logins)) {
+		ast_stopstream(chan);
+		ast_play_and_wait(chan, "vm-goodbye");
+		return -1;
+	}
+	if (vmu && !skipuser) {
+		memcpy(res_vmu, vmu, sizeof(struct ast_vm_user));
+	}
 	return 0;
 }
 

[... 848 lines stripped ...]



More information about the asterisk-commits mailing list