[Asterisk-cvs] asterisk Makefile, 1.116, 1.117 channel.c, 1.142,
1.143 chanvars.c, 1.3, 1.4 pbx.c, 1.163, 1.164
markster at lists.digium.com
markster at lists.digium.com
Sat Oct 23 22:49:42 CDT 2004
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv4284
Modified Files:
Makefile channel.c chanvars.c pbx.c
Log Message:
Add "Loopback" switch
Index: Makefile
===================================================================
RCS file: /usr/cvsroot/asterisk/Makefile,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- Makefile 20 Oct 2004 12:47:03 -0000 1.116
+++ Makefile 24 Oct 2004 02:53:24 -0000 1.117
@@ -162,9 +162,11 @@
LIBEDIT=editline/libedit.a
ASTERISKVERSION=$(shell if [ -f .version ]; then cat .version; else if [ -d CVS ]; then if [ -f CVS/Tag ] ; then echo "CVS-`sed 's/^T//g' CVS/Tag`-`date +"%D-%T"`"; else echo "CVS-HEAD-`date +"%D-%T"`"; fi; fi; fi)
+ASTERISKVERSIONNUM=$(shell if [ -d CVS ]; then echo 999999 ; else if [ -f .version ] ; then awk -F. '{printf "%02d%02d%02d", $$1, $$2, $$3}' .version ; else echo 000000 ; fi ; fi)
HTTPDIR=$(shell if [ -d /var/www ]; then echo "/var/www"; else echo "/home/httpd"; fi)
RPMVERSION=$(shell if [ -f .version ]; then sed 's/[-\/:]/_/g' .version; else echo "unknown" ; fi)
CFLAGS+=-DASTERISK_VERSION=\"$(ASTERISKVERSION)\"
+CFLAGS+=-DASTERISK_VERSION_NUM=\"$(ASTERISKVERSIONNUM)\"
CFLAGS+=-DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
CFLAGS+=-DASTETCDIR=\"$(ASTETCDIR)\"
CFLAGS+=-DASTLIBDIR=\"$(ASTLIBDIR)\"
Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- channel.c 23 Oct 2004 12:19:47 -0000 1.142
+++ channel.c 24 Oct 2004 02:53:24 -0000 1.143
@@ -340,8 +340,6 @@
headp=&tmp->varshead;
ast_mutex_init(&tmp->lock);
AST_LIST_HEAD_INIT(headp);
- tmp->vars=ast_var_assign("tempvar","tempval");
- AST_LIST_INSERT_HEAD(headp,tmp->vars,entries);
strncpy(tmp->context, "default", sizeof(tmp->context)-1);
strncpy(tmp->language, defaultlanguage, sizeof(tmp->language)-1);
strncpy(tmp->exten, "s", sizeof(tmp->exten)-1);
Index: chanvars.c
===================================================================
RCS file: /usr/cvsroot/asterisk/chanvars.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- chanvars.c 16 May 2003 23:33:41 -0000 1.3
+++ chanvars.c 24 Oct 2004 02:53:24 -0000 1.4
@@ -17,7 +17,7 @@
#include <asterisk/chanvars.h>
#include <asterisk/logger.h>
-struct ast_var_t *ast_var_assign(char *name, char *value)
+struct ast_var_t *ast_var_assign(const char *name, const char *value)
{
int i;
struct ast_var_t *var;
Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -d -r1.163 -r1.164
--- pbx.c 22 Oct 2004 20:59:37 -0000 1.163
+++ pbx.c 24 Oct 2004 02:53:24 -0000 1.164
@@ -828,7 +828,7 @@
return NULL;
}
-static void pbx_substitute_variables_temp(struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen)
+static void pbx_substitute_variables_temp(struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp)
{
char *first,*second;
char tmpvar[80] = "";
@@ -836,7 +836,6 @@
struct tm brokentime;
int offset,offset2;
struct ast_var_t *variables;
- struct varshead *headp=NULL;
if (c)
headp=&c->varshead;
@@ -861,7 +860,7 @@
if (!first)
first = tmpvar + strlen(tmpvar);
*first='\0';
- pbx_substitute_variables_temp(c,tmpvar,ret,workspace,workspacelen - 1);
+ pbx_substitute_variables_temp(c,tmpvar,ret,workspace,workspacelen - 1, headp);
if (!(*ret)) return;
offset=atoi(first+1);
if ((second=strchr(first+1,':'))) {
@@ -1009,7 +1008,7 @@
strncpy(workspace, c->language, workspacelen - 1);
*ret = workspace;
} else {
- if (c) {
+ if (headp) {
AST_LIST_TRAVERSE(headp,variables,entries) {
#if 0
ast_log(LOG_WARNING,"Comparing variable '%s' with '%s'\n",var,ast_var_name(variables));
@@ -1056,7 +1055,7 @@
}
}
-void pbx_substitute_variables_helper(struct ast_channel *c, const char *cp1, char *cp2, int count)
+static void pbx_substitute_variables_helper_full(struct ast_channel *c, const char *cp1, char *cp2, int count, struct varshead *headp)
{
char *cp4;
const char *tmp, *whereweare;
@@ -1147,7 +1146,7 @@
/* Retrieve variable value */
workspace[0] = '\0';
- pbx_substitute_variables_temp(c,vars,&cp4, workspace, sizeof(workspace));
+ pbx_substitute_variables_temp(c,vars,&cp4, workspace, sizeof(workspace), headp);
if (cp4) {
length = strlen(cp4);
if (length > count)
@@ -1222,6 +1221,16 @@
}
}
+void pbx_substitute_variables_helper(struct ast_channel *c, const char *cp1, char *cp2, int count)
+{
+ pbx_substitute_variables_helper_full(c, cp1, cp2, count, NULL);
+}
+
+void pbx_substitute_variables_varshead(struct varshead *headp, const char *cp1, char *cp2, int count)
+{
+ pbx_substitute_variables_helper_full(NULL, cp1, cp2, count, headp);
+}
+
static void pbx_substitute_variables(char *passdata, int datalen, struct ast_channel *c, struct ast_exten *e) {
memset(passdata, 0, datalen);
@@ -1806,6 +1815,11 @@
return pbx_extension_helper(c, NULL, context, exten, priority, NULL, callerid, HELPER_SPAWN);
}
+int ast_exec_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
+{
+ return pbx_extension_helper(c, NULL, context, exten, priority, NULL, callerid, HELPER_EXEC);
+}
+
int ast_pbx_run(struct ast_channel *c)
{
int firstpass = 1;
@@ -5335,3 +5349,4 @@
}
return res;
}
+
More information about the svn-commits
mailing list