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 214
 	return ka_del_destination(&suri, &sowner);
215 215
 }
216 216
 
217
+/*!
218
+ *
219
+ */
220
+static int ki_del_destination(sip_msg_t *msg, str *uri, str *owner)
221
+{
222
+	return ka_del_destination(uri, owner);
223
+}
224
+
217 225
 /*
218 226
  * Function callback executer per module param "destination".
219 227
  * Is just a wrapper to ka_add_dest() api function
... ...
@@ -290,12 +310,12 @@ static sr_kemi_t sr_kemi_keepalive_exports[] = {
290 290
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
291 291
 	},
292 292
 	{ 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 }
293
+		SR_KEMIP_INT, ki_add_destination,
294
+		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
295
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
296 296
 	},
297 297
 	{ str_init("keepalive"), str_init("del_destination"),
298
-		SR_KEMIP_INT, ka_del_destination,
298
+		SR_KEMIP_INT, ki_del_destination,
299 299
 		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
300 300
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
301 301
 	},