Module: kamailio
Branch: master
Commit: 4bbeaad235f8db5216380c3b381071a45d469ee0
URL:
https://github.com/kamailio/kamailio/commit/4bbeaad235f8db5216380c3b381071a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-09-01T21:49:33+02:00
dispatcher: helper function to return dispatcher set
---
Modified: src/modules/dispatcher/dispatch.c
Modified: src/modules/dispatcher/dispatch.h
---
Diff:
https://github.com/kamailio/kamailio/commit/4bbeaad235f8db5216380c3b381071a…
Patch:
https://github.com/kamailio/kamailio/commit/4bbeaad235f8db5216380c3b381071a…
---
diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c
index 9356fe65e1b..f64ab45ab16 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -1598,6 +1598,25 @@ int ds_list_exist(int set)
return 1; /* True */
}
+/*
+ * Return a destination set
+ */
+ds_set_t *ds_list_lookup(int set)
+{
+ ds_set_t *si = NULL;
+ LM_DBG("looking for destination set [%d]\n", set);
+
+ /* get the index of the set */
+ si = ds_avl_find(_ds_list, set);
+
+ if(si == NULL) {
+ LM_DBG("destination set [%d] not found\n", set);
+ return NULL;
+ }
+ LM_DBG("destination set [%d] found\n", set);
+ return si;
+}
+
/**
*
*/
diff --git a/src/modules/dispatcher/dispatch.h b/src/modules/dispatcher/dispatch.h
index 1add2d7000f..7b4d59edb0f 100644
--- a/src/modules/dispatcher/dispatch.h
+++ b/src/modules/dispatcher/dispatch.h
@@ -160,7 +160,6 @@ int ds_log_sets(void);
int ds_list_exist(int set);
int ds_is_active_uri(sip_msg_t *msg, int group, str *uri);
-
int ds_load_unset(struct sip_msg *msg);
int ds_load_update(struct sip_msg *msg);
@@ -278,6 +277,8 @@ struct ds_filter_dest_cb_arg {
ds_set_t *ds_get_list(void);
int ds_get_list_nr(void);
+ds_set_t *ds_list_lookup(int set);
+
int ds_ping_active_init(void);
int ds_ping_active_get(void);
int ds_ping_active_set(int v);