0ee62529f603ffed2d9fafff2cac08b1b1e99803
[asterisk/asterisk.git] / res / res_pjsip / include / res_pjsip_private.h
1 /*
2  * res_pjsip.h
3  *
4  *  Created on: Jan 25, 2013
5  *      Author: mjordan
6  */
7
8 #ifndef RES_PJSIP_PRIVATE_H_
9 #define RES_PJSIP_PRIVATE_H_
10
11 #include "asterisk/module.h"
12 #include "asterisk/stasis_channels.h"
13 #include "asterisk/stasis_endpoints.h"
14
15 struct ao2_container;
16 struct ast_threadpool_options;
17
18 /*!
19  * \brief Initialize the configuration for res_pjsip
20  */
21 int ast_res_pjsip_initialize_configuration(const struct ast_module_info *ast_module_info);
22
23 /*!
24  * \brief Annihilate the configuration objects
25  */
26 void ast_res_pjsip_destroy_configuration(void);
27
28 /*!
29  * \brief Reload the configuration
30  */
31 int ast_res_pjsip_reload_configuration(void);
32
33 /*!
34  * \brief Initialize OPTIONS request handling.
35  *
36  * XXX This currently includes qualifying peers. It shouldn't.
37  * That should go into a registrar. When that occurs, we won't
38  * need the reload stuff.
39  *
40  * \param reload Reload options handling
41  *
42  * \retval 0 on success
43  * \retval other on failure
44  */
45 int ast_res_pjsip_init_options_handling(int reload);
46
47 /*!
48  * \brief Initialize transport storage for contacts.
49  *
50  * \retval 0 on success
51  * \retval other on failure
52  */
53 int ast_res_pjsip_init_contact_transports(void);
54
55 /*!
56  * \brief Initialize outbound authentication support
57  *
58  * \retval 0 Success
59  * \retval non-zero Failure
60  */
61 int ast_sip_initialize_outbound_authentication(void);
62
63 /*!
64  * \brief Initialize system configuration
65  *
66  * \retval 0 Success
67  * \retval non-zero Failure
68  */
69 int ast_sip_initialize_system(void);
70
71 /*!
72  * \brief Initialize global configuration
73  *
74  * \retval 0 Success
75  * \retval non-zero Failure
76  */
77 int ast_sip_initialize_global(void);
78
79 /*!
80  * \brief Clean up res_pjsip options handling
81  */
82 void ast_res_pjsip_cleanup_options_handling(void);
83
84 /*!
85  * \brief Get threadpool options
86  */
87 void sip_get_threadpool_options(struct ast_threadpool_options *threadpool_options);
88
89 /*!
90  * \brief Function pointer for channel snapshot callbacks.
91  */
92 typedef int (*on_channel_snapshot_t)(
93         const struct ast_channel_snapshot *snapshot, int last, void *arg);
94
95 /*!
96  * \brief For every channel snapshot on an endpoint snapshot call the given
97  *        'on_channel_snapshot' handler.
98  *
99  * \param endpoint_snapshot snapshot of an endpoint
100  * \param on_channel_snapshot callback for each channel snapshot
101  * \param arg user data passed to handler
102  * \retval 0 Success, non-zero on failure
103  */
104 int ast_sip_for_each_channel_snapshot(const struct ast_endpoint_snapshot *endpoint_snapshot,
105                                       on_channel_snapshot_t on_channel_snapshot,
106                                       void *arg);
107
108 #endif /* RES_PJSIP_PRIVATE_H_ */