summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsua-lib
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-10-26 11:21:37 +0000
committerBenny Prijono <bennylp@teluu.com>2009-10-26 11:21:37 +0000
commit058d9c4c6d15338e1d3b2e05ffea340eec565d9a (patch)
treef2e22ada6b8929a60cf842f83a870c1a3d2bd921 /pjsip/include/pjsua-lib
parent295cdeb355d07347f2ba1f4a66ae144fee5efbf7 (diff)
Implement ticket #982: Support for SIP Message Summary/Message Waiting Indication (MWI, RFC 3842)
- PJSIP-SIMPLE: - implement MWI - PJSUA-LIB: - added "mwi_enabled" flag in account config - added "on_mwi_info" callback - pjsua app: - added "--mwi" option to enable MWI on account - added simple callback to log the NOTIFY message - other: - added SIPp scenario files to simulate UAS side - build: - added MWI support on VS6, VS2005, MMP, and Makefile git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2968 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsua-lib')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h30
-rw-r--r--pjsip/include/pjsua-lib/pjsua_internal.h7
2 files changed, 37 insertions, 0 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 356cab76..a8bb2f39 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -379,6 +379,17 @@ PJ_DECL(void) pjsua_logging_config_dup(pj_pool_t *pool,
/**
+ * Structure to be passed on MWI callback.
+ */
+typedef struct pjsua_mwi_info
+{
+ pjsip_evsub *evsub; /**< Event subscription session, for
+ reference. */
+ pjsip_rx_data *rdata; /**< The received NOTIFY request. */
+} pjsua_mwi_info;
+
+
+/**
* This structure describes application callback to receive various event
* notification from PJSUA-API. All of these callbacks are OPTIONAL,
* although definitely application would want to implement some of
@@ -821,6 +832,17 @@ typedef struct pjsua_callback
const pjsip_uri *target,
const pjsip_event *e);
+ /**
+ * This callback is called when a NOTIFY request for message summary /
+ * message waiting indication is received.
+ *
+ * @param acc_id The account ID.
+ * @param mwi_info Structure containing details of the event,
+ * including the received NOTIFY request in the
+ * \a rdata field.
+ */
+ void (*on_mwi_info)(pjsua_acc_id acc_id, pjsua_mwi_info *mwi_info);
+
} pjsua_callback;
@@ -1860,6 +1882,14 @@ typedef struct pjsua_acc_config
pj_str_t reg_uri;
/**
+ * Enable message summary and message waiting indication subscription
+ * (RFC 3842) for this account.
+ *
+ * Default: no
+ */
+ pj_bool_t mwi_enabled;
+
+ /**
* If this flag is set, the presence information of this account will
* be PUBLISH-ed to the server where the account belongs.
*
diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h
index 0f777967..c90da124 100644
--- a/pjsip/include/pjsua-lib/pjsua_internal.h
+++ b/pjsip/include/pjsua-lib/pjsua_internal.h
@@ -144,6 +144,8 @@ typedef struct pjsua_acc
pjsip_publishc *publish_sess; /**< Client publication session. */
pj_bool_t publish_state; /**< Last published online status */
+ pjsip_evsub *mwi_sub; /**< MWI client subscription */
+ pjsip_dialog *mwi_dlg; /**< Dialog for MWI sub. */
} pjsua_acc;
@@ -452,6 +454,11 @@ void pjsua_pres_delete_acc(int acc_id);
pj_status_t pjsua_im_init(void);
/**
+ * Start MWI subscription
+ */
+void pjsua_start_mwi(pjsua_acc *acc);
+
+/**
* Init call subsystem.
*/
pj_status_t pjsua_call_subsys_init(const pjsua_config *cfg);