Index: res/res_config_mysql.c =================================================================== --- res/res_config_mysql.c (revision 933) +++ res/res_config_mysql.c (working copy) @@ -169,18 +169,20 @@ while ((row = mysql_fetch_row(result))) { for (i = 0; i < numFields; i++) { - if (ast_strlen_zero(row[i])) - continue; + /* Encode NULL values separately from blank values, for the Realtime API */ + if (row[i] == NULL) { + row[i] = ""; + } else if (ast_strlen_zero(row[i])) { + row[i] = " "; + } for (stringp = ast_strdupa(row[i]), chunk = strsep(&stringp, ";"); chunk; chunk = strsep(&stringp, ";")) { - if (chunk && !ast_strlen_zero(ast_strip(chunk))) { - if (prev) { - prev->next = ast_variable_new(fields[i].name, chunk, ""); - if (prev->next) { - prev = prev->next; - } - } else { - prev = var = ast_variable_new(fields[i].name, chunk, ""); + if (prev) { + prev->next = ast_variable_new(fields[i].name, chunk, ""); + if (prev->next) { + prev = prev->next; } + } else { + prev = var = ast_variable_new(fields[i].name, chunk, ""); } } }