Browse code

keepalive: use dedicated wrappers for kemi exports

Daniel-Constantin Mierla authored on 09/01/2020 16:09:28
Showing 1 changed files
... ...
@@ -188,6 +188,18 @@ static int w_add_destination(sip_msg_t *msg, char *uri, char *owner)
188 188
 
189 189
 	return ka_add_dest(&suri, &sowner, 0, 0, 0);
190 190
 }
191
+
192
+/*!
193
+ *
194
+ */
195
+static int ki_add_destination(sip_msg_t *msg, str *uri, str *owner)
196
+{
197
+	if(ka_alloc_destinations_list() < 0)
198
+		return -1;
199
+
200
+	return ka_add_dest(uri, owner, 0, 0, 0);
201
+}
202
+
191 203
 /*!
192 204
 * @function w_del_destination_f
193 205
 * @abstract deletes given sip uri in allocated destination stack as named ka_alloc_destinations_list
... ...
@@ -214,6 +226,14 @@ static int w_del_destination(sip_msg_t *msg, char *uri, char *owner)
214 226
 	return ka_del_destination(&suri, &sowner);
215 227
 }
216 228
 
229
+/*!
230
+ *
231
+ */
232
+static int ki_del_destination(sip_msg_t *msg, str *uri, str *owner)
233
+{
234
+	return ka_del_destination(uri, owner);
235
+}
236
+
217 237
 /*
218 238
  * Function callback executer per module param "destination".
219 239
  * Is just a wrapper to ka_add_dest() api function
... ...
@@ -290,12 +310,12 @@ static sr_kemi_t sr_kemi_keepalive_exports[] = {
290 310
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
291 311
 	},
292 312
 	{ str_init("keepalive"), str_init("add_destination"),
293
-		SR_KEMIP_INT, ka_add_dest,
294
-		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_INT,
295
-			SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE }
313
+		SR_KEMIP_INT, ki_add_destination,
314
+		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
315
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
296 316
 	},
297 317
 	{ str_init("keepalive"), str_init("del_destination"),
298
-		SR_KEMIP_INT, ka_del_destination,
318
+		SR_KEMIP_INT, ki_del_destination,
299 319
 		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
300 320
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
301 321
 	},