Initial commit for ticket #937: Revamping of presence management to make it more efficient
Presence enhancements:
- finer grained buddy lock object, instead of using global PJSUA-LIB's mutex
- individual resubscription timer for buddies and also add random delay interval so that resubscriptions don't happen simultaneously (may hog processing and bandwidth).
- in general reduced the use of global PJSUA-LIB's mutex for more efficiency
- added last termination code in buddy info
- use the RPID note's text for buddy's offline status rather than the default "offline" status, if available
- resubscribe automatically on several termination causes as explained in the ticket (still untested)
General enhancements:
- added pjsua_schedule_timer() and pjsua_cancel_timer() APIs
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2956 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c
index f5e0fba..773785e 100644
--- a/pjsip/src/pjsua-lib/pjsua_core.c
+++ b/pjsip/src/pjsua-lib/pjsua_core.c
@@ -2318,6 +2318,23 @@
return p ? 0 : -1;
}
+/*
+ * Schedule a timer entry.
+ */
+PJ_DEF(pj_status_t) pjsua_schedule_timer( pj_timer_entry *entry,
+ const pj_time_val *delay)
+{
+ return pjsip_endpt_schedule_timer(pjsua_var.endpt, entry, delay);
+}
+
+/*
+ * Cancel the previously scheduled timer.
+ *
+ */
+PJ_DEF(void) pjsua_cancel_timer(pj_timer_entry *entry)
+{
+ pjsip_endpt_cancel_timer(pjsua_var.endpt, entry);
+}
/**
* Normalize route URI (check for ";lr" and append one if it doesn't