#include <termios.h>
#include <time.h>
#include "asterisk/config.h"
#include "asterisk/module.h"
#include "asterisk/astobj.h"
Go to the source code of this file.
Data Structures | |
struct | ast_smdi_md_message |
An SMDI message desk message. More... | |
struct | ast_smdi_mwi_message |
An SMDI message waiting indicator message. More... | |
Defines | |
#define | SMDI_MAX_FILENAME_LEN 256 |
#define | SMDI_MAX_STATION_NUM_LEN 10 |
#define | SMDI_MESG_DESK_NUM_LEN 3 |
#define | SMDI_MESG_DESK_TERM_LEN 4 |
#define | SMDI_MWI_FAIL_CAUSE_LEN 3 |
Functions | |
ast_smdi_interface * | ast_smdi_interface_find (const char *iface_name) attribute_weak |
Find an SMDI interface with the specified name. | |
void | ast_smdi_interface_unref (struct ast_smdi_interface *iface) attribute_weak |
void | ast_smdi_md_message_destroy (struct ast_smdi_md_message *msg) attribute_weak |
ast_smdi_md_message destructor. | |
ast_smdi_md_message * | ast_smdi_md_message_pop (struct ast_smdi_interface *iface) attribute_weak |
Get the next SMDI message from the queue. | |
void | ast_smdi_md_message_putback (struct ast_smdi_interface *iface, struct ast_smdi_md_message *msg) attribute_weak |
Put an SMDI message back in the front of the queue. | |
ast_smdi_md_message * | ast_smdi_md_message_wait (struct ast_smdi_interface *iface, int timeout) attribute_weak |
Get the next SMDI message from the queue. | |
void | ast_smdi_mwi_message_destroy (struct ast_smdi_mwi_message *msg) attribute_weak |
ast_smdi_mwi_message destructor. | |
ast_smdi_mwi_message * | ast_smdi_mwi_message_pop (struct ast_smdi_interface *iface) attribute_weak |
Get the next SMDI message from the queue. | |
void | ast_smdi_mwi_message_putback (struct ast_smdi_interface *iface, struct ast_smdi_mwi_message *msg) attribute_weak |
Put an SMDI message back in the front of the queue. | |
ast_smdi_mwi_message * | ast_smdi_mwi_message_wait (struct ast_smdi_interface *iface, int timeout) attribute_weak |
Get the next SMDI message from the queue. | |
ast_smdi_mwi_message * | ast_smdi_mwi_message_wait_station (struct ast_smdi_interface *iface, int timeout, const char *station) attribute_weak |
int | ast_smdi_mwi_set (struct ast_smdi_interface *iface, const char *mailbox) attribute_weak |
Set the MWI indicator for a mailbox. | |
int | ast_smdi_mwi_unset (struct ast_smdi_interface *iface, const char *mailbox) attribute_weak |
Unset the MWI indicator for a mailbox. |
Russell Bryant <russell@digium.com>
Definition in file smdi.h.
struct ast_smdi_interface* ast_smdi_interface_find | ( | const char * | iface_name | ) |
Find an SMDI interface with the specified name.
iface_name | the name/port of the interface to search for. |
Definition at line 470 of file res_smdi.c.
References ASTOBJ_CONTAINER_FIND, and smdi_ifaces.
Referenced by load_config(), and smdi_msg_retrieve_read().
00471 { 00472 return (ASTOBJ_CONTAINER_FIND(&smdi_ifaces, iface_name)); 00473 }
void ast_smdi_interface_unref | ( | struct ast_smdi_interface * | iface | ) |
Definition at line 159 of file res_smdi.c.
References ast_smdi_interface_destroy(), ASTOBJ_UNREF, and mailbox_mapping::iface.
Referenced by destroy_dahdi_pvt().
00160 { 00161 ASTOBJ_UNREF(iface, ast_smdi_interface_destroy); 00162 }
void ast_smdi_md_message_destroy | ( | struct ast_smdi_md_message * | msg | ) |
ast_smdi_md_message destructor.
Definition at line 667 of file res_smdi.c.
Referenced by ast_smdi_interface_destroy(), smdi_msg_datastore_destroy(), smdi_msg_retrieve_read(), and unref_msg().
struct ast_smdi_md_message* ast_smdi_md_message_pop | ( | struct ast_smdi_interface * | iface | ) |
Get the next SMDI message from the queue.
iface | a pointer to the interface to use. |
Definition at line 444 of file res_smdi.c.
References mailbox_mapping::iface, SMDI_MD, and smdi_msg_pop().
00445 { 00446 return smdi_msg_pop(iface, SMDI_MD); 00447 }
void ast_smdi_md_message_putback | ( | struct ast_smdi_interface * | iface, | |
struct ast_smdi_md_message * | msg | |||
) |
Put an SMDI message back in the front of the queue.
iface | a pointer to the interface to use. | |
md_msg | a pointer to the message to use. |
Definition at line 229 of file res_smdi.c.
References ast_cond_broadcast(), ast_mutex_lock(), ast_mutex_unlock(), ASTOBJ_CONTAINER_LINK_START, mailbox_mapping::iface, ast_smdi_interface::md_q, ast_smdi_interface::md_q_cond, and ast_smdi_interface::md_q_lock.
00230 { 00231 ast_mutex_lock(&iface->md_q_lock); 00232 ASTOBJ_CONTAINER_LINK_START(&iface->md_q, md_msg); 00233 ast_cond_broadcast(&iface->md_q_cond); 00234 ast_mutex_unlock(&iface->md_q_lock); 00235 }
struct ast_smdi_md_message* ast_smdi_md_message_wait | ( | struct ast_smdi_interface * | iface, | |
int | timeout | |||
) |
Get the next SMDI message from the queue.
iface | a pointer to the interface to use. | |
timeout | the time to wait before returning in milliseconds. |
Definition at line 449 of file res_smdi.c.
References mailbox_mapping::iface, SMDI_MD, and smdi_message_wait().
Referenced by ss_thread().
00450 { 00451 return smdi_message_wait(iface, timeout, SMDI_MD, NULL); 00452 }
void ast_smdi_mwi_message_destroy | ( | struct ast_smdi_mwi_message * | msg | ) |
ast_smdi_mwi_message destructor.
Definition at line 672 of file res_smdi.c.
Referenced by ast_smdi_interface_destroy(), run_externnotify(), and unref_msg().
struct ast_smdi_mwi_message* ast_smdi_mwi_message_pop | ( | struct ast_smdi_interface * | iface | ) |
Get the next SMDI message from the queue.
iface | a pointer to the interface to use. |
Definition at line 454 of file res_smdi.c.
References mailbox_mapping::iface, smdi_msg_pop(), and SMDI_MWI.
00455 { 00456 return smdi_msg_pop(iface, SMDI_MWI); 00457 }
void ast_smdi_mwi_message_putback | ( | struct ast_smdi_interface * | iface, | |
struct ast_smdi_mwi_message * | msg | |||
) |
Put an SMDI message back in the front of the queue.
iface | a pointer to the interface to use. | |
mwi_msg | a pointer to the message to use. |
Definition at line 237 of file res_smdi.c.
References ast_cond_broadcast(), ast_mutex_lock(), ast_mutex_unlock(), ASTOBJ_CONTAINER_LINK_START, mailbox_mapping::iface, ast_smdi_interface::mwi_q, ast_smdi_interface::mwi_q_cond, and ast_smdi_interface::mwi_q_lock.
00238 { 00239 ast_mutex_lock(&iface->mwi_q_lock); 00240 ASTOBJ_CONTAINER_LINK_START(&iface->mwi_q, mwi_msg); 00241 ast_cond_broadcast(&iface->mwi_q_cond); 00242 ast_mutex_unlock(&iface->mwi_q_lock); 00243 }
struct ast_smdi_mwi_message* ast_smdi_mwi_message_wait | ( | struct ast_smdi_interface * | iface, | |
int | timeout | |||
) |
Get the next SMDI message from the queue.
iface | a pointer to the interface to use. | |
timeout | the time to wait before returning in milliseconds. |
Definition at line 459 of file res_smdi.c.
References mailbox_mapping::iface, smdi_message_wait(), and SMDI_MWI.
00460 { 00461 return smdi_message_wait(iface, timeout, SMDI_MWI, NULL); 00462 }
struct ast_smdi_mwi_message* ast_smdi_mwi_message_wait_station | ( | struct ast_smdi_interface * | iface, | |
int | timeout, | |||
const char * | station | |||
) |
Definition at line 464 of file res_smdi.c.
References mailbox_mapping::iface, smdi_message_wait(), and SMDI_MWI.
Referenced by run_externnotify().
00466 { 00467 return smdi_message_wait(iface, timeout, SMDI_MWI, station); 00468 }
int ast_smdi_mwi_set | ( | struct ast_smdi_interface * | iface, | |
const char * | mailbox | |||
) |
Set the MWI indicator for a mailbox.
iface | the interface to use. | |
mailbox | the mailbox to use. |
Definition at line 219 of file res_smdi.c.
References mailbox_mapping::iface, and smdi_toggle_mwi().
Referenced by poll_mailbox(), and run_externnotify().
00220 { 00221 return smdi_toggle_mwi(iface, mailbox, 1); 00222 }
int ast_smdi_mwi_unset | ( | struct ast_smdi_interface * | iface, | |
const char * | mailbox | |||
) |
Unset the MWI indicator for a mailbox.
iface | the interface to use. | |
mailbox | the mailbox to use. |
Definition at line 224 of file res_smdi.c.
References mailbox_mapping::iface, and smdi_toggle_mwi().
Referenced by poll_mailbox(), and run_externnotify().
00225 { 00226 return smdi_toggle_mwi(iface, mailbox, 0); 00227 }