Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MT#8797 backport upstream patches to deal with double record route
- Loading branch information
1 parent
3ac0dec
commit 1a6523a
Showing
3 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
debian/patches/upstream/core-new-internal-msg-flag-added-FL_RR_ADDED.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 79a01b9df71bdc4329ee14e29d5c5ef230116bd2 Mon Sep 17 00:00:00 2001 | ||
From: Daniel-Constantin Mierla <miconda@gmail.com> | ||
Date: Tue, 29 Apr 2014 00:05:16 +0200 | ||
Subject: [PATCH] core: new internal msg flag added - FL_RR_ADDED | ||
|
||
- marks a sip request when record route is added | ||
--- | ||
parser/msg_parser.h | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/parser/msg_parser.h b/parser/msg_parser.h | ||
index f25bec9..33d0475 100644 | ||
--- a/parser/msg_parser.h | ||
+++ b/parser/msg_parser.h | ||
@@ -122,6 +122,7 @@ typedef enum request_method { | ||
#define FL_TM_RPL_MATCHED (1<<15) /* tm matched reply already */ | ||
#define FL_RPL_SUSPENDED (1<<16) /* for async reply processing */ | ||
#define FL_BODY_MULTIPART (1<<17) /* body modified is multipart */ | ||
+#define FL_RR_ADDED (1<<18) /* Record-Route header was added */ | ||
|
||
/* WARNING: Value (1 << 28) is temporarily reserved for use in kamailio call_control | ||
* module (flag FL_USE_CALL_CONTROL )! */ | ||
-- | ||
2.1.0.rc1 | ||
|
79 changes: 79 additions & 0 deletions
79
debian/patches/upstream/rr-use-internal-msg-flags-to-mark-a-request-with-rec.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
From cc84b46d473236d162a852c3604eacfc88e56ba2 Mon Sep 17 00:00:00 2001 | ||
From: Daniel-Constantin Mierla <miconda@gmail.com> | ||
Date: Tue, 29 Apr 2014 00:01:53 +0200 | ||
Subject: [PATCH] rr: use internal msg flags to mark a request with record | ||
route added | ||
|
||
--- | ||
modules/rr/rr_mod.c | 13 ++++++------- | ||
1 file changed, 6 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/modules/rr/rr_mod.c b/modules/rr/rr_mod.c | ||
index 1628f3b..8a7311d 100644 | ||
--- a/modules/rr/rr_mod.c | ||
+++ b/modules/rr/rr_mod.c | ||
@@ -61,7 +61,6 @@ int enable_socket_mismatch_warning = 1; /*!< enable socket mismatch warning */ | ||
static str custom_user_spec = {NULL, 0}; | ||
pv_spec_t custom_user_avp; | ||
|
||
-static unsigned int last_rr_msg; | ||
ob_api_t rr_obb; | ||
|
||
MODULE_VERSION | ||
@@ -268,7 +267,7 @@ static int w_record_route(struct sip_msg *msg, char *key, char *bar) | ||
{ | ||
str s; | ||
|
||
- if (msg->id == last_rr_msg) { | ||
+ if (msg->msg_flags & FL_RR_ADDED) { | ||
LM_ERR("Double attempt to record-route\n"); | ||
return -1; | ||
} | ||
@@ -280,7 +279,7 @@ static int w_record_route(struct sip_msg *msg, char *key, char *bar) | ||
if ( record_route( msg, key?&s:0 )<0 ) | ||
return -1; | ||
|
||
- last_rr_msg = msg->id; | ||
+ msg->msg_flags |= FL_RR_ADDED; | ||
return 1; | ||
} | ||
|
||
@@ -289,7 +288,7 @@ static int w_record_route_preset(struct sip_msg *msg, char *key, char *key2) | ||
{ | ||
str s; | ||
|
||
- if (msg->id == last_rr_msg) { | ||
+ if (msg->msg_flags & FL_RR_ADDED) { | ||
LM_ERR("Duble attempt to record-route\n"); | ||
return -1; | ||
} | ||
@@ -316,7 +315,7 @@ static int w_record_route_preset(struct sip_msg *msg, char *key, char *key2) | ||
return -1; | ||
|
||
done: | ||
- last_rr_msg = msg->id; | ||
+ msg->msg_flags |= FL_RR_ADDED; | ||
return 1; | ||
} | ||
|
||
@@ -328,7 +327,7 @@ static int w_record_route_advertised_address(struct sip_msg *msg, char *addr, ch | ||
{ | ||
str s; | ||
|
||
- if (msg->id == last_rr_msg) { | ||
+ if (msg->msg_flags & FL_RR_ADDED) { | ||
LM_ERR("Double attempt to record-route\n"); | ||
return -1; | ||
} | ||
@@ -340,7 +339,7 @@ static int w_record_route_advertised_address(struct sip_msg *msg, char *addr, ch | ||
if ( record_route_advertised_address( msg, &s ) < 0) | ||
return -1; | ||
|
||
- last_rr_msg = msg->id; | ||
+ msg->msg_flags |= FL_RR_ADDED; | ||
return 1; | ||
} | ||
|
||
-- | ||
2.1.0.rc1 | ||
|