summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsip/sip_endpoint.h
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip/include/pjsip/sip_endpoint.h')
-rw-r--r--pjsip/include/pjsip/sip_endpoint.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/pjsip/include/pjsip/sip_endpoint.h b/pjsip/include/pjsip/sip_endpoint.h
index e957271c..c6cf6d65 100644
--- a/pjsip/include/pjsip/sip_endpoint.h
+++ b/pjsip/include/pjsip/sip_endpoint.h
@@ -62,6 +62,13 @@ PJ_BEGIN_DECL
* @{
*/
+
+/**
+ * Type of callback to register to pjsip_endpt_atexit().
+ */
+typedef void (*pjsip_endpt_exit_callback)(pjsip_endpoint *endpt);
+
+
/**
* Create an instance of SIP endpoint from the specified pool factory.
* The pool factory reference then will be kept by the endpoint, so that
@@ -511,6 +518,21 @@ PJ_DECL(const pjsip_hdr*) pjsip_endpt_get_request_headers(pjsip_endpoint *e);
PJ_DECL(void) pjsip_endpt_dump( pjsip_endpoint *endpt, pj_bool_t detail );
+/**
+ * Register cleanup function to be called by SIP endpoint when
+ * #pjsip_endpt_destroy() is called. Note that application should not
+ * use or access any endpoint resource (such as pool, ioqueue, timer heap)
+ * from within the callback as such resource may have been released when
+ * the callback function is invoked.
+ *
+ * @param endpt The SIP endpoint.
+ * @param func The function to be registered.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjsip_endpt_atexit(pjsip_endpoint *endpt,
+ pjsip_endpt_exit_callback func);
+
/**
* @}