Module: sip-router
Branch: master
Commit: 9f116e23d8b46b5470dc02f5bf731b61c7516fd8
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9f116e2…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Thu Jan 6 11:14:14 2011 +0200
modules/enum: fixed access to service parameter in enum_query.
---
modules/enum/enum.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/modules/enum/enum.c b/modules/enum/enum.c
index 695beaf..25c4c23 100644
--- a/modules/enum/enum.c
+++ b/modules/enum/enum.c
@@ -730,19 +730,20 @@ int enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2)
*/
int enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service)
{
- str suffix, service;
+ str suffix, *service;
if (get_str_fparam(&suffix, _msg, (fparam_t*)_suffix) != 0) {
LM_ERR("unable to get suffix\n");
return -1;
}
-
- if (get_str_fparam(&service, _msg, (fparam_t*)_service) != 0) {
- LM_ERR("unable to get service\n");
+
+ service = (str*)_service;
+ if ((service == NULL) || (service->len == 0)) {
+ LM_ERR("invalid service parameter");
return -1;
}
- return enum_query(_msg, &suffix, &service);
+ return enum_query(_msg, &suffix, service);
}
@@ -756,6 +757,9 @@ int enum_query(struct sip_msg* _msg, str* suffix, str* service)
char name[MAX_DOMAIN_SIZE];
char string[17];
+ LM_DBG("enum_query on suffix <%.*s> service <%.*s>\n",
+ suffix->len, suffix->s, service->len, service->s);
+
if (parse_sip_msg_uri(_msg) < 0) {
LM_ERR("Parsing of R-URI failed\n");
return -1;