[Home]

Summary:ASTERISK-24720: Unable to change voicemail password using realtime engine
Reporter:Leandro Dardini (ldardini)Labels:
Date Opened:2015-01-25 03:44:20.000-0600Date Closed:2015-01-25 06:48:21.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:
Versions:13.1.0 Frequency of
Occurrence
Constant
Related
Issues:
duplicatesASTERISK-24626 Voicemail passwords not being stored in ARA
Environment:Voicemail ODBC storage on mysql usingAttachments:
Description:It is not possible to change the voicemail password due to a bug in the ast_update2_realtime function, used only to update the voicemail table, the only one having two fields to be selected in the filter.

The function decodes twice the lookup_fields and do not decode the update_fields.

{code}
--- main/config.c.orig  2015-01-25 10:38:32.000000000 +0100
+++ main/config.c       2015-01-25 10:39:03.000000000 +0100
@@ -3317,31 +3317,31 @@

int ast_update2_realtime(const char *family, ...)
{
       RAII_VAR(struct ast_variable *, lookup_fields, NULL, ast_variables_destroy);
       RAII_VAR(struct ast_variable *, update_fields, NULL, ast_variables_destroy);
       va_list ap;

       va_start(ap, family);
       /* XXX: If we wanted to pass no lookup fields (select all), we'd be
        * out of luck. realtime_arguments_to_fields expects at least one key
        * value pair. */
       realtime_arguments_to_fields(ap, &lookup_fields);
       va_end(ap);

       va_start(ap, family);
-       realtime_arguments_to_fields2(ap, 1, &lookup_fields);
+       realtime_arguments_to_fields2(ap, 1, &update_fields);
       va_end(ap);

       if (!lookup_fields || !update_fields) {
               return -1;
       }

       return ast_update2_realtime_fields(family, lookup_fields, update_fields);
}

int ast_store_realtime_fields(const char *family, const struct ast_variable *fields)
{
       struct ast_config_engine *eng;
       int res = -1, i;
       char db[256];
       char table[256];
{code}
Comments: