aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index cb981dc86..e68fc7333 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6524,7 +6524,10 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
/* Don't use ast_set_callerid() here because it will
* generate an unnecessary NewCallerID 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);
+ }
if (!ast_strlen_zero(i->rdnis)) {
tmp->redirecting.from.number.valid = 1;
tmp->redirecting.from.number.str = ast_strdup(i->rdnis);