summaryrefslogtreecommitdiff
path: root/apps/app_milliwatt.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_milliwatt.c')
-rw-r--r--apps/app_milliwatt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/app_milliwatt.c b/apps/app_milliwatt.c
index 24137606d..26cba3c40 100644
--- a/apps/app_milliwatt.c
+++ b/apps/app_milliwatt.c
@@ -78,10 +78,10 @@ static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int
int i, *indexp = (int *) data;
struct ast_frame wf = {
.frametype = AST_FRAME_VOICE,
- .subclass.codec = AST_FORMAT_ULAW,
.offset = AST_FRIENDLY_OFFSET,
.src = __FUNCTION__,
};
+ ast_format_set(&wf.subclass.format, AST_FORMAT_ULAW, 0);
wf.data.ptr = buf + AST_FRIENDLY_OFFSET;
/* Instead of len, use samples, because channel.c generator_force
@@ -120,8 +120,8 @@ static struct ast_generator milliwattgen = {
static int old_milliwatt_exec(struct ast_channel *chan)
{
- ast_set_write_format(chan, AST_FORMAT_ULAW);
- ast_set_read_format(chan, AST_FORMAT_ULAW);
+ ast_set_write_format_by_id(chan, AST_FORMAT_ULAW);
+ ast_set_read_format_by_id(chan, AST_FORMAT_ULAW);
if (chan->_state != AST_STATE_UP) {
ast_answer(chan);