Browse code

rls(k): added outbound_proxy parameter

- set SIP uri where to send subscriptions

Daniel-Constantin Mierla authored on 05/01/2011 10:15:28
Showing 3 changed files
... ...
@@ -148,6 +148,8 @@ str str_doc_type_col = str_init("doc_type");
148 148
 str str_etag_col = str_init("etag");
149 149
 str str_doc_col = str_init("doc");
150 150
 
151
+/* outbound proxy address */
152
+str outbound_proxy = {0, 0};
151 153
 
152 154
 /** module functions */
153 155
 
... ...
@@ -183,6 +185,7 @@ static param_export_t params[]={
183 185
 	{ "xcap_root",              STR_PARAM,   &xcap_root                      },
184 186
 	/*address and port(default: 80):"http://192.168.2.132:8000/xcap-root"*/
185 187
 	{ "rls_event",              STR_PARAM|USE_FUNC_PARAM,(void*)add_rls_event},
188
+	{ "outbound_proxy",         STR_PARAM,   &outbound_proxy.s               },
186 189
 	{0,							0,				0						     }
187 190
 };
188 191
 
... ...
@@ -231,6 +234,8 @@ static int mod_init(void)
231 234
 		LM_ERR("xcap_root parameter not set\n");
232 235
 		return -1;
233 236
 	}
237
+	if(outbound_proxy.s!=NULL)
238
+		outbound_proxy.len = strlen(outbound_proxy.s);
234 239
 	/* extract port if any */
235 240
 	if(xcap_root)
236 241
     {
... ...
@@ -82,8 +82,8 @@ typedef struct rls_resource
82 82
 
83 83
 extern char* xcap_root;
84 84
 extern unsigned int xcap_port;
85
-extern str server_address; 
86
-extern int waitn_time; 
85
+extern str server_address;
86
+extern int waitn_time;
87 87
 extern str rlsubs_table;
88 88
 extern str rlpres_table;
89 89
 extern str rls_xcap_table;
... ...
@@ -95,6 +95,7 @@ extern int rls_max_expires;
95 95
 extern int rls_integrated_xcap_server;
96 96
 extern int rls_events;
97 97
 extern int to_presence_code;
98
+extern str outbound_proxy;
98 99
 
99 100
 /* database connection */
100 101
 extern db1_con_t *rls_db;
... ...
@@ -780,6 +780,8 @@ int resource_subscriptions(subs_t* subs, xmlNodePtr rl_node)
780 780
 	}
781 781
 	s.expires= subs->expires;
782 782
 	s.source_flag= RLS_SUBSCRIBE;
783
+	if(outbound_proxy.s)
784
+		s.outbound_proxy= &outbound_proxy;
783 785
 	extra_headers.s= buf;
784 786
 	extra_headers.len= sprintf(extra_headers.s,
785 787
 			"Max-Forwards: 70\r\nSupport: eventlist\r\n");