diff options
author | Richard Mudgett <rmudgett@digium.com> | 2014-02-06 17:55:45 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2014-02-06 17:55:45 +0000 |
commit | b5ca213e34055724a5cd669938e356569847edcb (patch) | |
tree | ae81ec8dc3add7c1ed3cb94c361a205e94a3bcd7 /include/asterisk | |
parent | 8ff02ac951c979b1e5e340b3b1cc05736780be20 (diff) |
res_pjsip: Updates and adds more PJSIP CLI commands.
* Adds identify, transport, and registration support to the PJSIP CLI.
* Creates three additional callbacks, one for an iterator, one for a
comparator, and one for a container. This eliminates the link dependency
from higher level modules to lower level ones.
* Eliminates duplicate sorting in PJSIP CLI commands.
* Cleans up PJSIP CLI output formatting.
* Pushes CLI command registration down to the implementing source file.
* Adds several ast_sip_destroy_sorcery functions to complement existing
ast_sip_sorcery_initialize functions. The destroy functions unregister
PJSIP CLI commands and PJSIP CLI formatters.
Reported by: George Joseph
Review: https://reviewboard.asterisk.org/r/3104/
........
Merged revisions 407568 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/res_pjsip.h | 53 | ||||
-rw-r--r-- | include/asterisk/res_pjsip_cli.h | 8 |
2 files changed, 35 insertions, 26 deletions
diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index ecec12d05..82f942ba1 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -221,17 +221,6 @@ struct ast_sip_aor { }; /*! - * \brief Aor/Contact pair used for ast_sip_for_each_contact callback. - */ -struct ast_sip_aor_contact_pair { - SORCERY_OBJECT(details); - /*! Aor */ - struct ast_sip_aor *aor; - /*! Contact */ - struct ast_sip_contact *contact; -}; - -/*! * \brief DTMF modes for SIP endpoints */ enum ast_sip_dtmf_mode { @@ -824,32 +813,42 @@ struct ast_sorcery *ast_sip_get_sorcery(void); /*! * \brief Initialize transport support on a sorcery instance * - * \param sorcery The sorcery instance + * \retval -1 failure + * \retval 0 success + */ +int ast_sip_initialize_sorcery_transport(void); + +/*! + * \brief Destroy transport support on a sorcery instance * * \retval -1 failure * \retval 0 success */ -int ast_sip_initialize_sorcery_transport(struct ast_sorcery *sorcery); +int ast_sip_destroy_sorcery_transport(void); /*! * \brief Initialize qualify support on a sorcery instance * - * \param sorcery The sorcery instance - * * \retval -1 failure * \retval 0 success */ -int ast_sip_initialize_sorcery_qualify(struct ast_sorcery *sorcery); +int ast_sip_initialize_sorcery_qualify(void); /*! * \brief Initialize location support on a sorcery instance * - * \param sorcery The sorcery instance + * \retval -1 failure + * \retval 0 success + */ +int ast_sip_initialize_sorcery_location(void); + +/*! + * \brief Destroy location support on a sorcery instance * * \retval -1 failure * \retval 0 success */ -int ast_sip_initialize_sorcery_location(struct ast_sorcery *sorcery); +int ast_sip_destroy_sorcery_location(void); /*! * \brief Retrieve a named AOR @@ -936,22 +935,26 @@ int ast_sip_location_delete_contact(struct ast_sip_contact *contact); /*! * \brief Initialize domain aliases support on a sorcery instance * - * \param sorcery The sorcery instance - * * \retval -1 failure * \retval 0 success */ -int ast_sip_initialize_sorcery_domain_alias(struct ast_sorcery *sorcery); +int ast_sip_initialize_sorcery_domain_alias(void); /*! * \brief Initialize authentication support on a sorcery instance * - * \param sorcery The sorcery instance + * \retval -1 failure + * \retval 0 success + */ +int ast_sip_initialize_sorcery_auth(void); + +/*! + * \brief Destroy authentication support on a sorcery instance * * \retval -1 failure * \retval 0 success */ -int ast_sip_initialize_sorcery_auth(struct ast_sorcery *sorcery); +int ast_sip_destroy_sorcery_auth(void); /*! * \brief Callback called when an outbound request with authentication credentials is to be sent in dialog @@ -1553,7 +1556,7 @@ void ast_sip_destroy_global_headers(void); int ast_sip_add_global_request_header(const char *name, const char *value, int replace); int ast_sip_add_global_response_header(const char *name, const char *value, int replace); -int ast_sip_initialize_sorcery_global(struct ast_sorcery *sorcery); +int ast_sip_initialize_sorcery_global(void); /*! * \brief Retrieves the value associated with the given key. @@ -1618,7 +1621,7 @@ void *ast_sip_dict_set(pj_pool_t* pool, void *ht, * \param arg user data passed to handler * \retval 0 Success, non-zero on failure */ -int ast_sip_for_each_contact(struct ast_sip_aor *aor, +int ast_sip_for_each_contact(const struct ast_sip_aor *aor, ao2_callback_fn on_contact, void *arg); /*! diff --git a/include/asterisk/res_pjsip_cli.h b/include/asterisk/res_pjsip_cli.h index cd7d81ed2..fa832cadc 100644 --- a/include/asterisk/res_pjsip_cli.h +++ b/include/asterisk/res_pjsip_cli.h @@ -19,6 +19,8 @@ #ifndef RES_PJSIP_CLI_H_ #define RES_PJSIP_CLI_H_ +#include "asterisk/cli.h" + #define CLI_HEADER_FILLER ".........................................................................................." #define CLI_DETAIL_FILLER " " #define CLI_MAX_WIDTH 90 @@ -54,7 +56,9 @@ struct ast_sip_cli_formatter_entry { const char *name; ao2_callback_fn *print_header; ao2_callback_fn *print_body; - struct ao2_container *(* get_container)(struct ast_sorcery *); + struct ao2_container *(* get_container)(void); + int (* iterator)(const void *container, ao2_callback_fn callback, void *args); + ao2_sort_fn *comparator; }; /*! @@ -91,5 +95,7 @@ struct ast_sip_cli_formatter_entry *ast_sip_lookup_cli_formatter(const char *nam */ int ast_sip_cli_print_sorcery_objectset(void *obj, void *arg, int flags); +char *ast_sip_cli_traverse_objects(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a); + #endif /* RES_PJSIP_CLI_H_ */ |