diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 726a2905a80e9df2fe5c86e8750b5e705e90bb8e..3889ed90da1e06e41fad2f33faa24e008b2ade14 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) {
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index cf86318cebf7ab15434cf2f89fc8523d9c512497..d95aa43acb1c050ce8665f249f4e64e58607bc2d 100755
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -148,7 +148,9 @@ struct ast_channel {
 	/*! Malloc'd Dialed Number Identifier */
 	char *dnid;				
 	/*! Malloc'd Caller ID */
-	char *callerid;				
+	char *callerid;
+	/*! Caller Type Of Number */
+	int callerton;
 	/*! Malloc'd ANI */
 	char *ani;			
 	/*! Malloc'd RDNIS */
diff --git a/pbx.c b/pbx.c
index 1a18208fd210802c266478125be088268d8b98e0..279cafd0ecb088503899a7c5ee97499e02d24a9b 100755
--- a/pbx.c
+++ b/pbx.c
@@ -896,6 +896,8 @@ static void pbx_substitute_variables_temp(struct ast_channel *c, const char *var
 			*ret = workspace;
 		} else 
 			*ret = NULL;
+	} else if (c && !strcmp(var, "CALLERTON")) {
+		snprintf(workspace, workspacelen, "%d", c->callerton);
 	} else if (c && !strcmp(var, "DNID")) {
 		if (c->dnid) {
 			strncpy(workspace, c->dnid, workspacelen - 1);