[SR-Users] dialog module - set_dlg_profile won't work
Carsten Bock
carsten at ng-voice.com
Thu Jan 5 09:41:40 CET 2012
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 at joobworld.com>:
> 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
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Carsten Bock
CEO (Geschäftsführer)
ng-voice GmbH
Schomburgstr. 80
D-22767 Hamburg / Germany
http://www.ng-voice.com
mailto:carsten at ng-voice.com
Mobile +49 179 2021244
Office +49 40 34927219
Fax +49 40 34927220
Sitz der Gesellschaft: Hamburg
Registergericht: Amtsgericht Hamburg, HRB 120189
Geschäftsführer: Carsten Bock
Ust-ID: DE279344284
Hier finden Sie unsere handelsrechtlichen Pflichtangaben:
http://www.ng-voice.com/imprint/
More information about the sr-users
mailing list