aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-07 23:46:41 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-07 23:46:41 +0000
commitc25499d6c75ea145820465178ef982d256432bc6 (patch)
treede5d3b24e69a5cd86813ecf37bdeb5c9f87059a9 /channels/chan_local.c
parentb3c737f0114f072f2c01eab99cfd6265fd6a1264 (diff)
These mods are to solve the problem in bug 7506. It's a lot of rework to solve a fairly small problem... such is life.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47303 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c9
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;