From fb1c18e6fd124dbd67b60d83e7f0bc7610f1012c Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Thu, 4 Sep 2003 22:46:06 +0000 Subject: [PATCH] Add ${DNIS} git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1475 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- README.variables | 2 ++ doc/README.variables | 2 ++ pbx.c | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/README.variables b/README.variables index 8a6a3e2019..e7e94d2395 100755 --- a/README.variables +++ b/README.variables @@ -40,6 +40,8 @@ ${ENV(VAR)} Environmental variable VAR ${EPOCH} Current unix style epoch ${DATETIME} Current date time in the format: YYYY-MM-DD_HH:MM:SS ${UNIQUEID} Current call unique identifier +${DNID} Dialed Number Identifier +${RDNIS} Redirected Dial Number ID Service There are two reference modes - reference by value and reference by name. To refer to a variable with its name (as an argument to a function that diff --git a/doc/README.variables b/doc/README.variables index 8a6a3e2019..e7e94d2395 100755 --- a/doc/README.variables +++ b/doc/README.variables @@ -40,6 +40,8 @@ ${ENV(VAR)} Environmental variable VAR ${EPOCH} Current unix style epoch ${DATETIME} Current date time in the format: YYYY-MM-DD_HH:MM:SS ${UNIQUEID} Current call unique identifier +${DNID} Dialed Number Identifier +${RDNIS} Redirected Dial Number ID Service There are two reference modes - reference by value and reference by name. To refer to a variable with its name (as an argument to a function that diff --git a/pbx.c b/pbx.c index 8c48d1e094..bb571274a5 100755 --- a/pbx.c +++ b/pbx.c @@ -797,6 +797,12 @@ static void pbx_substitute_variables_temp(struct ast_channel *c,const char *var, *ret = workspace; } else *ret = NULL; + } else if (c && !strcmp(var, "DNID")) { + if (c->dnid) { + strncpy(workspace, c->dnid, workspacelen - 1); + *ret = workspace; + } else + *ret = NULL; } else if (c && !strcmp(var, "HINT")) { if (!ast_get_hint(workspace, workspacelen - 1, c, c->context, c->exten)) *ret = NULL;