mirror of https://github.com/sipwise/kamailio.git
This reverts commit ded353b576
.
Change-Id: Ic53791222d6b69af6ad36e01be07c89340b19bfc
changes/28/8228/1
parent
ded353b576
commit
5d77f994da
@ -1,67 +0,0 @@
|
||||
From: Victor Seva <linuxmaniac@torreviejawireless.org>
|
||||
Date: Tue, 13 Sep 2016 11:00:34 +0200
|
||||
Subject: sca: sca_handle_subscribe() honor the "$ru" value
|
||||
|
||||
* try to get r-uri from $ru and fallback to msg value as previously
|
||||
|
||||
Change-Id: Ia5878c64d90e1ab1951eaf26e47e71007ac79caa
|
||||
---
|
||||
modules/sca/sca_subscribe.c | 16 ++++++++++++----
|
||||
1 file changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/modules/sca/sca_subscribe.c b/modules/sca/sca_subscribe.c
|
||||
index 9dfb5ce..a0cfb15 100644
|
||||
--- a/modules/sca/sca_subscribe.c
|
||||
+++ b/modules/sca/sca_subscribe.c
|
||||
@@ -990,6 +990,8 @@ sca_subscription_from_request( sca_mod *scam, sip_msg_t *msg, int event_type,
|
||||
str to_tag = STR_NULL;
|
||||
unsigned int expires = 0, max_expires;
|
||||
unsigned int cseq;
|
||||
+ str src_uri = str_init("$ru");
|
||||
+ str ruri = STR_NULL;
|
||||
|
||||
assert( req_sub != NULL );
|
||||
|
||||
@@ -1071,6 +1073,12 @@ sca_subscription_from_request( sca_mod *scam, sip_msg_t *msg, int event_type,
|
||||
to = &tmp_to;
|
||||
}
|
||||
|
||||
+ if (pv_eval_str(msg, &ruri, &src_uri) < 0) {
|
||||
+ LM_ERR("Failed to get $ru value fallback to parse msg\n");
|
||||
+ ruri.s = REQ_LINE(msg).uri.s;
|
||||
+ ruri.len = REQ_LINE(msg).uri.len;
|
||||
+ }
|
||||
+
|
||||
to_tag = to->tag_value;
|
||||
if ( to_tag.s == NULL ) {
|
||||
/*
|
||||
@@ -1080,7 +1088,7 @@ sca_subscription_from_request( sca_mod *scam, sip_msg_t *msg, int event_type,
|
||||
*/
|
||||
if ( scam->sl_api->get_reply_totag( msg, &to_tag ) < 0 ) {
|
||||
LM_ERR( "Failed to generate to-tag for reply to SUBSCRIBE %.*s",
|
||||
- STR_FMT( &REQ_LINE( msg ).uri ));
|
||||
+ STR_FMT( &ruri ));
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -1090,7 +1098,7 @@ sca_subscription_from_request( sca_mod *scam, sip_msg_t *msg, int event_type,
|
||||
LM_ERR( "Failed to parse Record-Route header %.*s in "
|
||||
"SUBSCRIBE %.*s from %.*s",
|
||||
STR_FMT( &msg->record_route->body ),
|
||||
- STR_FMT( &REQ_LINE( msg ).uri ),
|
||||
+ STR_FMT( &ruri ),
|
||||
STR_FMT( &contact_uri ));
|
||||
goto error;
|
||||
}
|
||||
@@ -1098,9 +1106,9 @@ sca_subscription_from_request( sca_mod *scam, sip_msg_t *msg, int event_type,
|
||||
}
|
||||
|
||||
req_sub->subscriber = contact_uri;
|
||||
- if ( sca_uri_extract_aor( &REQ_LINE( msg ).uri, &req_sub->target_aor) < 0) {
|
||||
+ if ( sca_uri_extract_aor( &ruri, &req_sub->target_aor) < 0) {
|
||||
LM_ERR( "Failed to extract AoR from RURI %.*s",
|
||||
- STR_FMT( &REQ_LINE( msg ).uri ));
|
||||
+ STR_FMT( &ruri ));
|
||||
goto error;
|
||||
}
|
||||
req_sub->event = event_type;
|
Loading…
Reference in new issue