Hi,


I think it is a race condition.

The first PUBLISH is not completed before the second PUBLISH.
Therefore, the second PUBLISH have the "old" etag value.


I had a similar problem years ago, when using parallel forking.

If two endpoints send 180 at the same time, the second "bad" etag, results in a state which is never cleared.


My hack was to disable the PUBLISH on the second reply.

Hope it helps, use at your own risk :-)


In src/modules/dialog/dlg_handlers.c, from line 509 (in git master)

       if(new_state == DLG_STATE_EARLY) {
               run_dlg_callbacks(DLGCB_EARLY, dlg, req, rpl, DLG_DIR_UPSTREAM, 0);
               if(old_state != DLG_STATE_EARLY)
                       if_update_stat(dlg_enable_stats, early_dlgs, 1);
               goto done;
       }

Is changed to the following:
       if(new_state == DLG_STATE_EARLY) {
               if(old_state != DLG_STATE_EARLY) {

                       run_dlg_callbacks(DLGCB_EARLY, dlg, req, rpl, DLG_DIR_UPSTREAM, 0);
                       if_update_stat(dlg_enable_stats, early_dlgs, 1);
               }

               goto done;
       }

 

Regards,

Kristian Høgh

uni-tel A/S



On Thursday, 18 January 2024 14.19.57 CET satyaprakash ch via sr-users wrote:

 

Hi

 

There were two PUBLISH requests were sent by the Kamailio Proxy server to the Kamailio Presence server.

 

Processing of the first PUBLISH request resulted in the presentity table being updated - the "etag" changed from "a.1705053846.16611.21.1" to "a.1705053846.16613.23.2"

 

Processing of the second PUBLISH failed because it also attempted to update the etag in the presentity table but at this point in time there was no match to the original etag value in the database

 

 

Logs in kamailio.log:
------
ps_db_update_presentity(): No E-Tag match a.1705053846.16611.21.1
DEBUG: tm [t_reply.c:637]: _reply_light(): reply sent out - buf=0x7f81e5ca5fc0: SIP/2.0 412 Conditio... shmem=0x7f81de6da068: SIP/2.0 412 Conditional request failed.

 

 

 

Will any one suggest how to resolve the issue of 412 conditional request failed.