Hi guys.
I've setup presence management in kamailio and i'm currently persisting the presence info in a postgres DB.
I'm having a recurring issue on DB key violations, here's a log error output on that:
Jun 3 15:09:46 144227 ERROR: pua_dialoginfo [pua_dialoginfo.c:264]: __dialog_sendpublish(): bad reply or missing CONTACT hdr
Jun 3 15:10:01 723993 ERROR: presence [presentity.c:807]: update_presentity(): No E_Tag match a.1401768964.671509.1990.6
Jun 3 15:10:06 242334 WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR)
Jun 3 15:10:06 242370 WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: duplicate key value violates unique constraint "pua_pua_idx"#012DETAIL: Key (etag, tuple_id, call_id, from_tag)=(a.1401768964.671497.1902.6, , , ) already exists.#012]
Jun 3 15:10:06 243415 WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR)
Jun 3 15:10:06 243449 WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: duplicate key value violates unique constraint "pua_pua_idx"#012DETAIL: Key (etag, tuple_id, call_id, from_tag)=(a.1401768964.671497.1902.6, , , ) already exists.#012]
Jun 3 15:10:06 244458 WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR)
Jun 3 15:10:06 244487 WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: duplicate key value violates unique constraint "pua_pua_idx"#012DETAIL: Key (etag, tuple_id, call_id, from_tag)=(a.1401768964.671497.1902.6, , , ) already exists.#012]
Jun 3 15:10:06 244504 ERROR: db_postgres [km_dbase.c:247]: db_postgres_submit_query(): 0x7f21476b1910 PQsendQuery Error: ERROR: duplicate key value violates unique constraint "pua_pua_idx"#012DETAIL: Key (etag, tuple_id, call_id, from_tag)=(a.1401768964.671497.1902.6, , , ) already exists.#012 Query: update kamailio.pua set expires=1401807715,cseq=0,etag='a.1401768964.671497.1902.6',desired_expires=1401811600,version=2 where pres_uri='
sip:208@freguesiadearroios.govoice.pt' AND pres_id='DIALOG_PUBLISH.440163220-35219-52@BJC.BGI.B.BAI' AND flag=1024 AND event=32
Jun 3 15:10:06 244521 ERROR: <core> [db_query.c:337]: db_do_update(): error while submitting query
Jun 3 15:10:06 244548 ERROR: db_postgres [km_dbase.c:537]: db_postgres_store_result(): invalid query, execution aborted
Jun 3 15:10:06 244560 ERROR: db_postgres [km_dbase.c:538]: db_postgres_store_result(): driver error: PGRES_FATAL_ERROR, ERROR: duplicate key value violates unique constraint "pua_pua_idx"#012DETAIL: Key (etag, tuple_id, call_id, from_tag)=(a.1401768964.671497.1902.6, , , ) already exists.#012
Jun 3 15:10:06 244584 WARNING: db_postgres [km_dbase.c:647]: db_postgres_update(): unexpected result returned
Jun 3 15:10:06 244591 ERROR: pua [pua.c:1076]: db_update(): while updating in database
I've read the module documentation, but there isn't much documentation on it and i'm basically guessing and trying here.
Can someone tell me what am i doing wrong or maybe what should a try to be able to persist the presence status in a postgres database.