[Home]

Summary:ASTERISK-05805: Recent changes to app_voicemail breaks realtime voicemail
Reporter:Jason Parker (jparker)Labels:
Date Opened:2005-12-08 16:21:35.000-0600Date Closed:2005-12-08 16:52:47.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I haven't figured out under which circumstances this does or does not happen (it happens with everything I've tried).

I'm using voicemail users from realtime, VoiceMail(1234) or VoiceMail(1234@default) or VoiceMailMain(), and the searchcontexts option is unset.

1234 definitely exists in default.

I believe it was the change made in ASTERISK-5745 that causes this.

****** ADDITIONAL INFORMATION ******

   -- Executing VoiceMail("SCCP/6265737906-00000317", "1234")
Dec  8 15:17:00 WARNING[16847]: res_odbc.c:171 odbc_smart_execute: SQL Execute returned an error -1: : [FreeTDS][SQL Server]Line 1: Length or precision specification 0 is invalid. (76)
Dec  8 15:17:00 WARNING[16847]: res_odbc.c:171 odbc_smart_execute: SQL Execute returned an error -1: : [FreeTDS][SQL Server]Must declare the variable '@P2'. (53)
Dec  8 15:17:00 WARNING[16847]: res_odbc.c:171 odbc_smart_execute: SQL Execute returned an error -1: : [FreeTDS][SQL Server]Statement(s) could not be prepared. (56)
Dec  8 15:17:00 WARNING[16847]: res_odbc.c:171 odbc_smart_execute: SQL Execute returned an error -1: 00000: [FreeTDS][SQL Server]Statement(s) could not be prepared. (56)
Dec  8 15:17:00 WARNING[16847]: res_config_odbc.c:124 realtime_odbc: SQL Execute error!
[SELECT * FROM voicemail WHERE mailbox = ? AND context = ?]

Dec  8 15:17:00 WARNING[16847]: app_voicemail.c:2384 leave_voicemail: No entry in voicemail config file for '1234'
Comments:By: Jason Parker (jparker) 2005-12-08 16:33:28.000-0600

In function vm_authenticate(), vmus is defined as null, and never set anywhere in the function (I haven't determined why), and is passed to find_user() (still null).

find_user() sets the context to "default" if none set (and VM_SEARCH isn't set), runs through the in-memory list of boxes (in my case, it is empty, so cur will be null).  find_user() passes ivm(formerly vmus)(still null), context (default), and mailbox (1234) to find_user_realtime().

find_user_realtime() malloc()'s a new "retval" (because ivm is null), sets retval->mailbox = mailbox, and passes retval->mailbox and retval->context (This is where the problem lies - retval->context is null at this point, since ivm came in null.  before the patch in ASTERISK-5745, retval->context was set to the value of context) to ast_load_realtime.

The fix may be as simple as adding the following code back in, but...who knows what it'll break?

if (context)
ast_copy_string(retval->context, context, sizeof(retval->context));

Perhaps it might also need another ast_test_flag on VM_SEARCH?

By: Jason Parker (jparker) 2005-12-08 16:49:59.000-0600

Why was this closed?

By: Tilghman Lesher (tilghman) 2005-12-08 16:52:47.000-0600

As noted in the Resolution field, it was fixed.