diff options
Diffstat (limited to 'channels/chan_phone.c')
-rw-r--r-- | channels/chan_phone.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/channels/chan_phone.c b/channels/chan_phone.c index 18eaf8fa1..48da10fd6 100644 --- a/channels/chan_phone.c +++ b/channels/chan_phone.c @@ -888,7 +888,10 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *cntx, /* Don't use ast_set_callerid() here because it will * generate a NewCallerID event before the NewChannel event */ - tmp->caller.ani = ast_strdup(i->cid_num); + if (!ast_strlen_zero(i->cid_num)) { + tmp->caller.ani.number.valid = 1; + tmp->caller.ani.number.str = ast_strdup(i->cid_num); + } i->owner = tmp; ast_module_ref(ast_module_info->self); |