aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authormalcolmd <malcolmd@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-30 18:21:54 +0000
committermalcolmd <malcolmd@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-30 18:21:54 +0000
commitdb8d625744c1b900ab8f6651e38f181651d84a3a (patch)
tree7796aedcfa182e50ae9a37a049f2b6798887dd25 /channels/chan_zap.c
parent65f8cc1881c13a5d674b40653c64548e956ac218 (diff)
Bug # 2115: Allow Caller TON to be retrieved in the dialplan
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3538 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rwxr-xr-xchannels/chan_zap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 726a2905a..3889ed90d 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -443,6 +443,7 @@ static struct zt_pvt {
char language[MAX_LANGUAGE];
char musicclass[MAX_LANGUAGE];
char callerid[AST_MAX_EXTENSION];
+ int callerton;
char lastcallerid[AST_MAX_EXTENSION];
char *origcallerid; /* malloced original callerid */
char callwaitcid[AST_MAX_EXTENSION];
@@ -4409,6 +4410,7 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
tmp->callerid = strdup(i->callerid);
tmp->ani = strdup(i->callerid);
}
+ tmp->callerton = i->callerton;
tmp->restrictcid = i->restrictcid;
tmp->callingpres = i->callingpres;
#ifdef ZAPATA_PRI
@@ -7236,6 +7238,8 @@ static void *pri_dchannel(void *vpri)
strncpy(pri->pvts[chanpos]->callerid, e->ring.callingnum, sizeof(pri->pvts[chanpos]->callerid)-1);
} else
pri->pvts[chanpos]->callerid[0] = '\0';
+ /* Caller Type Of Number - used to distinguise NANPA from International */
+ pri->pvts[chanpos]->callerton = ((e->ring.callingplan) >> 4) & 0x7;
strncpy(pri->pvts[chanpos]->rdnis, e->ring.redirectingnum, sizeof(pri->pvts[chanpos]->rdnis) - 1);
/* If immediate=yes go to s|1 */
if (pri->pvts[chanpos]->immediate) {