summaryrefslogtreecommitdiff
path: root/apps/app_originate.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_originate.c')
-rw-r--r--apps/app_originate.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/apps/app_originate.c b/apps/app_originate.c
index 9fceb0849..15898b240 100644
--- a/apps/app_originate.c
+++ b/apps/app_originate.c
@@ -45,6 +45,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/app.h"
+#include "asterisk/format_cache.h"
static const char app_originate[] = "Originate";
@@ -112,22 +113,22 @@ static int originate_exec(struct ast_channel *chan, const char *data)
int outgoing_status = 0;
unsigned int timeout = 30;
static const char default_exten[] = "s";
- struct ast_format tmpfmt;
- struct ast_format_cap *cap_slin = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_NOLOCK);
+ struct ast_format_cap *cap_slin = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
ast_autoservice_start(chan);
if (!cap_slin) {
goto return_cleanup;
}
- ast_format_cap_add(cap_slin, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR, 0));
- ast_format_cap_add(cap_slin, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR12, 0));
- ast_format_cap_add(cap_slin, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR16, 0));
- ast_format_cap_add(cap_slin, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR24, 0));
- ast_format_cap_add(cap_slin, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR32, 0));
- ast_format_cap_add(cap_slin, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR44, 0));
- ast_format_cap_add(cap_slin, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR48, 0));
- ast_format_cap_add(cap_slin, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR96, 0));
- ast_format_cap_add(cap_slin, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR192, 0));
+
+ ast_format_cap_append(cap_slin, ast_format_slin, 0);
+ ast_format_cap_append(cap_slin, ast_format_slin12, 0);
+ ast_format_cap_append(cap_slin, ast_format_slin16, 0);
+ ast_format_cap_append(cap_slin, ast_format_slin24, 0);
+ ast_format_cap_append(cap_slin, ast_format_slin32, 0);
+ ast_format_cap_append(cap_slin, ast_format_slin44, 0);
+ ast_format_cap_append(cap_slin, ast_format_slin48, 0);
+ ast_format_cap_append(cap_slin, ast_format_slin96, 0);
+ ast_format_cap_append(cap_slin, ast_format_slin192, 0);
if (ast_strlen_zero(data)) {
ast_log(LOG_ERROR, "Originate() requires arguments\n");
@@ -222,7 +223,7 @@ return_cleanup:
break;
}
}
- cap_slin = ast_format_cap_destroy(cap_slin);
+ ao2_cleanup(cap_slin);
ast_autoservice_stop(chan);
return res;