hi Indeed dialog OPTIONS are send with wrong CSeq and there is no way to fix it without patching source.
In docs for dialog module "If keep alive is enabled for a dialog, the module will send SIP OPTIONS requests with CSeq lower or equal than last request within dialog" Usually Kamailio is used before some media server (asterisk, freeswitch...): endpoint1 - kamailio ----leg1---- media_server ---leg2---- kamailio - endpoint2 So if it is your case and you want to check if dialog alive, you may ping media server instead of pinging remote endpoints: for leg1: dlg_set_property("ka-dst"); for leg2: dlg_set_property("ka-src"); Of course your media server should support this not inaccurate CSeq handling. I successfully use it with freeswitch for example (with some minimal freeswitch tuning) 2018-04-12 23:34 GMT+03:00 Oded Arbel <od...@cloudonix.io>: > Hi all. > > I'm trying to use the dialog module's keep alive feature (ka_interval() > and dlg_set_property()), and the documentation (under dlg_set_property) > says this: > > If keep alive is enabled for a dialog, the module will send SIP OPTIONS > requests with CSeq lower or equal than last request within dialog > > This is seems really weird to me, but the problem is worse than that - > when setting dlg_set_property("ka-src"), the OPTIONS messages sent to the > caller always have CSeq set to "0", regardless of what CSeq the UA sent on > its invite. > > The problem is that while some UAs respond to these purposefully broken > messages with some kind of a 5xx reply (for example, Linphone funnily sends > "500 Internal Server Error"), several UAs don't respond at all. Worse than > that - some of the UAs that send back 5xx replies to OPTIONS with a > non-zero but invalid CSeq will completely ignore the OPTIONS keep-alive > message that is sent to the caller with a CSeq 0 - for example, PJSIP > responds with "503 Invalid CSeq" to a "ka-dst" OPTIONS message but will > ignore a "ka-src" OPTIONS message with CSeq 0. > > My questions: > 1. Why are keep-alive messages sent with a wrong CSeq? > 2. If we're keeping the "wrong CSeq" approach, can we at least not send > CSeq "0"? > 3. Is there a way to change any of the above behaviors with a > configuration (i.e. without patching the sources)? > > Thanks in advance > > -- > Oded Arbel > od...@cloudonix.io > > > > _______________________________________________ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users > > -- Savolainen Dmitri
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users