sip-router writes:
Details - start kamailio in usrloc db_mode=1 with empty location table. give the two ul_add commands below and the second will result into duplicate entry for key ruid_idx error.
i added a log statement to ul_mi.c mi_usrloc_add() function:
if(sruid_next(&_ul_sruid)<0) goto error; ci.ruid = _ul_sruid.uid; LM_INFO("new sruid is [%.*s]\n", ci.ruid.len, ci.ruid.s);
when i give two ul_add mi commands after starting with empty location table, i get to syslog:
Apr 16 12:35:40 siika /usr/sbin/sip-proxy[6130]: INFO: usrloc [ul_mi.c:564]: new sruid is [ulcx-516d1b67-17c8-1] Apr 16 12:35:41 siika /usr/sbin/sip-proxy[6131]: INFO: usrloc [ul_mi.c:564]: new sruid is [ulcx-516d1b67-17c8-1] Apr 16 12:35:41 siika /usr/sbin/sip-proxy[6131]: ERROR: db_mysql [km_dbase.c:122]: driver error on query: Duplicate entry 'ulcx-516d1b67-17c8-1' for key 'ruid_idx' ...
why sruid_next() call is not updating the sruid so that next call would give a new one? is it a bug in sruid_next() implementation or use of sruid calls in usrloc module?
-- juha