From b3c787d1ddd36eb7dfa0906b92a83ab23d8741cd Mon Sep 17 00:00:00 2001 From: Alexei Gradinari Date: Thu, 2 Jun 2016 18:26:09 -0400 Subject: res_pjsip: improve realtime performance #2 The patch removes updating all Endpoints' status on startup. Instead, only non-qualified aors with static contact and non-qualified non-expired contacts are retrieved from the realtime to update the endpoint status to ONLINE. The endpoint name was added to the contact object to simply find the endpoint that created this contact. The status of endpoints with qualified aors will be updated by 'qualify' functions. ASTERISK-26061 #close Change-Id: Id324c1776fa55d3741e0c5457ecac0304cb1a0df --- include/asterisk/res_pjsip.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index b64ad624b..4319dbdb6 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -256,6 +256,8 @@ struct ast_sip_contact { int via_port; /*! Content of the Call-ID header in REGISTER request */ AST_STRING_FIELD_EXTENDED(call_id); + /*! The name of the endpoint that added the contact */ + AST_STRING_FIELD_EXTENDED(endpoint_name); }; #define CONTACT_STATUS "contact_status" @@ -985,6 +987,16 @@ void ast_sip_unregister_endpoint_identifier(struct ast_sip_endpoint_identifier * */ void *ast_sip_endpoint_alloc(const char *name); +/*! + * \brief Change state of a persistent endpoint. + * + * \param endpoint The SIP endpoint name to change state. + * \param state The new state + * \retval 0 Success + * \retval -1 Endpoint not found + */ +int ast_sip_persistent_endpoint_update_state(const char *endpoint_name, enum ast_endpoint_state state); + /*! * \brief Get a pointer to the PJSIP endpoint. * -- cgit v1.2.3