Module: sip-router
Branch: carstenbock/ims
Commit: 59206b14e1cbd4c3f62c53ae1978dba89af2bade
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=59206b1…
Author: Carsten Bock <carsten(a)bock.info>
Committer: Carsten Bock <carsten(a)bock.info>
Date: Thu Jan 13 23:01:21 2011 +0100
- Need to call "parse_rr()" in order to retrieve the parsed content ;-)
---
modules_k/rr/rr_mod.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules_k/rr/rr_mod.c b/modules_k/rr/rr_mod.c
index 9f2ccba..7608e04 100644
--- a/modules_k/rr/rr_mod.c
+++ b/modules_k/rr/rr_mod.c
@@ -318,7 +318,12 @@ pv_get_route_uri_f(struct sip_msg *msg, pv_param_t *param,
rr_t* rt;
str uri;
- /* Parse the header until the First-Route-Header: */
+ if (!msg) {
+ LM_ERR("No message?!?\n");
+ return -1;
+ }
+
+ /* Parse the message until the First-Route-Header: */
if (parse_headers(msg, HDR_ROUTE_F, 0) == -1) {
LM_ERR("while parsing message\n");
return -1;
@@ -328,9 +333,16 @@ pv_get_route_uri_f(struct sip_msg *msg, pv_param_t *param,
LM_INFO("No route header present.\n");
return -1;
}
+ hdr = msg->route;
+
+ /* Parse the contents of the header: */
+ if (parse_rr(hdr) == -1) {
+ LM_ERR("Error while parsing Route header\n");
+ return -1;
+ }
+
/* Retrieve the Route-Header */
- hdr = msg->route;
rt = (rr_t*)hdr->parsed;
uri = rt->nameaddr.uri;