mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 08:31:02 +00:00
Bug # 2115: Allow Caller TON to be retrieved in the dialplan
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -443,6 +443,7 @@ static struct zt_pvt {
|
|||||||
char language[MAX_LANGUAGE];
|
char language[MAX_LANGUAGE];
|
||||||
char musicclass[MAX_LANGUAGE];
|
char musicclass[MAX_LANGUAGE];
|
||||||
char callerid[AST_MAX_EXTENSION];
|
char callerid[AST_MAX_EXTENSION];
|
||||||
|
int callerton;
|
||||||
char lastcallerid[AST_MAX_EXTENSION];
|
char lastcallerid[AST_MAX_EXTENSION];
|
||||||
char *origcallerid; /* malloced original callerid */
|
char *origcallerid; /* malloced original callerid */
|
||||||
char callwaitcid[AST_MAX_EXTENSION];
|
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->callerid = strdup(i->callerid);
|
||||||
tmp->ani = strdup(i->callerid);
|
tmp->ani = strdup(i->callerid);
|
||||||
}
|
}
|
||||||
|
tmp->callerton = i->callerton;
|
||||||
tmp->restrictcid = i->restrictcid;
|
tmp->restrictcid = i->restrictcid;
|
||||||
tmp->callingpres = i->callingpres;
|
tmp->callingpres = i->callingpres;
|
||||||
#ifdef ZAPATA_PRI
|
#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);
|
strncpy(pri->pvts[chanpos]->callerid, e->ring.callingnum, sizeof(pri->pvts[chanpos]->callerid)-1);
|
||||||
} else
|
} else
|
||||||
pri->pvts[chanpos]->callerid[0] = '\0';
|
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);
|
strncpy(pri->pvts[chanpos]->rdnis, e->ring.redirectingnum, sizeof(pri->pvts[chanpos]->rdnis) - 1);
|
||||||
/* If immediate=yes go to s|1 */
|
/* If immediate=yes go to s|1 */
|
||||||
if (pri->pvts[chanpos]->immediate) {
|
if (pri->pvts[chanpos]->immediate) {
|
||||||
|
@@ -148,7 +148,9 @@ struct ast_channel {
|
|||||||
/*! Malloc'd Dialed Number Identifier */
|
/*! Malloc'd Dialed Number Identifier */
|
||||||
char *dnid;
|
char *dnid;
|
||||||
/*! Malloc'd Caller ID */
|
/*! Malloc'd Caller ID */
|
||||||
char *callerid;
|
char *callerid;
|
||||||
|
/*! Caller Type Of Number */
|
||||||
|
int callerton;
|
||||||
/*! Malloc'd ANI */
|
/*! Malloc'd ANI */
|
||||||
char *ani;
|
char *ani;
|
||||||
/*! Malloc'd RDNIS */
|
/*! Malloc'd RDNIS */
|
||||||
|
2
pbx.c
2
pbx.c
@@ -896,6 +896,8 @@ static void pbx_substitute_variables_temp(struct ast_channel *c, const char *var
|
|||||||
*ret = workspace;
|
*ret = workspace;
|
||||||
} else
|
} else
|
||||||
*ret = NULL;
|
*ret = NULL;
|
||||||
|
} else if (c && !strcmp(var, "CALLERTON")) {
|
||||||
|
snprintf(workspace, workspacelen, "%d", c->callerton);
|
||||||
} else if (c && !strcmp(var, "DNID")) {
|
} else if (c && !strcmp(var, "DNID")) {
|
||||||
if (c->dnid) {
|
if (c->dnid) {
|
||||||
strncpy(workspace, c->dnid, workspacelen - 1);
|
strncpy(workspace, c->dnid, workspacelen - 1);
|
||||||
|
Reference in New Issue
Block a user