Module: kamailio
Branch: master
Commit: 2bd1227b2440dd376c18e6c964f569e0e9ba4730
URL: 
https://github.com/kamailio/kamailio/commit/2bd1227b2440dd376c18e6c964f569e0e9ba4730

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2023-03-31T18:24:24+02:00

tm: keep shortcut the cseq header method

---

Modified: src/modules/tm/h_table.h
Modified: src/modules/tm/t_lookup.c
Modified: src/modules/tm/t_msgbuilder.c
Modified: src/modules/tm/uac.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/2bd1227b2440dd376c18e6c964f569e0e9ba4730.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2bd1227b2440dd376c18e6c964f569e0e9ba4730.patch

---

diff --git a/src/modules/tm/h_table.h b/src/modules/tm/h_table.h
index fdf80fcb43..5ebba9b0fc 100644
--- a/src/modules/tm/h_table.h
+++ b/src/modules/tm/h_table.h
@@ -372,8 +372,11 @@ typedef struct cell
        str cseq_hdr_n;
        str to_hdr;
 
+       /* shortcuts inside above fields */
        str callid_val;
        str cseq_num;
+       str cseq_met;
+
        /* method shortcut -- for local transactions, pointer to
         * outbound buffer, for proxies transactions pointer to
         * original message; needed for reply matching */
diff --git a/src/modules/tm/t_lookup.c b/src/modules/tm/t_lookup.c
index f4f929a811..696dfacd0a 100644
--- a/src/modules/tm/t_lookup.c
+++ b/src/modules/tm/t_lookup.c
@@ -1649,6 +1649,9 @@ static inline void init_new_t(struct cell *new_cell, 
struct sip_msg *p_msg)
        new_cell->cseq_num.s = get_cseq(shm_msg)->number.s;
        new_cell->cseq_num.len = get_cseq(shm_msg)->number.len;
        trim(&new_cell->cseq_num);
+       new_cell->cseq_met.s = get_cseq(shm_msg)->method.s;
+       new_cell->cseq_met.len = get_cseq(shm_msg)->method.len;
+       trim(&new_cell->cseq_met);
 
        new_cell->method=new_cell->uas.request->first_line.u.request.method;
        if (p_msg->REQ_METHOD==METHOD_INVITE){
diff --git a/src/modules/tm/t_msgbuilder.c b/src/modules/tm/t_msgbuilder.c
index 4de65ffcf3..2e053341b1 100644
--- a/src/modules/tm/t_msgbuilder.c
+++ b/src/modules/tm/t_msgbuilder.c
@@ -1498,6 +1498,9 @@ static inline char* print_cseq(char* w, str* cseq, str* 
method, struct cell* t)
        t->cseq_num.s = t->cseq_hdr_n.s + CSEQ_LEN;
        t->cseq_num.len = cseq->len;
        trim(&t->cseq_num);
+       t->cseq_met.s = t->cseq_hdr_n.s + CSEQ_LEN + cseq->len + 1;
+       t->cseq_met.len = method->len;
+       trim(&t->cseq_met);
 
        return w;
 }
diff --git a/src/modules/tm/uac.c b/src/modules/tm/uac.c
index 3f3b7c3761..f35bf345f8 100644
--- a/src/modules/tm/uac.c
+++ b/src/modules/tm/uac.c
@@ -193,6 +193,9 @@ int uac_refresh_shortcuts(tm_cell_t *tcell, int branch, 
char *buf, int buf_len)
        tcell->cseq_num.s = cs->number.s;
        tcell->cseq_num.len = cs->number.len;
        trim(&tcell->cseq_num);
+       tcell->cseq_met.s = cs->method.s;
+       tcell->cseq_met.len = cs->method.len;
+       trim(&tcell->cseq_met);
 
        LM_DBG("cseq: [%.*s]\n", tcell->cseq_hdr_n.len, tcell->cseq_hdr_n.s);
        lreq.buf=0;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to [email protected]

Reply via email to