[sr-dev] git:master:8c5432e5: presence: new parameter to set the order by string for fetching records

Daniel-Constantin Mierla miconda at gmail.com
Thu Jun 2 08:41:45 CEST 2016


Module: kamailio
Branch: master
Commit: 8c5432e5285564d6104189d6358774b8d8f3382b
URL: https://github.com/kamailio/kamailio/commit/8c5432e5285564d6104189d6358774b8d8f3382b

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-06-02T08:34:16+02:00

presence: new parameter to set the order by string for fetching records

- used when retrieve_order is 1
- new param: retrieve_order_by - default value is 'priority'

---

Modified: modules/presence/notify.c
Modified: modules/presence/presence.c
Modified: modules/presence/presence.h
Modified: modules/presence/presentity.c

---

Diff:  https://github.com/kamailio/kamailio/commit/8c5432e5285564d6104189d6358774b8d8f3382b.diff
Patch: https://github.com/kamailio/kamailio/commit/8c5432e5285564d6104189d6358774b8d8f3382b.patch

---

diff --git a/modules/presence/notify.c b/modules/presence/notify.c
index 93d4274..2a9b4d7 100644
--- a/modules/presence/notify.c
+++ b/modules/presence/notify.c
@@ -660,7 +660,7 @@ str* get_p_notify_body(str pres_uri, pres_ev_t* event, str* etag,
 	}
 
 	if(pres_retrieve_order==1) {
-		query_str = str_priority_col;
+		query_str = pres_retrieve_order_by;
 	} else {
 		query_str = str_received_time_col;
 	}
diff --git a/modules/presence/presence.c b/modules/presence/presence.c
index 0b62527..fe40745 100644
--- a/modules/presence/presence.c
+++ b/modules/presence/presence.c
@@ -161,6 +161,7 @@ int pres_notifier_processes = 1;
 int pres_force_delete = 0;
 str pres_xavp_cfg = {0};
 int pres_retrieve_order = 0;
+str pres_retrieve_order_by = str_init("priority");
 
 int db_table_lock_type = 1;
 db_locking_t db_table_lock = DB_LOCKING_WRITE;
@@ -224,6 +225,7 @@ static param_export_t params[]={
 	{ "subs_remove_match",      PARAM_INT, &pres_subs_remove_match},
 	{ "xavp_cfg",               PARAM_STR, &pres_xavp_cfg},
 	{ "retrieve_order",         PARAM_INT, &pres_retrieve_order},
+	{ "retrieve_order_by",      PARAM_STR, &pres_retrieve_order_by},
 	{ "sip_uri_match",          PARAM_INT, &pres_uri_match},
 	{0,0,0}
 };
diff --git a/modules/presence/presence.h b/modules/presence/presence.h
index 1f11073..0068c9b 100644
--- a/modules/presence/presence.h
+++ b/modules/presence/presence.h
@@ -91,6 +91,7 @@ extern int pres_notifier_processes;
 extern int pres_force_delete;
 extern str pres_xavp_cfg;
 extern int pres_retrieve_order;
+extern str pres_retrieve_order_by;
 
 extern int phtable_size;
 extern phtable_t* pres_htable;
diff --git a/modules/presence/presentity.c b/modules/presence/presentity.c
index 71adc36..8b0472b 100644
--- a/modules/presence/presentity.c
+++ b/modules/presence/presentity.c
@@ -1149,7 +1149,7 @@ char* get_sphere(str* pres_uri)
 	}
 
 	if(pres_retrieve_order==1) {
-		query_str = str_priority_col;
+		query_str = pres_retrieve_order_by;
 	} else {
 		query_str = str_received_time_col;
 	}




More information about the sr-dev mailing list