Hello Daniel,

I have an update for the errors with duplicate key messages.


5678*0012 calls 5678*0002 and 5678*0007 is the subscriber for both.
When the call starts i see this:

kamailio=# select username, etag from presentity;
 username  |          etag
-----------+------------------------
 5678*0012 | a.1443699235.22541.5.0
 5678*0002 | a.1443699235.22551.3.0
 5678*0012 | a.1443699235.22549.5.0
 5678*0002 | a.1443699235.22551.4.0
 5678*0012 | a.1443699235.22542.4.0
 5678*0002 | a.1443699235.22546.5.0
 5678*0012 | a.1443699235.22548.6.0
(7 rows)

After call answered Kmailio tries to update all 5678*0012 records with etag='*#-OFFLINE-#*'. 
Since there are more than 1 record for 5678*0012 then it gives the "duplicate key value violates unique constraint" errors.
But i couldnt understand why Kamailio tries to set 5678*0012 as offline in the first place? 
Both devices registered and lamp states on 5678*0007 are green when idle.


Btw if the call is long lamp states turn green again before call ends. And there is nothing left on table

kamailio=# select username, etag from presentity;
 username | etag
----------+------
(0 rows) 

Lamps should remain red until call ends, right?


Thanks

Huseyin