Module: kamailio
Branch: master
Commit: b0c6db1a30b9d49f34f614d47e2bfe28b9dac62d
URL:
https://github.com/kamailio/kamailio/commit/b0c6db1a30b9d49f34f614d47e2bfe2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-07-06T16:49:35+02:00
uac: add cookie header for cseq tracking
- mark the request to handle it in retransmissions
- GH #679
---
Modified: modules/uac/auth.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b0c6db1a30b9d49f34f614d47e2bfe2…
Patch:
https://github.com/kamailio/kamailio/commit/b0c6db1a30b9d49f34f614d47e2bfe2…
---
diff --git a/modules/uac/auth.c b/modules/uac/auth.c
index 6a530b7..19283a5 100644
--- a/modules/uac/auth.c
+++ b/modules/uac/auth.c
@@ -36,6 +36,7 @@
#include "../../mem/mem.h"
#include "../../hashes.h"
#include "../../dset.h"
+#include "../../srapi.h"
#include "../../modules/tm/tm_load.h"
#include "auth.h"
@@ -375,7 +376,7 @@ static inline int apply_urihdr_changes( struct sip_msg *req,
-int uac_auth( struct sip_msg *msg)
+int uac_auth(sip_msg_t *msg)
{
static struct authenticate_body auth;
struct uac_credential *crd;
@@ -385,6 +386,7 @@ int uac_auth( struct sip_msg *msg)
struct hdr_field *hdr;
HASHHEX response;
str *new_hdr;
+ sr_cfgenv_t *cenv = NULL;
/* get transaction */
t = uac_tmb.t_gett();
@@ -471,7 +473,13 @@ int uac_auth( struct sip_msg *msg)
/* mark request in T with uac auth for increase of cseq via dialog
* - this function is executed in failure route, msg_flags will be
* reset afterwards by tm fake env */
- if(t->uas.request) t->uas.request->msg_flags |= FL_UAC_AUTH;
+ if(t->uas.request) {
+ t->uas.request->msg_flags |= FL_UAC_AUTH;
+ cenv = sr_cfgenv_get();
+ if(cenv->cseq_update == 1) {
+ sr_hdr_add_zz(msg, "P-K-Auth-CSeq", "yes");
+ }
+ }
return 0;
error: