summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-06-15 16:07:23 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-06-15 16:07:23 +0000
commit6c5987811c7c3decff795e46f5b371fa931475fe (patch)
tree890da581f24a2e3e5d3947988627e6a294bed01d /apps
parentd224f78dd552131c387d1ccb8dae33d7883ea3a6 (diff)
Redesigned 'optional API' support.
This patch provides a new implementation of the optional API support defined in asterisk/optional_api.h; this new version provides solves compatibility issues with the use of linker version scripts for suppressing global symbols. In addition, there is now a functional (and tested!) implementation for Mac OS/X, so module writers no longer need to use special tests before calling optional API functions. All future implementations must provide these same semantics, so that module writers can rely on them. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c20
-rw-r--r--apps/app_stack.c8
-rw-r--r--apps/app_voicemail.c4
3 files changed, 13 insertions, 19 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 9227423a4..e32caa78d 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4256,18 +4256,16 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
else
which = peer;
ast_channel_unlock(qe->chan);
- if (ast_monitor_start) {
- if (monitorfilename) {
- ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1, X_REC_IN | X_REC_OUT);
- } else if (qe->chan->cdr && ast_monitor_start) {
- ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1, X_REC_IN | X_REC_OUT);
- } else if (ast_monitor_start) {
- /* Last ditch effort -- no CDR, make up something */
- snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
- ast_monitor_start(which, qe->parent->monfmt, tmpid, 1, X_REC_IN | X_REC_OUT);
- }
+ if (monitorfilename) {
+ ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1, X_REC_IN | X_REC_OUT);
+ } else if (qe->chan->cdr) {
+ ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1, X_REC_IN | X_REC_OUT);
+ } else {
+ /* Last ditch effort -- no CDR, make up something */
+ snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
+ ast_monitor_start(which, qe->parent->monfmt, tmpid, 1, X_REC_IN | X_REC_OUT);
}
- if (!ast_strlen_zero(monexec) && ast_monitor_setjoinfiles) {
+ if (!ast_strlen_zero(monexec)) {
ast_monitor_setjoinfiles(which, 1);
}
} else {
diff --git a/apps/app_stack.c b/apps/app_stack.c
index bc3054d3f..100a59603 100644
--- a/apps/app_stack.c
+++ b/apps/app_stack.c
@@ -647,9 +647,7 @@ struct agi_command gosub_agi_command =
static int unload_module(void)
{
- if (ast_agi_unregister) {
- ast_agi_unregister(ast_module_info->self, &gosub_agi_command);
- }
+ ast_agi_unregister(ast_module_info->self, &gosub_agi_command);
ast_unregister_application(app_return);
ast_unregister_application(app_pop);
@@ -663,9 +661,7 @@ static int unload_module(void)
static int load_module(void)
{
- if (ast_agi_register) {
- ast_agi_register(ast_module_info->self, &gosub_agi_command);
- }
+ ast_agi_register(ast_module_info->self, &gosub_agi_command);
ast_register_application_xml(app_pop, pop_exec);
ast_register_application_xml(app_return, return_exec);
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 824c42532..1c14f2e4f 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -10699,10 +10699,10 @@ static int load_config(int reload)
if ((val = ast_variable_retrieve(cfg, "general", "smdienable")) && ast_true(val)) {
ast_debug(1, "Enabled SMDI voicemail notification\n");
if ((val = ast_variable_retrieve(cfg, "general", "smdiport"))) {
- smdi_iface = ast_smdi_interface_find ? ast_smdi_interface_find(val) : NULL;
+ smdi_iface = ast_smdi_interface_find(val);
} else {
ast_debug(1, "No SMDI interface set, trying default (/dev/ttyS0)\n");
- smdi_iface = ast_smdi_interface_find ? ast_smdi_interface_find("/dev/ttyS0") : NULL;
+ smdi_iface = ast_smdi_interface_find("/dev/ttyS0");
}
if (!smdi_iface) {
ast_log(AST_LOG_ERROR, "No valid SMDI interface specfied, disabling SMDI voicemail notification\n");