summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-04-17 15:33:29 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-04-17 15:33:29 -0500
commitbb347fa594e195c79cbda45cb55fde3e72f90f9c (patch)
tree11f9736c7a608f6d82aa0c7da3f857bda8255168 /include
parentfd823252e35bf54a7e5ded38cc28a60990fad5ed (diff)
parentc6ed681638f5e481001839712fe2d6d5e1fa526c (diff)
Merge topic 'ASTERISK-24863'
* changes: res_pjsip: Add global option to limit the maximum time for initial qualifies pjsip_options: Add qualify_timeout processing and eventing res_pjsip: Refactor endpt_send_request to include transaction timeout
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/endpoints.h10
-rw-r--r--include/asterisk/res_pjsip.h47
2 files changed, 57 insertions, 0 deletions
diff --git a/include/asterisk/endpoints.h b/include/asterisk/endpoints.h
index 663dd94d9..c9cb6b9de 100644
--- a/include/asterisk/endpoints.h
+++ b/include/asterisk/endpoints.h
@@ -160,6 +160,16 @@ const char *ast_endpoint_get_resource(const struct ast_endpoint *endpoint);
const char *ast_endpoint_get_id(const struct ast_endpoint *endpoint);
/*!
+ * \brief Gets the state of the given endpoint.
+ *
+ * \param endpoint The endpoint.
+ * \return state.
+ * \return \c AST_ENDPOINT_UNKNOWN if endpoint is \c NULL.
+ * \since 13.4
+ */
+enum ast_endpoint_state ast_endpoint_get_state(const struct ast_endpoint *endpoint);
+
+/*!
* \brief Updates the state of the given endpoint.
*
* \param endpoint Endpoint to modify.
diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h
index 2358a7281..99b65ab08 100644
--- a/include/asterisk/res_pjsip.h
+++ b/include/asterisk/res_pjsip.h
@@ -166,6 +166,8 @@ struct ast_sip_contact {
unsigned int qualify_frequency;
/*! If true authenticate the qualify if needed */
int authenticate_qualify;
+ /*! Qualify timeout. 0 is diabled. */
+ double qualify_timeout;
};
#define CONTACT_STATUS "contact_status"
@@ -192,6 +194,8 @@ struct ast_sip_contact_status {
struct timeval rtt_start;
/*! The round trip time in microseconds */
int64_t rtt;
+ /*! Last status for a contact (default - unavailable) */
+ enum ast_sip_contact_status_type last_status;
};
/*!
@@ -224,6 +228,8 @@ struct ast_sip_aor {
struct ao2_container *permanent_contacts;
/*! Determines whether SIP Path headers are supported */
unsigned int support_path;
+ /*! Qualify timeout. 0 is diabled. */
+ double qualify_timeout;
};
/*!
@@ -905,6 +911,15 @@ struct ao2_container *ast_sip_location_retrieve_aor_contacts(const struct ast_si
struct ast_sip_contact *ast_sip_location_retrieve_contact_from_aor_list(const char *aor_list);
/*!
+ * \brief Retrieve all contacts from a list of AORs
+ *
+ * \param aor_list A comma-separated list of AOR names
+ * \retval NULL if no contacts available
+ * \retval non-NULL container (which must be freed) if contacts available
+ */
+struct ao2_container *ast_sip_location_retrieve_contacts_from_aor_list(const char *aor_list);
+
+/*!
* \brief Retrieve the first bound contact AND the AOR chosen from a list of AORs
*
* \param aor_list A comma-separated list of AOR names
@@ -1260,6 +1275,30 @@ int ast_sip_send_request(pjsip_tx_data *tdata, struct pjsip_dialog *dlg,
void (*callback)(void *token, pjsip_event *e));
/*!
+ * \brief General purpose method for sending an Out-Of-Dialog SIP request
+ *
+ * This is a companion function for \ref ast_sip_create_request. The request
+ * created there can be passed to this function, though any request may be
+ * passed in.
+ *
+ * This will automatically set up handling outbound authentication challenges if
+ * they arrive.
+ *
+ * \param tdata The request to send
+ * \param endpoint Optional. If specified, the out-of-dialog request is sent to the endpoint.
+ * \param timeout. If non-zero, after the timeout the transaction will be terminated
+ * and the callback will be called with the PJSIP_EVENT_TIMER type.
+ * \param token Data to be passed to the callback upon receipt of out-of-dialog response.
+ * \param callback Callback to be called upon receipt of out-of-dialog response.
+ *
+ * \retval 0 Success
+ * \retval -1 Failure (out-of-dialog callback will not be called.)
+ */
+int ast_sip_send_out_of_dialog_request(pjsip_tx_data *tdata,
+ struct ast_sip_endpoint *endpoint, int timeout, void *token,
+ void (*callback)(void *token, pjsip_event *e));
+
+/*!
* \brief General purpose method for creating a SIP response
*
* Its typical use would be to create responses for out of dialog
@@ -1956,4 +1995,12 @@ char *ast_sip_get_endpoint_identifier_order(void);
*/
unsigned int ast_sip_get_keep_alive_interval(void);
+/*!
+ * \brief Retrieve the system max initial qualify time.
+ *
+ * \retval the maximum initial qualify time.
+ */
+unsigned int ast_sip_get_max_initial_qualify_time(void);
+
+
#endif /* _RES_PJSIP_H */