Module: sip-router
Branch: master
Commit: aabeca534aebe7953b63884db9bf58e176ce5a6c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=aabeca5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Jan 5 11:15:28 2011 +0100
rls(k): added outbound_proxy parameter
- set SIP uri where to send subscriptions
---
modules_k/rls/rls.c | 5 +++++
modules_k/rls/rls.h | 5 +++--
modules_k/rls/subscribe.c | 2 ++
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/modules_k/rls/rls.c b/modules_k/rls/rls.c
index e932639..cff2a71 100644
--- a/modules_k/rls/rls.c
+++ b/modules_k/rls/rls.c
@@ -148,6 +148,8 @@ str str_doc_type_col = str_init("doc_type");
str str_etag_col = str_init("etag");
str str_doc_col = str_init("doc");
+/* outbound proxy address */
+str outbound_proxy = {0, 0};
/** module functions */
@@ -183,6 +185,7 @@ static param_export_t params[]={
{ "xcap_root", STR_PARAM, &xcap_root
},
/*address and port(default: 80):"http://192.168.2.132:8000/xcap-root"*/
{ "rls_event", STR_PARAM|USE_FUNC_PARAM,(void*)add_rls_event},
+ { "outbound_proxy", STR_PARAM, &outbound_proxy.s
},
{0, 0, 0 }
};
@@ -231,6 +234,8 @@ static int mod_init(void)
LM_ERR("xcap_root parameter not set\n");
return -1;
}
+ if(outbound_proxy.s!=NULL)
+ outbound_proxy.len = strlen(outbound_proxy.s);
/* extract port if any */
if(xcap_root)
{
diff --git a/modules_k/rls/rls.h b/modules_k/rls/rls.h
index 082b12e..0d35fa1 100644
--- a/modules_k/rls/rls.h
+++ b/modules_k/rls/rls.h
@@ -82,8 +82,8 @@ typedef struct rls_resource
extern char* xcap_root;
extern unsigned int xcap_port;
-extern str server_address;
-extern int waitn_time;
+extern str server_address;
+extern int waitn_time;
extern str rlsubs_table;
extern str rlpres_table;
extern str rls_xcap_table;
@@ -95,6 +95,7 @@ extern int rls_max_expires;
extern int rls_integrated_xcap_server;
extern int rls_events;
extern int to_presence_code;
+extern str outbound_proxy;
/* database connection */
extern db1_con_t *rls_db;
diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c
index 783cf87..25c7aa1 100644
--- a/modules_k/rls/subscribe.c
+++ b/modules_k/rls/subscribe.c
@@ -780,6 +780,8 @@ int resource_subscriptions(subs_t* subs, xmlNodePtr rl_node)
}
s.expires= subs->expires;
s.source_flag= RLS_SUBSCRIBE;
+ if(outbound_proxy.s)
+ s.outbound_proxy= &outbound_proxy;
extra_headers.s= buf;
extra_headers.len= sprintf(extra_headers.s,
"Max-Forwards: 70\r\nSupport: eventlist\r\n");