Module: sip-router
Branch: kamailio_3.0
Commit: 839e2fee663846f68289a519c27aef433a872afa
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=839e2fe…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Jan 7 11:33:37 2010 +0100
nathelper(k): fix for swap scenario
A -> RTPP -> B, offer in INVITE, answer in 200 OK (SDP in INVITE+200 OK)
A -> RTPP -> B, re-Invite on session expiry, SDP in 200 OK + ACK
The from-tag and to-tag are not swapped in the ACK with
rtpproxy_answer(). Options "sl" would do the trick also, but "s" is
deprecated soon
Patch by Walter Schober
---
modules_k/nathelper/nathelper.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules_k/nathelper/nathelper.c b/modules_k/nathelper/nathelper.c
index 90fca05..3e66ee4 100644
--- a/modules_k/nathelper/nathelper.c
+++ b/modules_k/nathelper/nathelper.c
@@ -2985,12 +2985,14 @@ force_rtp_proxy(struct sip_msg* msg, char* str1, char* str2, int
offer)
FORCE_RTP_PROXY_RET (-1);
}
create = 0;
- if (swap != 0 || (msg->first_line.type == SIP_REPLY && offer != 0)) {
+ if (swap != 0 || (msg->first_line.type == SIP_REPLY && offer != 0)
+ || (msg->first_line.type == SIP_REQUEST && offer == 0)) {
tmp = from_tag;
from_tag = to_tag;
to_tag = tmp;
}
- } else if (swap != 0 || (msg->first_line.type == SIP_REPLY && offer != 0)) {
+ } else if (swap != 0 || (msg->first_line.type == SIP_REPLY && offer != 0)
+ || (msg->first_line.type == SIP_REQUEST && offer == 0)) {
if (to_tag.len == 0) {
FORCE_RTP_PROXY_RET (-1);
}