From 2d070d8d5de58091274a7c096b44982059ebae98 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 21 May 2007 13:48:35 +0000 Subject: Ticket #283: Added another pjsua IM callback with the message passed as argument (thanks Paul Levin) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1285 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/include/pjsua-lib/pjsua.h | 22 ++++++++++++++++++++++ pjsip/src/pjsua-lib/pjsua_im.c | 6 +++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index 9f2450b0..0b421046 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -748,6 +748,9 @@ typedef struct pjsua_callback * Argument call_id will be -1 if MESSAGE request is not related to an * existing call. * + * See also \a on_pager2() callback for the version with \a pjsip_rx_data + * passed as one of the argument. + * * @param call_id Containts the ID of the call where the IM was * sent, or PJSUA_INVALID_ID if the IM was sent * outside call context. @@ -774,6 +777,25 @@ typedef struct pjsua_callback const pj_str_t *to, const pj_str_t *contact, const pj_str_t *mime_type, const pj_str_t *body); + /** + * This is the alternative version of the \a on_pager() callback with + * \a pjsip_rx_data argument. + * + * @param call_id Containts the ID of the call where the IM was + * sent, or PJSUA_INVALID_ID if the IM was sent + * outside call context. + * @param from URI of the sender. + * @param to URI of the destination message. + * @param contact The Contact URI of the sender, if present. + * @param mime_type MIME type of the message. + * @param body The message content. + * @param rdata The incoming MESSAGE request. + */ + void (*on_pager2)(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *body, + pjsip_rx_data *rdata); + /** * Notify application about the delivery status of outgoing pager * request. diff --git a/pjsip/src/pjsua-lib/pjsua_im.c b/pjsip/src/pjsua-lib/pjsua_im.c index 44b771f6..81fed481 100644 --- a/pjsip/src/pjsua-lib/pjsua_im.c +++ b/pjsip/src/pjsua-lib/pjsua_im.c @@ -209,8 +209,12 @@ void pjsua_im_process_pager(int call_id, const pj_str_t *from, (*pjsua_var.ua_cfg.cb.on_pager)(call_id, from, to, &contact, &mime_type, &text_body); } - } + if (pjsua_var.ua_cfg.cb.on_pager2) { + (*pjsua_var.ua_cfg.cb.on_pager2)(call_id, from, to, &contact, + &mime_type, &text_body, rdata); + } + } } -- cgit v1.2.3