aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_phone.c
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-07 21:47:49 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-07 21:47:49 +0000
commit4d6996c27ad2cc1e0055b06b18522a44036c4f5c (patch)
treec85e2036ae8d28edebee2af6cc055a51e39ba1da /channels/chan_phone.c
parentc347b4f11cda5733f217deac8c9f852fc46945f0 (diff)
A fair number of changes for the sake of bug 7506
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47290 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_phone.c')
-rw-r--r--channels/chan_phone.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index 853668043..244326cd8 100644
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -835,10 +835,9 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *conte
{
struct ast_channel *tmp;
struct phone_codec_data codec;
- tmp = ast_channel_alloc(1);
+ tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "Phone/%s", i->dev + 5);
if (tmp) {
tmp->tech = cur_tech;
- ast_string_field_build(tmp, name, "Phone/%s", i->dev + 5);
tmp->fds[0] = i->fd;
/* XXX Switching formats silently causes kernel panics XXX */
if (i->mode == MODE_FXS &&
@@ -860,7 +859,7 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *conte
tmp->rawreadformat = prefformat;
tmp->rawwriteformat = prefformat;
}
- ast_setstate(tmp, state);
+ /* no need to call ast_setstate: the channel_alloc already did its job */
if (state == AST_STATE_RING)
tmp->rings = 1;
tmp->tech_pvt = i;