diff options
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 22 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_im.c | 6 |
2 files changed, 27 insertions, 1 deletions
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. @@ -775,6 +778,25 @@ typedef struct pjsua_callback 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); + } + } } |