Greetings,
I recently deployed 1.5.0 and was thrilled to have the opportunity to use the new sqlops module for a purpose that required a lot of custom database logic, but unfortunately had to roll back to 1.4.4 because a lot of stuff seemed to be broken in the 'dialog' module. I refuse to believe that the 'dialog' module was released in such a broken state, so I am thinking I am problem is that I am neglecting something very important or that there are some omissions in the documentation.
System is CentOS 64-bit on a dual-CPU quad-core setup with 8 GB of RAM.
Two fundamental problems:
1) get_profile_size() on profiles with no "values" (i.e. inside the enumerated "profiles_no_value" modparam) crashes.
This problem also exists on 1.4.4. I have not tried other 1.4.x releases.
So, I have:
modparam("dialog", "enable_stats", 1) modparam("dialog", "hash_size", 65536) modparam("dialog", "rr_param", "dlgcor") modparam("dialog", "dlg_flag", 2) modparam("dialog", "default_timeout", 28800) modparam("dialog", "dlg_match_mode", 1) modparam("dialog", "db_mode", 0) modparam("dialog", "profiles_no_value", "global") modparam("dialog", "profiles_with_value", "user")
And then, in my INVITE handler for inbound routes:
# Set dialog construction flag.
setflag(2);
# Add this dialog to the global call count profile.
set_dlg_profile("global");
# Add this dialog to a per-customer dialog profile.
set_dlg_profile("user", "$avp(S:user_id)");
# Put out some debugging values for global and customer profiles.
get_profile_size("global", "$var(global_dialog_count)");
get_profile_size("user", "$avp(S:user_id)", "$var(customer_dialog_count)");
The first get_profile_size() statement crashes--the one that refers to the profile without values.
According to the GDB backtrace, the crash occurs at modules/dialog/dialog.c:701:
if(sp_dest->setf(msg, &sp_dest->pvp, (int)EQ_T, &val)<0) { LM_ERR("setting profile PV failed\n"); return -1; }
The cause is that sp_dest is NULL here. I have determined that the value of 'result' in w_get_profile_size() as passed into this prototype:
static int w_get_profile_size(struct sip_msg *msg, char *profile, char *value, char *result)
is NULL.
I would conclude from this - not being a developer - that the root cause is that the config file/route script lexer does not properly distinguish between the value-less and with-value argument combination of get_profile_size() that can occur.
A workaround is possible by setting my 'global' profile to be "with values" as well and using a bogus value key like "1" that is always the same. However, I do not think this should be happening.
2) The second problem only occurs in 1.5.0 and not in 1.4. It is much more serious.
It would appear that the dialogs are not actually being inserted into the profiles - either the global or the per-user ones. I can see from the debug logs that the dialogs are being tracked because I set the dialog construction flag (2). I have also tried using dlg_manage(). However, get_profile_size(...) always returns 0 no matter what I do.
---
I find it hard to believe that the 'dialog' module in 1.5.0 was released with such regressions, and cannot find anything in the devel list archives or the tracker suggesting that this behaviour has been elsewhere. My only conclusion is that either I am doing something wrong or that there is a problem with my environment. Admittedly, I have not tried reproducing these issues in 32-bit library environment and perhaps should.
Please help!
-- Alex