diff options
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r-- | channels/chan_local.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index db6081a53..fe821363d 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -549,7 +549,8 @@ static struct ast_channel *local_new(struct local_pvt *p, int state) int randnum = ast_random() & 0xffff, fmt = 0; /* Allocate two new Asterisk channels */ - if (!(tmp = ast_channel_alloc(1)) || !(tmp2 = ast_channel_alloc(1))) { + if (!(tmp = ast_channel_alloc(1, state, 0, 0, "Local/%s@%s-%04x,1", p->exten, p->context, randnum)) + || !(tmp2 = ast_channel_alloc(1, AST_STATE_RING, 0, 0, "Local/%s@%s-%04x,2", p->exten, p->context, randnum))) { if (tmp) ast_channel_free(tmp); if (tmp2) @@ -563,12 +564,6 @@ static struct ast_channel *local_new(struct local_pvt *p, int state) tmp->nativeformats = p->reqformat; tmp2->nativeformats = p->reqformat; - ast_string_field_build(tmp, name, "Local/%s@%s-%04x,1", p->exten, p->context, randnum); - ast_string_field_build(tmp2, name, "Local/%s@%s-%04x,2", p->exten, p->context, randnum); - - ast_setstate(tmp, state); - ast_setstate(tmp2, AST_STATE_RING); - /* Determine our read/write format and set it on each channel */ fmt = ast_best_codec(p->reqformat); tmp->writeformat = fmt; |