On 12/23/11 8:43 PM, Andrew Pogrebennyk wrote:
On 12/23/2011 08:18 PM, Stefan Sayer wrote:
shouldn't the db layer and driver be smart enough to do insert ... on duplicate key update at least where it's supported?
my fear is that such "first insert then update" policy will affect the performance. can create noise in the log on some db backends too..
this one is also a bit tricky to do, as it will require to change the database table definition depending on matching mode from registrar/usrloc. By RFC, the primary key per aor should be contact address for the location records. As we know that lot of phones are behind the nat, many users having same environment for home/work phones, kamailio can be configured to do the matching also with call id and path stack. Because of that, these checks are done inside the modules, there is no constraint at location table sql level.
Such approach as suggested in this discussion, will require to add proper unique keys depending on configuration from kamailio.cfg.
Cheers, Daniel