summaryrefslogtreecommitdiff
path: root/pbx/pbx_spool.c
diff options
context:
space:
mode:
Diffstat (limited to 'pbx/pbx_spool.c')
-rw-r--r--pbx/pbx_spool.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index 4461d7fc7..adec3b26a 100644
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -53,6 +53,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/module.h"
#include "asterisk/utils.h"
#include "asterisk/options.h"
+#include "asterisk/format.h"
+#include "asterisk/format_cache.h"
/*
* pbx_spool is similar in spirit to qcall, but with substantially enhanced functionality...
@@ -108,7 +110,7 @@ static void free_outgoing(struct outgoing *o)
if (o->vars) {
ast_variables_destroy(o->vars);
}
- o->capabilities = ast_format_cap_destroy(o->capabilities);
+ ao2_cleanup(o->capabilities);
ast_string_field_free_memory(o);
ast_free(o);
}
@@ -116,7 +118,6 @@ static void free_outgoing(struct outgoing *o)
static struct outgoing *new_outgoing(const char *fn)
{
struct outgoing *o;
- struct ast_format tmpfmt;
o = ast_calloc(1, sizeof(*o));
if (!o) {
@@ -144,12 +145,12 @@ static struct outgoing *new_outgoing(const char *fn)
return NULL;
}
- o->capabilities = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_NOLOCK);
+ o->capabilities = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
if (!o->capabilities) {
free_outgoing(o);
return NULL;
}
- ast_format_cap_add(o->capabilities, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR, 0));
+ ast_format_cap_append(o->capabilities, ast_format_slin, 0);
return o;
}
@@ -226,7 +227,7 @@ static int apply_outgoing(struct outgoing *o, FILE *f)
o->maxretries = 0;
}
} else if (!strcasecmp(buf, "codecs")) {
- ast_parse_allow_disallow(NULL, o->capabilities, c, 1);
+ ast_format_cap_update_by_allow_disallow(o->capabilities, c, 1);
} else if (!strcasecmp(buf, "context")) {
ast_string_field_set(o, context, c);
} else if (!strcasecmp(buf, "extension")) {