summaryrefslogtreecommitdiff
path: root/channels/chan_phone.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_phone.c')
-rw-r--r--channels/chan_phone.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index c1a24b8b1..ca69a2f69 100644
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -862,6 +862,7 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *cntx,
struct ast_format tmpfmt;
tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "", i->ext, i->context, linkedid, 0, "Phone/%s", i->dev + 5);
if (tmp) {
+ ast_channel_lock(tmp);
ast_channel_tech_set(tmp, cur_tech);
ast_channel_set_fd(tmp, 0, i->fd);
/* XXX Switching formats silently causes kernel panics XXX */
@@ -898,6 +899,7 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *cntx,
ast_channel_caller(tmp)->ani.number.valid = 1;
ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->cid_num);
}
+ ast_channel_unlock(tmp);
i->owner = tmp;
ast_module_ref(ast_module_info->self);