diff options
author | Liong Sauw Ming <ming@teluu.com> | 2013-09-04 10:07:45 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2013-09-04 10:07:45 +0000 |
commit | 387149bb4509fa04c19f71e7bfad587a6c9fc843 (patch) | |
tree | cd79753bfc6b686453f354e4f9c4161beed2ce04 /pjsip/include/pjsip-ua/sip_regc.h | |
parent | ef6704f279e8a331a8783f067bec99718940c83a (diff) |
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
Diffstat (limited to 'pjsip/include/pjsip-ua/sip_regc.h')
-rw-r--r-- | pjsip/include/pjsip-ua/sip_regc.h | 31 |
1 files changed, 31 insertions, 0 deletions
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 @@ -84,6 +84,22 @@ struct pjsip_regc_cbparam 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. */ struct pjsip_regc_info @@ -191,6 +207,21 @@ PJ_DECL(pj_status_t) pjsip_regc_init(pjsip_regc *regc, 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. * * @param regc The client registration structure. |