]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Restore original functionality of 1.2 in places where ANI was not set, but was
authorRussell Bryant <russell@russellbryant.com>
Wed, 30 Aug 2006 18:59:44 +0000 (18:59 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 30 Aug 2006 18:59:44 +0000 (18:59 +0000)
changed to be set.  The original change was done to ensure that the behavior of
the "callerid" option in each channel driver was consistent, but it caused an
unexpected behavior change of CDR records for users, so this change is being
reverted in 1.2.  (issue #7695)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@41411 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_features.c
channels/chan_h323.c
channels/chan_iax2.c
channels/chan_local.c
channels/chan_mgcp.c
channels/chan_misdn.c
channels/chan_phone.c
channels/chan_sip.c
channels/chan_skinny.c

index 38565ee41c3edd8d1d2089d49b9fa3ae5cfec579..5f680130b70a285369a8de3bef5f5e4ef8a304d7 100644 (file)
@@ -328,14 +328,14 @@ static int features_call(struct ast_channel *ast, char *dest, int timeout)
                ast_mutex_lock(&p->lock);
                x = indexof(p, ast, 0);
                if (!x && p->subchan) {
-                       ast_set_callerid(p->subchan,
-                               p->owner->cid.cid_num, p->owner->cid.cid_name,
-                               p->owner->cid.cid_ani ? p->owner->cid.cid_ani : p->owner->cid.cid_num);
-               
-                       if (p->owner->cid.cid_rdnis)
-                               p->subchan->cid.cid_rdnis = strdup(p->owner->cid.cid_rdnis);
-                       else
-                               p->subchan->cid.cid_rdnis = NULL;
+                       p->subchan->cid.cid_name = p->owner->cid.cid_name ? 
+                               strdup(p->owner->cid.cid_name) : NULL;
+                       p->subchan->cid.cid_num = p->owner->cid.cid_num ? 
+                               strdup(p->owner->cid.cid_num) : NULL;
+                       p->subchan->cid.cid_ani = p->owner->cid.cid_ani ? 
+                               strdup(p->owner->cid.cid_ani) : NULL;
+                       p->subchan->cid.cid_rdnis = p->owner->cid.cid_rdnis ? 
+                               strdup(p->owner->cid.cid_rdnis) : NULL;
                
                        p->subchan->cid.cid_pres = p->owner->cid.cid_pres;
                        strncpy(p->subchan->language, p->owner->language, sizeof(p->subchan->language) - 1);
index 814c546f9e71772a603ce8c87b57bd3104d8c696..b86d684c87facfa372408661c9e162d72efe208f 100644 (file)
@@ -770,13 +770,10 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c
                        ch->amaflags = pvt->amaflags;
                }
 
-               if (!ast_strlen_zero(pvt->cid_num)) {
+               if (!ast_strlen_zero(pvt->cid_num))
                        ch->cid.cid_num = strdup(pvt->cid_num);
-                       ch->cid.cid_ani = strdup(pvt->cid_num);
-               } else if (!ast_strlen_zero(pvt->cd.call_source_e164)) {
+               else if (!ast_strlen_zero(pvt->cd.call_source_e164))
                        ch->cid.cid_num = strdup(pvt->cd.call_source_e164);
-                       ch->cid.cid_ani = strdup(pvt->cd.call_source_e164);
-               }
                if (!ast_strlen_zero(pvt->cid_name))
                        ch->cid.cid_name = strdup(pvt->cid_name);
 
index 61fc2ca3636c1580a665ada60cdc1b5e86f2c4ea..f57853ae0ef8406602f10b48af983e73c901039f 100644 (file)
@@ -3448,8 +3448,6 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
                        tmp->cid.cid_name = strdup(i->cid_name);
                if (!ast_strlen_zero(i->ani))
                        tmp->cid.cid_ani = strdup(i->ani);
-               else if (!ast_strlen_zero(i->cid_num))
-                       tmp->cid.cid_ani = strdup(i->cid_num);
                tmp->cid.cid_pres = i->calling_pres;
                tmp->cid.cid_ton = i->calling_ton;
                tmp->cid.cid_tns = i->calling_tns;
index 06900590270cdcae28de16fe4f1d0a99a47e758b..a28964167c37488ebb45df02094ae4144b2e3ca0 100644 (file)
@@ -339,7 +339,7 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
 
        ast_set_callerid(p->chan,
                p->owner->cid.cid_num, p->owner->cid.cid_name,
-               p->owner->cid.cid_ani ? p->chan->cid.cid_ani : p->owner->cid.cid_num);
+               p->owner->cid.cid_ani);
 
        if (p->owner->cid.cid_rdnis)
                p->chan->cid.cid_rdnis = strdup(p->owner->cid.cid_rdnis);
index cb3c3d7ced08c88166e30f95f76de16820075370..14b1874260562b97ebc8d8632275fa307a4b2192 100644 (file)
@@ -1429,10 +1429,8 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
                strncpy(tmp->context, i->context, sizeof(tmp->context)-1);
                strncpy(tmp->exten, i->exten, sizeof(tmp->exten)-1);
 
-               if (!ast_strlen_zero(i->cid_num)) {
+               if (!ast_strlen_zero(i->cid_num))
                        tmp->cid.cid_num = strdup(i->cid_num);
-                       tmp->cid.cid_ani = strdup(i->cid_num);
-               }
                if (!ast_strlen_zero(i->cid_name))
                        tmp->cid.cid_name = strdup(i->cid_name);
                
@@ -2630,7 +2628,7 @@ static void *mgcp_ss(void *data)
                                        ast_set_callerid(chan,
                                                        p->hidecallerid ? "" : p->cid_num,
                                                        p->hidecallerid ? "" : p->cid_name,
-                                                       chan->cid.cid_ani ? NULL : p->cid_num);
+                                                       p->cid_num);
                                        ast_setstate(chan, AST_STATE_RING);
                                        /*zt_enable_ec(p);*/
                                        if (p->dtmfmode & MGCP_DTMF_HYBRID) {
index 5b322f6bf16bdbf3d888451acf68749e21a0c36f..c6dc759208136552c8ac5ee30b08894aa7de6bd0 100644 (file)
@@ -2706,10 +2706,8 @@ static struct ast_channel *misdn_new(struct chan_list *chlist, int state,  char
       
                        ast_callerid_parse(callerid, &cid_name, &cid_num);
 
-                       if (!ast_strlen_zero(cid_num)) {
+                       if (!ast_strlen_zero(cid_num))
                                tmp->cid.cid_num = strdup(cid_num);
-                               tmp->cid.cid_ani = strdup(cid_num);
-                       }
                        if (!ast_strlen_zero(cid_name))
                                tmp->cid.cid_name = strdup(cid_name);
                }
index 18fc8eaf8c8a35af4e76f84409fa675bd21197c6..65257d507985855721d84319fa538d571dee94de 100644 (file)
@@ -826,10 +826,8 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *conte
                if (!ast_strlen_zero(i->language))
                        strncpy(tmp->language, i->language, sizeof(tmp->language)-1);
 
-               if (!ast_strlen_zero(i->cid_num)) {
+               if (!ast_strlen_zero(i->cid_num))
                        tmp->cid.cid_num = strdup(i->cid_num);
-                       tmp->cid.cid_ani = strdup(i->cid_num);
-               }
                if (!ast_strlen_zero(i->cid_name))
                        tmp->cid.cid_name = strdup(i->cid_name);
 
index 636760f880ec0d05c3ac134341dc690585ff5a21..2e0a662ef4c5198e4e347827c0b024f9bfd6f4ad 100644 (file)
@@ -2824,10 +2824,8 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
        ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
        ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
 
-       if (!ast_strlen_zero(i->cid_num)) {
+       if (!ast_strlen_zero(i->cid_num))
                tmp->cid.cid_num = strdup(i->cid_num);
-               tmp->cid.cid_ani = strdup(i->cid_num);
-       }
        if (!ast_strlen_zero(i->cid_name))
                tmp->cid.cid_name = strdup(i->cid_name);
        if (!ast_strlen_zero(i->rdnis))
index e4ffe81657cf9f63856ebb48c0200dbba040ac65..1dc6c8c2afa7cd11953b7cb714eb2a292eaa86e6 100644 (file)
@@ -1746,7 +1746,7 @@ static void *skinny_ss(void *data)
                                                ast_set_callerid(chan,
                                                        l->hidecallerid ? "" : l->cid_num,
                                                        l->hidecallerid ? "" : l->cid_name,
-                                                       chan->cid.cid_ani ? NULL : l->cid_num);
+                                                       NULL);
                                                ast_setstate(chan, AST_STATE_RING);
                                                res = ast_pbx_run(chan);
                                                if (res) {
@@ -2280,10 +2280,8 @@ static struct ast_channel *skinny_new(struct skinny_subchannel *sub, int state)
                strncpy(tmp->context, l->context, sizeof(tmp->context)-1);
                strncpy(tmp->exten,l->exten, sizeof(tmp->exten)-1);
 
-               if (!ast_strlen_zero(l->cid_num)) {
+               if (!ast_strlen_zero(l->cid_num))
                        tmp->cid.cid_num = strdup(l->cid_num);
-                       tmp->cid.cid_ani = strdup(l->cid_num);
-               }
                if (!ast_strlen_zero(l->cid_name))
                        tmp->cid.cid_name = strdup(l->cid_name);