37
37
#include "asterisk/config.h"
38
38
#include "asterisk/module.h"
39
39
#include "asterisk/astobj.h"
40
#include "asterisk/optional_api.h"
42
41
#define SMDI_MESG_DESK_NUM_LEN 3
43
42
#define SMDI_MESG_DESK_TERM_LEN 4
86
85
struct ast_smdi_interface;
88
AST_OPTIONAL_API(void, ast_smdi_interface_unref, (struct ast_smdi_interface
89
*iface), { return; });
87
void ast_smdi_interface_unref(struct ast_smdi_interface *iface) attribute_weak;
92
90
* \brief Get the next SMDI message from the queue.
99
97
* \return the next SMDI message, or NULL if there were no pending messages.
101
AST_OPTIONAL_API(struct ast_smdi_md_message *, ast_smdi_md_message_pop, (struct
102
ast_smdi_interface *iface), { return NULL; });
99
struct ast_smdi_md_message *ast_smdi_md_message_pop(struct ast_smdi_interface *iface) attribute_weak;
105
102
* \brief Get the next SMDI message from the queue.
113
110
* \return the next SMDI message, or NULL if there were no pending messages and
114
111
* the timeout has expired.
116
AST_OPTIONAL_API(struct ast_smdi_md_message *, ast_smdi_md_message_wait,
117
(struct ast_smdi_interface *iface, int timeout), { return NULL; });
113
struct ast_smdi_md_message *ast_smdi_md_message_wait(struct ast_smdi_interface *iface, int timeout) attribute_weak;
120
116
* \brief Put an SMDI message back in the front of the queue.
125
121
* should be used if a message was popped but is not going to be processed for
126
122
* some reason, and the message needs to be returned to the queue.
128
AST_OPTIONAL_API(void, ast_smdi_md_message_putback, (struct ast_smdi_interface
129
*iface, struct ast_smdi_md_message *msg), { return; });
124
void ast_smdi_md_message_putback(struct ast_smdi_interface *iface, struct ast_smdi_md_message *msg) attribute_weak;
132
127
* \brief Get the next SMDI message from the queue.
139
134
* \return the next SMDI message, or NULL if there were no pending messages.
141
AST_OPTIONAL_API(struct ast_smdi_mwi_message *, ast_smdi_mwi_message_pop,
142
(struct ast_smdi_interface *iface), { return NULL; });
136
struct ast_smdi_mwi_message *ast_smdi_mwi_message_pop(struct ast_smdi_interface *iface) attribute_weak;
145
139
* \brief Get the next SMDI message from the queue.
153
147
* \return the next SMDI message, or NULL if there were no pending messages and
154
148
* the timeout has expired.
156
AST_OPTIONAL_API(struct ast_smdi_mwi_message *, ast_smdi_mwi_message_wait,
157
(struct ast_smdi_interface *iface, int timeout), { return NULL; });
158
AST_OPTIONAL_API(struct ast_smdi_mwi_message *,
159
ast_smdi_mwi_message_wait_station, (struct ast_smdi_interface *iface, int
160
timeout, const char *station), { return NULL; });
150
struct ast_smdi_mwi_message *ast_smdi_mwi_message_wait(struct ast_smdi_interface *iface, int timeout) attribute_weak;
151
struct ast_smdi_mwi_message *ast_smdi_mwi_message_wait_station(struct ast_smdi_interface *iface, int
152
timeout, const char *station) attribute_weak;
163
155
* \brief Put an SMDI message back in the front of the queue.
168
160
* should be used if a message was popped but is not going to be processed for
169
161
* some reason, and the message needs to be returned to the queue.
171
AST_OPTIONAL_API(void, ast_smdi_mwi_message_putback, (struct ast_smdi_interface
172
*iface, struct ast_smdi_mwi_message *msg), { return; });
163
void ast_smdi_mwi_message_putback(struct ast_smdi_interface *iface, struct ast_smdi_mwi_message *msg) attribute_weak;
175
166
* \brief Find an SMDI interface with the specified name.
179
170
* actually returns an ASTOBJ reference and should be released using
180
171
* #ASTOBJ_UNREF(iface, ast_smdi_interface_destroy).
182
AST_OPTIONAL_API(struct ast_smdi_interface *, ast_smdi_interface_find,
183
(const char *iface_name), { return NULL; });
173
struct ast_smdi_interface *ast_smdi_interface_find(const char *iface_name) attribute_weak;
186
176
* \brief Set the MWI indicator for a mailbox.
187
177
* \param iface the interface to use.
188
178
* \param mailbox the mailbox to use.
190
AST_OPTIONAL_API(int, ast_smdi_mwi_set, (struct ast_smdi_interface *iface,
191
const char *mailbox), { return -1; });
180
int ast_smdi_mwi_set(struct ast_smdi_interface *iface, const char *mailbox) attribute_weak;
194
183
* \brief Unset the MWI indicator for a mailbox.
195
184
* \param iface the interface to use.
196
185
* \param mailbox the mailbox to use.
198
AST_OPTIONAL_API(int, ast_smdi_mwi_unset, (struct ast_smdi_interface *iface,
199
const char *mailbox), { return -1; });
187
int ast_smdi_mwi_unset(struct ast_smdi_interface *iface, const char *mailbox) attribute_weak;
201
189
/*! \brief ast_smdi_md_message destructor. */
202
AST_OPTIONAL_API(void, ast_smdi_md_message_destroy,
203
(struct ast_smdi_md_message *msg), { return; });
190
void ast_smdi_md_message_destroy(struct ast_smdi_md_message *msg) attribute_weak;
205
192
/*! \brief ast_smdi_mwi_message destructor. */
206
AST_OPTIONAL_API(void, ast_smdi_mwi_message_destroy, (struct
207
ast_smdi_mwi_message *msg), { return; });
193
void ast_smdi_mwi_message_destroy(struct ast_smdi_mwi_message *msg) attribute_weak;
209
195
#endif /* !ASTERISK_SMDI_H */