From 387149bb4509fa04c19f71e7bfad587a6c9fc843 Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Wed, 4 Sep 2013 10:07:45 +0000 Subject: Closed #1696: IP change detection (Contact rewrite method) based on REGISTER final response git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4586 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/include/pjsip-ua/sip_regc.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'pjsip/include/pjsip-ua/sip_regc.h') diff --git a/pjsip/include/pjsip-ua/sip_regc.h b/pjsip/include/pjsip-ua/sip_regc.h index 9e393813..80c7a331 100644 --- a/pjsip/include/pjsip-ua/sip_regc.h +++ b/pjsip/include/pjsip-ua/sip_regc.h @@ -83,6 +83,22 @@ struct pjsip_regc_cbparam /** Type declaration for callback to receive registration result. */ typedef void pjsip_regc_cb(struct pjsip_regc_cbparam *param); +/** + * Structure to hold parameters when calling application's callback + * specified in #pjsip_regc_set_reg_tsx_cb(). + * To update contact address, application can set the field contact_cnt + * and contact inside the callback. + */ +struct pjsip_regc_tsx_cb_param +{ + struct pjsip_regc_cbparam cbparam; + int contact_cnt; + pj_str_t contact[PJSIP_REGC_MAX_CONTACT]; +}; + +/** Type declaration for callback set in #pjsip_regc_set_reg_tsx_cb(). */ +typedef void pjsip_regc_tsx_cb(struct pjsip_regc_tsx_cb_param *param); + /** * Client registration information. */ @@ -190,6 +206,21 @@ PJ_DECL(pj_status_t) pjsip_regc_init(pjsip_regc *regc, const pj_str_t contact[], pj_uint32_t expires); +/** + * Set callback to be called when the registration received a final response. + * This callback is different with the one specified during creation via + * #pjsip_regc_create(). This callback will be called for any final response + * (including 401/407/423) and before any subsequent requests are sent. + * In case of unregistration, this callback will not be called. + * + * @param regc The client registration structure. + * @param tsx_cb Pointer to callback function to receive registration status. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_regc_set_reg_tsx_cb(pjsip_regc *regc, + pjsip_regc_tsx_cb *tsx_cb); + /** * Set the "sent-by" field of the Via header for outgoing requests. * -- cgit v1.2.3