TT#2387 sca: sca_handle_subscribe() get actual ruri

Change-Id: I976ee6c90f440fad1aaa4f45e3cdd3b1cc24e63f
changes/37/8237/3
Victor Seva 9 years ago
parent 5d77f994da
commit 7e92049ce6

@ -25,4 +25,5 @@ sipwise/rtpengine_next_branch_parm.patch
sipwise/sca_add_onhold_bflag.patch
sipwise/sca-use-kamailio-module-interface.patch
sipwise/sca-sca_call_info_update-add-to-from-optional-parame.patch
sipwise/sca-sca_handle_subscribe-honor-the-ru-value.patch
##

@ -0,0 +1,64 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Tue, 13 Sep 2016 11:00:34 +0200
Subject: sca: sca_handle_subscribe() get actual ruri
Change-Id: Ia5878c64d90e1ab1951eaf26e47e71007ac79caa
---
modules/sca/sca_subscribe.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/modules/sca/sca_subscribe.c b/modules/sca/sca_subscribe.c
index 9dfb5ce..26ae6aa 100644
--- a/modules/sca/sca_subscribe.c
+++ b/modules/sca/sca_subscribe.c
@@ -990,6 +990,7 @@ 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 *ruri = NULL;
assert( req_sub != NULL );
@@ -1071,6 +1072,12 @@ sca_subscription_from_request( sca_mod *scam, sip_msg_t *msg, int event_type,
to = &tmp_to;
}
+ if (parse_sip_msg_uri(msg) < 0) {
+ LM_ERR("Error while parsing the Request-URI\n");
+ goto error;
+ }
+ ruri = GET_RURI(msg);
+
to_tag = to->tag_value;
if ( to_tag.s == NULL ) {
/*
@@ -1080,7 +1087,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 +1097,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 +1105,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…
Cancel
Save