[sr-dev] git:master:34f35b51: dialog: use cookie header to detect cseq auth increment needs
Daniel-Constantin Mierla
miconda at gmail.com
Wed Jul 6 17:00:33 CEST 2016
Module: kamailio
Branch: master
Commit: 34f35b51e79f4265bdfb3d654866c698bde84c01
URL: https://github.com/kamailio/kamailio/commit/34f35b51e79f4265bdfb3d654866c698bde84c01
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-07-06T16:59:32+02:00
dialog: use cookie header to detect cseq auth increment needs
---
Modified: modules/dialog/dlg_cseq.c
---
Diff: https://github.com/kamailio/kamailio/commit/34f35b51e79f4265bdfb3d654866c698bde84c01.diff
Patch: https://github.com/kamailio/kamailio/commit/34f35b51e79f4265bdfb3d654866c698bde84c01.patch
---
diff --git a/modules/dialog/dlg_cseq.c b/modules/dialog/dlg_cseq.c
index 58a6bb8..be87470 100644
--- a/modules/dialog/dlg_cseq.c
+++ b/modules/dialog/dlg_cseq.c
@@ -35,6 +35,7 @@
#include "../../events.h"
#include "../../ut.h"
+#include "../../data_lump.h"
#include "../../parser/parse_to.h"
#include "../../parser/parse_from.h"
#include "../../modules/tm/tm_load.h"
@@ -188,7 +189,6 @@ int dlg_cseq_msg_sent(void *data)
sip_msg_t msg;
str *obuf;
unsigned int direction;
- tm_cell_t *t;
unsigned int ninc = 0;
unsigned int vinc = 0;
dlg_cell_t *dlg = NULL;
@@ -222,7 +222,7 @@ int dlg_cseq_msg_sent(void *data)
direction = DLG_DIR_NONE;
dlg = dlg_lookup_msg_dialog(&msg, &direction);
-
+
if(dlg == NULL) {
LM_DBG("no dialog for this request\n");
goto done;
@@ -236,18 +236,13 @@ int dlg_cseq_msg_sent(void *data)
/* check if transaction is marked for a new increment */
if(get_cseq(&msg)->method_id!=METHOD_ACK) {
- t = d_tmb.t_gett();
- if(t==NULL || t==T_UNDEFINED) {
- LM_DBG("no transaction for request\n");
- goto done;
- }
- if(t->uas.request==0) {
- LM_DBG("no uas request - no cseq update needed\n");
- goto done;
- }
- if((t->uas.request->msg_flags&FL_UAC_AUTH)==FL_UAC_AUTH) {
+ if(sr_hdr_get_z(&msg, "P-K-Auth-CSeq")!=NULL) {
LM_DBG("uac auth request - cseq inc needed\n");
ninc = 1;
+ sr_hdr_del_z(&msg, "P-K-Auth-CSeq");
+ } else {
+ LM_DBG("uac auth request - cseq inc not needed\n");
+ goto done;
}
}
More information about the sr-dev
mailing list