Hello,
I'm upgrading a 1.5 install to 4.0 and encounter a problem with registrations from a phone. The phone lost power and after rebooting it starts a new registration while the old registration hasn't expired yet. The phone uses the same aor and contact but a different call-id (and cseq) which all seems ok and used to work with 1.5.x.
Problem 1) When receiving this new registration, kamailio is trying to update the old registration even though the new registration doesn't match the old one. The database responds with 0 rows updated because the call-id is different.
Problem 2) To try to circumvent problem 1, i have usrloc configured to try an insert instead when the update fails. That insert fails because kamailio is trying to insert with the same ruid as the old registration.
Combining those, the real problem seems to be that kamailio is assigning the same ruid to both registrations. How could that be prevented?
The config parameters are set so that it matches my old 1.5 config as much as possible. No need for outbound, gruu, etc.
(Phone does send an +sip.instance, which happens to be identical in both registrations. I have gruu_enabled set to 0, so i would expect kamailio to ignore it as it did in 1.5. The outbound module is not loaded).
modparam("registrar", "min_expires", 60) modparam("registrar", "default_expires", 1800) modparam("registrar", "default_q", 0) modparam("registrar", "path_mode", 0) modparam("registrar", "use_path", 1) modparam("registrar", "path_use_received", 1) modparam("registrar", "gruu_enabled", 0)
modparam("usrloc", "db_mode", 2) modparam("usrloc", "timer_interval", 20) #modparam("usrloc", "db_obs_ruid", 0) # param does not really exist modparam("usrloc", "db_check_update", 1) modparam("usrloc", "timer_procs", 2) modparam("usrloc", "hash_size", 14) modparam("usrloc", "matching_mode", 0)
Hello,
to fix such cases, we added the option to use ruid for updates to database:
http://kamailio.org/docs/modules/stable/modules/usrloc.html#usrloc.p.db_obs_...
There were couple of items opened to the tracker at some point, also a discussion on the mailing list, this being the solution that seemed most optimal.
Cheers, Daniel
On 7/16/13 2:47 PM, Alex Hermann wrote:
Hello,
I'm upgrading a 1.5 install to 4.0 and encounter a problem with registrations from a phone. The phone lost power and after rebooting it starts a new registration while the old registration hasn't expired yet. The phone uses the same aor and contact but a different call-id (and cseq) which all seems ok and used to work with 1.5.x.
Problem 1) When receiving this new registration, kamailio is trying to update the old registration even though the new registration doesn't match the old one. The database responds with 0 rows updated because the call-id is different.
Problem 2) To try to circumvent problem 1, i have usrloc configured to try an insert instead when the update fails. That insert fails because kamailio is trying to insert with the same ruid as the old registration.
Combining those, the real problem seems to be that kamailio is assigning the same ruid to both registrations. How could that be prevented?
The config parameters are set so that it matches my old 1.5 config as much as possible. No need for outbound, gruu, etc.
(Phone does send an +sip.instance, which happens to be identical in both registrations. I have gruu_enabled set to 0, so i would expect kamailio to ignore it as it did in 1.5. The outbound module is not loaded).
modparam("registrar", "min_expires", 60) modparam("registrar", "default_expires", 1800) modparam("registrar", "default_q", 0) modparam("registrar", "path_mode", 0) modparam("registrar", "use_path", 1) modparam("registrar", "path_use_received", 1) modparam("registrar", "gruu_enabled", 0)
modparam("usrloc", "db_mode", 2) modparam("usrloc", "timer_interval", 20) #modparam("usrloc", "db_obs_ruid", 0) # param does not really exist modparam("usrloc", "db_check_update", 1) modparam("usrloc", "timer_procs", 2) modparam("usrloc", "hash_size", 14) modparam("usrloc", "matching_mode", 0)
On Tuesday 16 July 2013 15:14:19 Daniel-Constantin Mierla wrote:
to fix such cases, we added the option to use ruid for updates to database:
http://kamailio.org/docs/modules/stable/modules/usrloc.html#usrloc.p.db_obs_...
Something seems a bit wonky here. As you could see in my config fragment, i commented this parameter because it doesn't seem to exist.
This parameter exists in documentation, but not in code:
0(14392) ERROR: <core> [modparam.c:152]: set_mod_param_regex: parameter <db_obs_ruid> of type <2> not found in module <usrloc>
This is on 4.0. I grepped through the repository, in the 4.0 branch the documentation exists, but not the code. In master neither exists.
btw, the documentation conflicts with itself. The parameter is specified as a "string" value, but the explanation and example have "integer" values (there are more of these type of errors on the same page).
$ git show-ref origin/4.0 f8826df994a6baac9cfee219abafa3e1b82ee4f8 refs/remotes/origin/4.0
$ grep -rn db_obs_ruid * ChangeLog:768: - new parameter db_obs_ruid - if set to 1, db update/delete operations modules/usrloc/doc/usrloc_admin.xml:847: <section id="usrloc.p.db_obs_ruid"> modules/usrloc/doc/usrloc_admin.xml:848: <title><varname>db_obs_ruid</varname> (string)</title> modules/usrloc/doc/usrloc_admin.xml:860: <title>Set <varname>db_obs_ruid</varname> parameter</title> modules/usrloc/doc/usrloc_admin.xml:863:modparam("usrloc", "db_obs_ruid", 1) modules/usrloc/README:70: 3.32. db_obs_ruid (string) modules/usrloc/README:151: 1.32. Set db_obs_ruid parameter modules/usrloc/README:199: 3.32. db_obs_ruid (string) modules/usrloc/README:312: 3.32. db_obs_ruid (string) modules/usrloc/README:734:3.32. db_obs_ruid (string) modules/usrloc/README:742: Example 1.32. Set db_obs_ruid parameter modules/usrloc/README:744:modparam("usrloc", "db_obs_ruid", 1)
On 7/16/13 2:47 PM, Alex Hermann wrote:
#modparam("usrloc", "db_obs_ruid", 0) # param does not really exist
On 7/16/13 9:27 PM, Alex Hermann wrote:
On Tuesday 16 July 2013 15:14:19 Daniel-Constantin Mierla wrote:
to fix such cases, we added the option to use ruid for updates to database:
http://kamailio.org/docs/modules/stable/modules/usrloc.html#usrloc.p.db_obs_...
Something seems a bit wonky here. As you could see in my config fragment, i commented this parameter because it doesn't seem to exist.
This parameter exists in documentation, but not in code:
0(14392) ERROR: <core> [modparam.c:152]: set_mod_param_regex: parameter <db_obs_ruid> of type <2> not found in module <usrloc>
This is on 4.0. I grepped through the repository, in the 4.0 branch the documentation exists, but not the code. In master neither exists.
It is a typo in documentation, the name of the parameter is db_ops_ruid (database operations [using] ruid).
The type is int, another error in the docs.
Cheers, Daniel
btw, the documentation conflicts with itself. The parameter is specified as a "string" value, but the explanation and example have "integer" values (there are more of these type of errors on the same page).
$ git show-ref origin/4.0 f8826df994a6baac9cfee219abafa3e1b82ee4f8 refs/remotes/origin/4.0
$ grep -rn db_obs_ruid * ChangeLog:768: - new parameter db_obs_ruid - if set to 1, db update/delete operations modules/usrloc/doc/usrloc_admin.xml:847: <section id="usrloc.p.db_obs_ruid"> modules/usrloc/doc/usrloc_admin.xml:848: <title><varname>db_obs_ruid</varname> (string)</title> modules/usrloc/doc/usrloc_admin.xml:860: <title>Set <varname>db_obs_ruid</varname> parameter</title> modules/usrloc/doc/usrloc_admin.xml:863:modparam("usrloc", "db_obs_ruid", 1) modules/usrloc/README:70: 3.32. db_obs_ruid (string) modules/usrloc/README:151: 1.32. Set db_obs_ruid parameter modules/usrloc/README:199: 3.32. db_obs_ruid (string) modules/usrloc/README:312: 3.32. db_obs_ruid (string) modules/usrloc/README:734:3.32. db_obs_ruid (string) modules/usrloc/README:742: Example 1.32. Set db_obs_ruid parameter modules/usrloc/README:744:modparam("usrloc", "db_obs_ruid", 1)
On 7/16/13 2:47 PM, Alex Hermann wrote:
#modparam("usrloc", "db_obs_ruid", 0) # param does not really exist