Add ${LANGUAGE} channel variable (bug #1078)
authorJames Golovich <james@gnuinter.net>
Sun, 22 Feb 2004 05:25:58 +0000 (05:25 +0000)
committerJames Golovich <james@gnuinter.net>
Sun, 22 Feb 2004 05:25:58 +0000 (05:25 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2210 65c4cc65-6c06-0410-ace0-fbb531ad65f3

doc/README.variables
pbx.c

index e924a8c..f33e783 100755 (executable)
@@ -46,7 +46,7 @@ ${DNID}         Dialed Number Identifier
 ${RDNIS}        Redirected Dial Number ID Service
 ${HANGUPCAUSE} Asterisk hangup cause
 ${ACCOUNTCODE}  Account code (if specified)
 ${RDNIS}        Redirected Dial Number ID Service
 ${HANGUPCAUSE} Asterisk hangup cause
 ${ACCOUNTCODE}  Account code (if specified)
-
+${LANGUAGE}    Current language
 ${SIPDOMAIN}    SIP destination domain of an inbound call (if appropriate)
 
 There are two reference modes - reference by value and reference by name. 
 ${SIPDOMAIN}    SIP destination domain of an inbound call (if appropriate)
 
 There are two reference modes - reference by value and reference by name. 
diff --git a/pbx.c b/pbx.c
index 27a9b1f..7e35f00 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -881,6 +881,9 @@ static void pbx_substitute_variables_temp(struct ast_channel *c,const char *var,
         } else if (c && !strcmp(var, "ACCOUNTCODE")) {
           strncpy(workspace, c->accountcode, workspacelen - 1);
           *ret = workspace;
         } else if (c && !strcmp(var, "ACCOUNTCODE")) {
           strncpy(workspace, c->accountcode, workspacelen - 1);
           *ret = workspace;
+        } else if (c && !strcmp(var, "LANGUAGE")) {
+          strncpy(workspace, c->language, workspacelen - 1);
+          *ret = workspace;
        } else {
                if (c) {
                        AST_LIST_TRAVERSE(headp,variables,entries) {
        } else {
                if (c) {
                        AST_LIST_TRAVERSE(headp,variables,entries) {