Hi, can anyone see why this code wouldn't work? In the log is shows this message after set_dlg_profile called - dialog [dlg_hash.c:523]: no dialog callid='...' found Dialogs are being saved to dialog table ok but nothing is in dialog_vars table.
modparam("dialog", "dlg_flag", DLGFLAG) modparam("dialog", "hash_size", 128) modparam("dialog", "default_timeout", 14400) modparam("dialog", "dlg_match_mode", 0) modparam("dialog", "table_name", "dialog") modparam("dialog", "db_url", DBURL) modparam("dialog", "db_mode", 2) modparam("dialog", "db_update_period", 10) modparam("dialog", "profiles_with_value", "caller ; allcalls") ... if (is_method("INVITE")) { setflag(FLT_ACC); # do accounting setflag(DLGFLAG); ## add to dialog list
$var(callcnt) = 0; get_profile_size("caller", "$fu", "$var(callcnt)"); xlog("$fu has $var(callcnt) concurrent calls\n"); if ($var(callcnt) >= 2) { sl_send_reply("503", "Simultaneous calls limit reached"); exit; } set_dlg_profile("caller","$fu"); }
-- Thanks Ben
Hi Ben,
your example is not working, since you set the flag for usage of the dialog module, but the dialog has not been created yet. If you add "dlg_manage()" after the setting of the according flags, you will get a proper value from the get_profile_size().... The dialog_vars Table is for per dialog-variables, e.g. values you want to save additionally to your dialog, e.g.: $dlg_var(billing_server) = 'some server name'; You can then retrieve these values in subsequent requests (e.g. Re-INVITES or BYE-Messages).
That's why the dialog_vars table is empty (and in your example it should be).
Carsten
2012/1/5 Ben WIlliams benwilliams@joobworld.com:
Thanks Carsten, it works now.
Ben
On Thu, Jan 5, 2012 at 9:41 PM, Carsten Bock carsten@ng-voice.com wrote: