[asterisk-users] Can one adjust the voicemail-menu when using VoiceMailMain() ?

C. Chad Wallace cwallace at lodgingcompany.com
Wed Jun 9 20:30:36 CDT 2010


At 4:04 PM on 09 Jun 2010, Jonas Kellens wrote:

> I have commented out case 5, case 2 and case 3, leaving case 1,
> 4,6,7,8,9.
> 
> But when I press "1" on the menu, I hear: " I'm sorry, I did not 
> understand your response"

Looks like someone broke the first rule of Optimization Club[1].  I
think you need to copy these two lines from case 5 into case 1:

                          cmd = vm_browse_messages(chan, &vms, vmu);
                          break;

It just so happens that cases 1 and 5 run the same command, so whoever
wrote it took advantage of that, optimizing the size of the binary
while reducing maintainability.


[1]
http://perlbuzz.com/mechanix/2008/02/the-rules-of-optimization-club.html



>          if (play_auto) {
>                  cmd = '1';
>          } else {
>                  cmd = vm_intro(chan, vmu, &vms);
>          }
> 
>          vms.repeats = 0;
>          vms.starting = 1;
>          while ((cmd > -1) && (cmd != 't') && (cmd != '#')) {
>                  /* Run main menu */
>                  switch (cmd) {
>                  case '1':
>                          vms.curmsg = 0;
>                          /* Fall through */
> /* commented out from here
>                  case '5':
>                          cmd = vm_browse_messages(chan, &vms, vmu);
>                          break;
> 
> <snip code>
> 
>                                          if (vms.repeats > 3)
>                                                  cmd = 't';
>                                  }
>                          }
>                          if (cmd == 't') {
>                                  cmd = 0;
>                                  vms.repeats = 0;
>                          }
>                          break;
> commented out till here */


-- 

C. Chad Wallace, B.Sc.
The Lodging Company
http://www.lodgingcompany.com/
OpenPGP Public Key ID: 0x262208A0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20100609/131efd5f/attachment.pgp 


More information about the asterisk-users mailing list