shrink phone number for callerid matching (bug #2562)
authorMark Spencer <markster@digium.com>
Sun, 3 Oct 2004 14:52:33 +0000 (14:52 +0000)
committerMark Spencer <markster@digium.com>
Sun, 3 Oct 2004 14:52:33 +0000 (14:52 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3894 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index eece03e..a8b4240 100755 (executable)
@@ -5439,6 +5439,8 @@ static void *ss_thread(void *data)
                        free(chan->cid.cid_name);
                        chan->cid.cid_name = NULL;
                }
                        free(chan->cid.cid_name);
                        chan->cid.cid_name = NULL;
                }
+               if (number)
+                       ast_shrink_phone_number(number);
                if (number && !ast_strlen_zero(number)) {
                        chan->cid.cid_num = strdup(number);
                        chan->cid.cid_ani = strdup(number);
                if (number && !ast_strlen_zero(number)) {
                        chan->cid.cid_num = strdup(number);
                        chan->cid.cid_ani = strdup(number);
@@ -7571,6 +7573,7 @@ static void *pri_dchannel(void *vpri)
                                        pri->pvts[chanpos]->call = e->ring.call;
                                        /* Get caller ID */
                                        if (pri->pvts[chanpos]->use_callerid) {
                                        pri->pvts[chanpos]->call = e->ring.call;
                                        /* Get caller ID */
                                        if (pri->pvts[chanpos]->use_callerid) {
+                                               ast_shrink_phone_number(e->ring.callingnum);
                                                strncpy(pri->pvts[chanpos]->cid_num, e->ring.callingnum, sizeof(pri->pvts[chanpos]->cid_num)-1);
                                                strncpy(pri->pvts[chanpos]->cid_name, e->ring.callingname, sizeof(pri->pvts[chanpos]->cid_name)-1);
                                        } else {
                                                strncpy(pri->pvts[chanpos]->cid_num, e->ring.callingnum, sizeof(pri->pvts[chanpos]->cid_num)-1);
                                                strncpy(pri->pvts[chanpos]->cid_name, e->ring.callingname, sizeof(pri->pvts[chanpos]->cid_name)-1);
                                        } else {