[Asterisk-Users] Re: Getting to the last "old" voicemail message

Robert La Ferla robertlaferla at comcast.net
Thu Mar 9 10:14:03 MST 2006


I made a small change to apps/app_voicemail.c to permit circular 
navigation when listening to messages.  If you are at the first message, 
and press "4", it takes you to the last message.  If you are already at 
the last message and press "6", it takes you to the first message.  I 
did a quick test and it seems to work.  If you apply it and find any 
problems, please let me know and I'll fix it.

I don't have a diff but here's the code in function vm_execmain():

                case '4':
                        if (vms.curmsg) {
                                vms.curmsg--;
                                cmd = play_message(chan, vmu, &vms);
                        } else {
                          /* cmd = ast_play_and_wait(chan, "vm-nomore"); */
                          vms.curmsg = vms.lastmsg;
                          cmd = play_message(chan, vmu, &vms);
                        }
                        break;
                case '6':
                        if (vms.curmsg < vms.lastmsg) {
                                vms.curmsg++;
                                cmd = play_message(chan, vmu, &vms);
                        } else {
                          /* cmd = ast_play_and_wait(chan, "vm-nomore"); */
                          vms.curmsg = 0;
                          cmd = play_message(chan, vmu, &vms);
                        }
                        break;




More information about the asterisk-users mailing list