Commit 5fe4763b authored by Natanael Copa's avatar Natanael Copa
Browse files

main/kamailio: backport bugfix from upstream

parent fcf34127
......@@ -5,7 +5,7 @@
pkgname=kamailio
pkgver=5.4.2
pkgrel=1
pkgrel=2
# If building from a git snapshot, specify the gitcommit
# If building a proper release, leave gitcommit blank or commented
......@@ -34,6 +34,7 @@ makedepends="bison db-dev flex freeradius-client-dev expat-dev
# These are in testing / community - can't enable for kamailio in main
# librdkafka-dev dnssec-tools-dev
source="kamailio-${pkgver}$_suffix.tar.gz::https://github.com/kamailio/kamailio/archive/$_gitcommit.tar.gz
tm-proper-fill-of-From-To-URI-tag-values-using-parsed.patch
kamailio.initd
"
......@@ -559,4 +560,5 @@ sipdump() {
}
sha512sums="944eb54fe5ec1408def842f3f1f909002ba274863ea68baa85fc70aa9abd7331647f75813ccd264ed659a794570c6d8b9c89108684de603e90b0713f33412502 kamailio-5.4.2.tar.gz
b82dc389dc294cc09b0089ef2e846d308b937a9984a53574f0a434180341725dc025222d2bd9d9b0bb01b05bebd106412cfaf81e3150e338393a6a4012f1deb0 tm-proper-fill-of-From-To-URI-tag-values-using-parsed.patch
0c87bfb78481568c03e603049eb8597a90d24ae2941fc81694181b2326fa9db89fbddaaa3cf08c7bc2f5fa0e7ffac4cf4e2d010d08c4faa6cf6df98593432539 kamailio.initd"
From aa6e9963b2725c1b6b7e5ff995a77c222d95fa3c Mon Sep 17 00:00:00 2001
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu, 19 Nov 2020 17:06:06 +0100
Subject: [PATCH] tm: proper fill of From/To URI/tag values using parsed
structure in t_uac_send()
---
src/modules/tm/rpc_uac.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/modules/tm/rpc_uac.c b/src/modules/tm/rpc_uac.c
index cc50274f0c..dfe99d1390 100644
--- a/src/modules/tm/rpc_uac.c
+++ b/src/modules/tm/rpc_uac.c
@@ -593,7 +593,7 @@ void rpc_t_uac_wait(rpc_t* rpc, void* c)
static int t_uac_check_msg(struct sip_msg* msg,
str* method, str* body,
- int* fromtag, int *cseq_is, int* cseq,
+ str *fromtag, int *cseq_is, int* cseq,
str* callid)
{
struct to_body* parsed_from;
@@ -628,7 +628,13 @@ static int t_uac_check_msg(struct sip_msg* msg,
}
parsed_from = (struct to_body*)msg->from->parsed;
- *fromtag = parsed_from->tag_value.s && parsed_from->tag_value.len;
+ if(parsed_from->tag_value.s && parsed_from->tag_value.len) {
+ fromtag->s = parsed_from->tag_value.s;
+ fromtag->len = parsed_from->tag_value.len;
+ } else {
+ fromtag->s = NULL;
+ fromtag->len = 0;
+ }
*cseq = 0;
if (msg->cseq && (parsed_cseq = get_cseq(msg))) {
@@ -676,7 +682,8 @@ int t_uac_send(str *method, str *ruri, str *nexthop, str *send_socket,
struct socket_info* ssock;
str saddr;
int sport, sproto;
- int ret, fromtag, cseq_is, cseq;
+ int ret, cseq_is, cseq;
+ str fromtag;
dlg_t dlg;
uac_req_t uac_req;
@@ -749,7 +756,9 @@ int t_uac_send(str *method, str *ruri, str *nexthop, str *send_socket,
*/
/* Generate fromtag if not present */
- if (!fromtag) {
+ if (fromtag.s && fromtag.len) {
+ dlg.id.loc_tag = fromtag;
+ } else {
generate_fromtag(&dlg.id.loc_tag, &dlg.id.call_id, ruri);
}
@@ -758,8 +767,11 @@ int t_uac_send(str *method, str *ruri, str *nexthop, str *send_socket,
else dlg.loc_seq.value = DEFAULT_CSEQ;
dlg.loc_seq.is_set = 1;
- dlg.loc_uri = faked_msg.from->body;
- dlg.rem_uri = faked_msg.to->body;
+ dlg.loc_uri = get_from(&faked_msg)->uri;
+ dlg.rem_uri = get_to(&faked_msg)->uri;
+ if(get_to(&faked_msg)->tag_value.len > 0) {
+ dlg.id.rem_tag = get_to(&faked_msg)->tag_value;
+ }
dlg.rem_target = *ruri;
dlg.dst_uri = *nexthop;
dlg.send_sock=ssock;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment