diff options
author | Steve Murphy <murf@digium.com> | 2006-11-07 21:47:49 +0000 |
---|---|---|
committer | Steve Murphy <murf@digium.com> | 2006-11-07 21:47:49 +0000 |
commit | 908f176cf38eb1f81a3372a2ebf24ed17c75e8a6 (patch) | |
tree | c85e2036ae8d28edebee2af6cc055a51e39ba1da /channels/chan_local.c | |
parent | 7659f6d5240b03068adf9746b3dd2938d1ebb0fd (diff) |
A fair number of changes for the sake of bug 7506
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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; |