summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsua-lib
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-08-25 13:36:15 +0000
committerBenny Prijono <bennylp@teluu.com>2007-08-25 13:36:15 +0000
commitdd175b64509a079ee5167a397dc8b7b0ac3ced99 (patch)
treeec2bf9601c8605bb4e221c53c71536f4ff0344ba /pjsip/include/pjsua-lib
parentbcd742c4466d6cf4e7d465c16e71c17e0e326dc3 (diff)
Implement ticket #336: custom presence status in NOTIFY/PUBLISH, supporting subset of RPID elements
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1424 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsua-lib')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h40
-rw-r--r--pjsip/include/pjsua-lib/pjsua_internal.h6
2 files changed, 44 insertions, 2 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index d6af018d..ad89a037 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -1918,6 +1918,16 @@ typedef struct pjsua_acc_info
pj_bool_t online_status;
/**
+ * Presence online status text.
+ */
+ pj_str_t online_status_text;
+
+ /**
+ * Extended RPID online status information.
+ */
+ pjrpid_element rpid;
+
+ /**
* Buffer that is used internally to store the status text.
*/
char buf_[PJ_ERR_MSG_SIZE];
@@ -2080,7 +2090,10 @@ PJ_DECL(pj_status_t) pjsua_acc_modify(pjsua_acc_id acc_id,
/**
* Modify account's presence status to be advertised to remote/presence
* subscribers. This would trigger the sending of outgoing NOTIFY request
- * if there are server side presence subscription for this account.
+ * if there are server side presence subscription for this account, and/or
+ * outgoing PUBLISH if presence publication is enabled for this account.
+ *
+ * @see pjsua_acc_set_online_status2()
*
* @param acc_id The account ID.
* @param is_online True of false.
@@ -2095,6 +2108,24 @@ PJ_DECL(pj_status_t) pjsua_acc_modify(pjsua_acc_id acc_id,
PJ_DECL(pj_status_t) pjsua_acc_set_online_status(pjsua_acc_id acc_id,
pj_bool_t is_online);
+/**
+ * Modify account's presence status to be advertised to remote/presence
+ * subscribers. This would trigger the sending of outgoing NOTIFY request
+ * if there are server side presence subscription for this account, and/or
+ * outgoing PUBLISH if presence publication is enabled for this account.
+ *
+ * @see pjsua_acc_set_online_status()
+ *
+ * @param acc_id The account ID.
+ * @param is_online True of false.
+ * @param pr Extended information in subset of RPID format
+ * which allows setting custom presence text.
+ *
+ * @return PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pjsua_acc_set_online_status2(pjsua_acc_id acc_id,
+ pj_bool_t is_online,
+ const pjrpid_element *pr);
/**
* Update registration or perform unregistration. If registration is
@@ -2988,9 +3019,14 @@ typedef struct pjsua_buddy_info
pj_bool_t monitor_pres;
/**
+ * Extended RPID information about the person.
+ */
+ pjrpid_element rpid;
+
+ /**
* Internal buffer.
*/
- char buf_[256];
+ char buf_[512];
} pjsua_buddy_info;
diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h
index ca9ea658..de6be5d3 100644
--- a/pjsip/include/pjsua-lib/pjsua_internal.h
+++ b/pjsip/include/pjsua-lib/pjsua_internal.h
@@ -95,6 +95,7 @@ typedef struct pjsua_acc
pjsip_cred_info cred[PJSUA_ACC_MAX_PROXIES]; /**< Complete creds. */
pj_bool_t online_status; /**< Our online status. */
+ pjrpid_element rpid; /**< RPID element information. */
pjsua_srv_pres pres_srv_list; /**< Server subscription list. */
pjsip_publishc *publish_sess; /**< Client publication session. */
pj_bool_t publish_state; /**< Last published online status */
@@ -320,6 +321,11 @@ pj_status_t pjsua_pres_start(void);
void pjsua_pres_refresh(void);
/*
+ * Update server subscription (e.g. when our online status has changed)
+ */
+void pjsua_pres_update_acc(int acc_id, pj_bool_t force);
+
+/*
* Shutdown presence.
*/
void pjsua_pres_shutdown(void);