From 908f176cf38eb1f81a3372a2ebf24ed17c75e8a6 Mon Sep 17 00:00:00 2001 From: Steve Murphy Date: Tue, 7 Nov 2006 21:47:49 +0000 Subject: 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 --- channels/chan_phone.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'channels/chan_phone.c') 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; -- cgit v1.2.3