Summary:ASTERISK-03023: operator=yes isn't being recognized
Reporter:drmac (drmac)Labels:
Date Opened:2004-12-17 14:21:06.000-0600Date Closed:2008-01-15 15:22:05.000-0600
Versions:Frequency of
Environment:Attachments:( 0) mysqlvm.txt
( 1) voicemail_patch.txt
Description:Add the following line of code at line 4133 in app_voicemail.c and recompile:

ast_verbose(VERBOSE_PREFIX_2 "#### Calloper Config: %i  ASTCallOP: %s\n", calloper, astcallop);

I have in my voicemail.conf file: operator=yes

And I get the following verbose message when I "load app_voicemail.so":

 == #### Calloper Config: -1  ASTCallOP: yes

Shouldn't calloper get set to 1 and not -1?

Because calloper is being set to -1, the check at line 296 is not working and therefore operator=yes isn't being globaly allowed.


operator=yes works fine for individual boxes.

I noticed that in config.c, ast_true returns either a -1 or 0. Shouldn't it return 1 somewhere?

ast_false also returns either -1 or 0.
Comments:By: Tilghman Lesher (tilghman) 2004-12-17 22:25:06.000-0600

Please upload your voicemail.conf, with passwords removed.  I suspect you have a) a typo, b) a duplicate heading, or c) the option in the wrong place.

By: Mark Spencer (markster) 2004-12-18 09:00:38.000-0600

-1 is fine, it's nonzero and thus if (-1) evalutes to true.

By: drmac (drmac) 2004-12-19 00:03:15.000-0600

OK. Add this at line 1423, right after "transfer:"

ast_verbose(VERBOSE_PREFIX_2 "#### Vmu->Operator: %i  CallOper: %i\n", vmu->operator, calloper);

Even though calloper is -1 (which according to Mark evals to true) vmu->operator is still set to 0, which gives the caller the "vm-sorry" message.

Maby I am expecting something else. Here is what I am expecting, and correct me if I am wrong:

Lets say I have 100 voicemail users and I want to enable "press 0 to exit" functionality to all 100 vm users.

I could A) add operator=yes to all 100 users's options section or B) add operator=yes under [general] and have it affect all users.

I am expecting behavior B. Is this the intended functionality of the code?

By: Mark Spencer (markster) 2004-12-19 18:44:53.000-0600

Are you using realtime or just using regular static config files?

By: drmac (drmac) 2004-12-20 09:05:35.000-0600

Regular static flatfiles to store the [general] section. I'm on stable so there is no RealTime. I'm using mysql-vm-headers.h to retreive the VM users.

By: Mark Spencer (markster) 2004-12-20 19:13:37.000-0600

I doubt that feature is supported with the old mysql-vm-routines.  Please try realtime and tell me if that fixes it for you.

By: Clod Patry (junky) 2004-12-21 00:37:21.000-0600

drmac: like Corydon76 already asked you, if you could attached with .conf, that would help us (just change your passwords to PASSWORD).
When reporting a bug, if you could provide the more information you can, that would be great for us.
Thanks for understanding.

By: drmac (drmac) 2004-12-21 08:25:22.000-0600

The patch to enable this feature was added to both stable and CVS so it should work with any stable code right?

fromstring=Cytel Voicemail
emailsubject=New VM (${VM_MSGNUM}) - From ${VM_CALLERID}
emailbody=Dear ${VM_NAME}:\n\n\t Hi, I just wanted to let you know you were left a ${VM_DUR} long message (number ${VM_MSGNUM}) in mailbox ${VM_MAILBOX} from ${VM_CALLERID}, on ${VM_DATE} so you might want to check it when you get a chance.\n\t\t\t\tThanks!\n\n\t\t\t\t--Cytel Communications\n
mailcmd=/usr/local/sbin/sendmail -f voicemail@cytelcom.com

eastern=America/New_York|'vm-received' Q 'digits/at' IMp
eastern24=America/New_York|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
central=America/Chicago|'vm-received' Q 'digits/at' IMp
central24=America/Chicago|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
mountain=America/Denver|'vm-received' Q 'digits/at' IMp
mountain24=America/Denver|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
western=America/Los_Angeles|'vm-received' Q 'digits/at' IMp
western24=America/Los_Angeles|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'

By: Tilghman Lesher (tilghman) 2004-12-21 10:24:24.000-0600

It will work with any stable code as long as you aren't using the old deprecated MySQL database code.  Use the realtime configuration if you wish to use the operator= option with database-configured mailboxes.

By: drmac (drmac) 2005-01-04 11:49:40.000-0600

i found the problem. and im attaching a patch which fixes two things:

1. the fact that operator=yes inside the [general] section wasn't being applied globally as it should.

2. previously, if a person pressed '0' and there was no "o" context, the system would say "sorry. i didn't understand your response." and then app_voicemail would quit. patch changes it so that if "o" isnt defined and you press 0, it says sorry but loops back to the persons greeting.

By: drmac (drmac) 2005-01-04 11:50:16.000-0600

patch is applied to most recent STABLE.

By: Mark Spencer (markster) 2005-01-09 04:10:28.000-0600

Not a bug in head, resolving for drumkilla to look at for stable.

By: Russell Bryant (russell) 2005-01-12 22:08:02.000-0600

your patch doesn't apply

Please provide an updated patch ...

By: Russell Bryant (russell) 2005-01-12 23:36:51.000-0600

I added the line that fixes the option ...

By: Terry Wilson (twilson) 2005-01-15 22:07:00.000-0600

On stable 1.0 (Current CVS including the populate_defaults line from this patch) it seems to not only not fix pressing '0' for operator=yes globally, but break pressing '*' to exit as well.  No changes were made to my voicemail.conf and '*' works with that line commented out, but doesn't with it in.  I am using old mysql voicemail (since their is no voicemail realtime in stable).

edited on: 01-15-05 22:13

By: Mark Spencer (markster) 2005-01-16 02:26:05.000-0600

marking as resolved in order for russell to look at for stable again.

By: Russell Bryant (russell) 2005-01-16 18:11:25.000-0600

I removed that line from app_voicemail

Try this patch and let me know if it still fixes the global operator option and doesn't break anything

By: Russell Bryant (russell) 2005-01-16 18:13:02.000-0600

just marking this resolved while I wait to hear if this fixes everything

By: Russell Bryant (russell) 2005-01-17 16:34:09.000-0600

this should be happy now

You will need to update mysql-vm-routines.h

By: Digium Subversion (svnbot) 2008-01-15 15:21:33.000-0600

Repository: asterisk
Revision: 4782

U   branches/v1-0/apps/app_voicemail.c

r4782 | russell | 2008-01-15 15:21:32 -0600 (Tue, 15 Jan 2008) | 2 lines

fix global operator=yes (bug ASTERISK-3023)



By: Digium Subversion (svnbot) 2008-01-15 15:22:05.000-0600

Repository: asterisk
Revision: 4815

U   branches/v1-0/apps/app_voicemail.c

r4815 | russell | 2008-01-15 15:22:05 -0600 (Tue, 15 Jan 2008) | 2 lines

working on the correct fix (bug ASTERISK-3023)