Hello everyone,
According to this old thread, the db_extra fields in the acc module cannot be integer: https://lists.kamailio.org/pipermail/sr-users/2015-February/087053.html
Does this answer is still valid or is there another form to represent an integer? since in my acc table I added an integer value field.
Hello,
I haven't checked the code, nor remember why the developer did it like that, but probably it is still the case. It can be changed, should anyone needs it and want to work on it.
Cheers, Daniel
On 17.11.22 21:13, Jose Figueroa wrote:
Hello everyone,
According to this old thread, the db_extra fields in the acc module cannot be integer: https://lists.kamailio.org/pipermail/sr-users/2015-February/087053.html
Does this answer is still valid or is there another form to represent an integer? since in my acc table I added an integer value field.
-- Jose Figueroa
Kamailio - Users Mailing List - Non Commercial Discussions sr-users@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi
I haven't checked the code, nor remember why the developer did it like that, but probably it is still the case. It can be changed, should anyone needs it and want to work on it.
I also stumbled over that issue but circumvented it by converting the integers to a string.
MySQL als Database then converts the string containing a valid representation of an integer, back to an integer.
Use-case: Counting Call-Legs with same $ci:
Initialize the dialog var you will be using as a string:
$dlg_var(legcounter) = "1";
Put call in a DLG Profile:
set_dlg_profile("legcounter","$ci");
Pull Integer Variable containing number of calls:
get_profile_size("legcounter","$ci","$var(legcounter)");
$var(legcounter) is an integer now but when you assign it to a string dlg_var it is being converted to string:
$dlg_var(legcounter) = $var(legcounter);
Or to forcefully convert an integer to a string you could always do:
$dlg_var(legcounter) = "" + $var(legcounter);
PS: this was determined by try and error. So maybe there are better solutions out there.
Mit freundlichen Grüssen
-Benoît Panizzon-