Hi,
Quick question: Looking at the Dialog module and CSeq tracking functionality, I've noticed the following: - on the one hand, we are storing the current CSeq for each direction in the Dialog structure - on the other hand, we are storing a "Delta" of the received vs. updated CSeq as a Dialog Variable
Does replacing the Delta with the CSeq already stored with the Dialog structure make sense?
I am asking because of my latest changes, where there may be more sources for an updated CSeq (e.g., when sending a Request from script within the Dialog) and more use cases for an updated CSeq (Up and Downstream).
I've updated the dialog module for my use already accordingly https://github.com/kamailio/kamailio/compare/master...carstenbock/dialog_cse...
I wanted to hear other opinions and possible pitfalls as well...
Thanks, Carsten
-- Carsten Bock I CTO & Founder
ng-voice GmbH
Trostbrücke 1 I 20457 Hamburg I Germany T +49 179 2021244 I www.ng-voice.com
Registry Office at Local Court Hamburg, HRB 120189 Managing Directors: Dr. David Bachmann, Carsten Bock
Hi Carsten,
the CSeq tracking (cseq_diff dlg_var) related implementation is a bit older; it was added in 2014. I am not the author of this code, but some remarks from my side.
The CSeq tracking functionality works only for a certain direction and only when it’s enabled with a module parameter right now, as you also noticed. This was probably one of the reasons of using a dialog variable for that.
I think it should be fine to store it directly internally, after this functionality was generalized to work in both directions and also support more cases. The cseq_diff variable is not used from other modules, afaik.
Cheers,
Henning
From: Carsten Bock carsten@ng-voice.com Sent: Montag, 20. Februar 2023 12:26 To: Kamailio (SER) - Devel Mailing List sr-dev@lists.kamailio.org Subject: [sr-dev] Dialog-Module and CSeq tracking
Hi,
Quick question: Looking at the Dialog module and CSeq tracking functionality, I've noticed the following: - on the one hand, we are storing the current CSeq for each direction in the Dialog structure - on the other hand, we are storing a "Delta" of the received vs. updated CSeq as a Dialog Variable
Does replacing the Delta with the CSeq already stored with the Dialog structure make sense?
I am asking because of my latest changes, where there may be more sources for an updated CSeq (e.g., when sending a Request from script within the Dialog) and more use cases for an updated CSeq (Up and Downstream).
I've updated the dialog module for my use already accordingly https://github.com/kamailio/kamailio/compare/master...carstenbock/dialog_cse... I wanted to hear other opinions and possible pitfalls as well...
Thanks, Carsten
-- Carsten Bock I CTO & Founder
ng-voice GmbH
Trostbrücke 1 I 20457 Hamburg I Germany T +49 179 2021244 I www.ng-voice.comhttp://www.ng-voice.com/
Registry Office at Local Court Hamburg, HRB 120189 Managing Directors: Dr. David Bachmann, Carsten Bock
Hello,
the CSeq diff variable is for increasing/decrising the CSeq when authentication to next hop is done by Kamailio with uac module/uac_auth().
Only the current CSeq is not enough, because the value has to be set back in reply (I don't remember exactly right now, this might be done with some Via trick) but also readjusted for requests within dialog.
So it would be required to keep incoming cseq and outgoing cseq for each direection, but this would be bit tricky to deal with on network races of subsequent requests sent quickly one after the other and the second arrive first.
If you need to track differences on both directions, not only towards callee, in my opinion the best is still to have the current incoming cseq and the difference to outgoing to be able to adjust without worrying much about network transmission re-ordering. But I am open to consider other options if people think of better ideas.
Then, if it becomes more like a common functionality for the dialog module, the cseq diffs for caller and callee can be made fields in dialog table, not kept as variables.
Cheers, Daniel
On 20.02.23 12:26, Carsten Bock wrote:
Hi,
Quick question: Looking at the Dialog module and CSeq tracking functionality, I've noticed the following:
- on the one hand, we are storing the current CSeq for each direction
in the Dialog structure
- on the other hand, we are storing a "Delta" of the received vs.
updated CSeq as a Dialog Variable
Does replacing the Delta with the CSeq already stored with the Dialog structure make sense?
I am asking because of my latest changes, where there may be more sources for an updated CSeq (e.g., when sending a Request from script within the Dialog) and more use cases for an updated CSeq (Up and Downstream).
I've updated the dialog module for my use already accordingly https://github.com/kamailio/kamailio/compare/master...carstenbock/dialog_cse...
I wanted to hear other opinions and possible pitfalls as well...
Thanks, Carsten
-- Carsten Bock I CTO & Founder
ng-voice GmbH
Trostbrücke 1 I 20457 Hamburg I Germany T +49 179 2021244 I www.ng-voice.com http://www.ng-voice.com/
Registry Office at Local Court Hamburg, HRB 120189 Managing Directors: Dr. David Bachmann, Carsten Bock
Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-leave@lists.kamailio.org
Hi Daniel,
Thanks for your feedback. The last weeks have been a bit busy - first MWC and afterward, I was in urgent need of a holiday... ;-)
Just some notes: - the dialog module was and is already keeping track of the CSeq for both directions - I reused the already available information - the CSeq is restored using information stored in the Via-Header, as you described, so there is no need for further processing
I will do further testing and validation and then hopefully issue a Pull-Request.
Thanks, and see you at KamailioWorld this year, Carsten
-- Carsten Bock I CTO & Founder
ng-voice GmbH
Trostbrücke 1 I 20457 Hamburg I Germany T +49 179 2021244 I www.ng-voice.com
Registry Office at Local Court Hamburg, HRB 120189 Managing Directors: Dr. David Bachmann, Carsten Bock
Am Fr., 24. Feb. 2023 um 09:01 Uhr schrieb Daniel-Constantin Mierla < miconda@gmail.com>:
Hello,
the CSeq diff variable is for increasing/decrising the CSeq when authentication to next hop is done by Kamailio with uac module/uac_auth().
Only the current CSeq is not enough, because the value has to be set back in reply (I don't remember exactly right now, this might be done with some Via trick) but also readjusted for requests within dialog.
So it would be required to keep incoming cseq and outgoing cseq for each direection, but this would be bit tricky to deal with on network races of subsequent requests sent quickly one after the other and the second arrive first.
If you need to track differences on both directions, not only towards callee, in my opinion the best is still to have the current incoming cseq and the difference to outgoing to be able to adjust without worrying much about network transmission re-ordering. But I am open to consider other options if people think of better ideas.
Then, if it becomes more like a common functionality for the dialog module, the cseq diffs for caller and callee can be made fields in dialog table, not kept as variables.
Cheers, Daniel On 20.02.23 12:26, Carsten Bock wrote:
Hi,
Quick question: Looking at the Dialog module and CSeq tracking functionality, I've noticed the following:
- on the one hand, we are storing the current CSeq for each direction in
the Dialog structure
- on the other hand, we are storing a "Delta" of the received vs. updated
CSeq as a Dialog Variable
Does replacing the Delta with the CSeq already stored with the Dialog structure make sense?
I am asking because of my latest changes, where there may be more sources for an updated CSeq (e.g., when sending a Request from script within the Dialog) and more use cases for an updated CSeq (Up and Downstream).
I've updated the dialog module for my use already accordingly
https://github.com/kamailio/kamailio/compare/master...carstenbock/dialog_cse...
I wanted to hear other opinions and possible pitfalls as well...
Thanks, Carsten
-- Carsten Bock I CTO & Founder
ng-voice GmbH
Trostbrücke 1 I 20457 Hamburg I Germany T +49 179 2021244 I www.ng-voice.com
Registry Office at Local Court Hamburg, HRB 120189 Managing Directors: Dr. David Bachmann, Carsten Bock
Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-leave@lists.kamailio.org
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference - June 5-7, 2023 - www.kamailioworld.com Kamailio Advanced Training - Online - March 27-30, 2023 - www.asipto.com