You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
443 lines
15 KiB
443 lines
15 KiB
Index: Makefile |
|
--- Makefile.orig 2008-12-03 01:53:56 +0100 |
|
+++ Makefile 2009-02-23 22:08:08 +0100 |
|
@@ -122,42 +122,20 @@ |
|
|
|
# Define standard directories for various platforms |
|
# These apply if they are not redefined in asterisk.conf |
|
-ifeq ($(OSARCH),SunOS) |
|
- ASTETCDIR=/var/etc/asterisk |
|
- ASTLIBDIR=/opt/asterisk/lib |
|
- ASTVARLIBDIR=/var/opt/asterisk |
|
- ASTDBDIR=$(ASTVARLIBDIR) |
|
- ASTKEYDIR=$(ASTVARLIBDIR) |
|
- ASTSPOOLDIR=/var/spool/asterisk |
|
- ASTLOGDIR=/var/log/asterisk |
|
- ASTHEADERDIR=/opt/asterisk/include |
|
- ASTBINDIR=/opt/asterisk/bin |
|
- ASTSBINDIR=/opt/asterisk/sbin |
|
- ASTVARRUNDIR=/var/run/asterisk |
|
- ASTMANDIR=/opt/asterisk/man |
|
-else |
|
ASTETCDIR=$(sysconfdir)/asterisk |
|
ASTLIBDIR=$(libdir)/asterisk |
|
ASTHEADERDIR=$(includedir)/asterisk |
|
ASTBINDIR=$(bindir) |
|
ASTSBINDIR=$(sbindir) |
|
- ASTSPOOLDIR=$(localstatedir)/spool/asterisk |
|
- ASTLOGDIR=$(localstatedir)/log/asterisk |
|
+ ASTSPOOLDIR=$(localstatedir)/spool |
|
+ ASTLOGDIR=$(localstatedir)/log |
|
ASTVARRUNDIR=$(localstatedir)/run |
|
ASTMANDIR=$(mandir) |
|
-ifneq ($(findstring BSD,$(OSARCH)),) |
|
ASTVARLIBDIR=$(prefix)/share/asterisk |
|
- ASTVARRUNDIR=$(localstatedir)/run/asterisk |
|
- ASTDBDIR=$(localstatedir)/db/asterisk |
|
-else |
|
- ASTVARLIBDIR=$(localstatedir)/lib/asterisk |
|
- ASTDBDIR=$(ASTVARLIBDIR) |
|
-endif |
|
+ ASTVARRUNDIR=$(localstatedir)/run |
|
+ ASTDBDIR=$(localstatedir)/db |
|
ASTKEYDIR=$(ASTVARLIBDIR) |
|
-endif |
|
-ifeq ($(ASTDATADIR),) |
|
ASTDATADIR:=$(ASTVARLIBDIR) |
|
-endif |
|
|
|
# Asterisk.conf is located in ASTETCDIR or by using the -C flag |
|
# when starting Asterisk |
|
@@ -250,12 +228,6 @@ |
|
ASTCFLAGS+=-fsigned-char |
|
endif |
|
|
|
-ifeq ($(OSARCH),FreeBSD) |
|
- # -V is understood by BSD Make, not by GNU make. |
|
- BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) |
|
- ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi) |
|
-endif |
|
- |
|
ifeq ($(OSARCH),NetBSD) |
|
ASTCFLAGS+=-pthread -I/usr/pkg/include |
|
endif |
|
@@ -526,8 +498,7 @@ |
|
if [ -n "$(OLDHEADERS)" ]; then \ |
|
rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\ |
|
fi |
|
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv |
|
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom |
|
+ mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr |
|
mkdir -p $(DESTDIR)$(ASTDATADIR)/keys |
|
mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware |
|
mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax |
|
Index: apps/app_backticks.c |
|
--- /dev/null 2009-02-23 22:11:56 +0100 |
|
+++ apps/app_backticks.c 2009-02-23 22:08:08 +0100 |
|
@@ -0,0 +1,129 @@ |
|
+ |
|
+#include "asterisk.h" |
|
+ |
|
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.45 $") |
|
+ |
|
+#include <stdio.h> |
|
+#include <asterisk/file.h> |
|
+#include <asterisk/logger.h> |
|
+#include <asterisk/channel.h> |
|
+#include <asterisk/pbx.h> |
|
+#include <asterisk/module.h> |
|
+#include <asterisk/lock.h> |
|
+#include <asterisk/app.h> |
|
+#include <stdlib.h> |
|
+#include <unistd.h> |
|
+#include <string.h> |
|
+ |
|
+static char *app = "BackTicks"; |
|
+static char *synopsis = "Execute a shell command and save the result as a variable."; |
|
+static char *desc = " Backticks(<VARNAME>|<command>)\n\n" |
|
+ "Be sure to include a full path to the command!\n"; |
|
+ |
|
+static char *do_backticks(char *command, char *buf, size_t len) |
|
+{ |
|
+ int fds[2], pid = 0; |
|
+ char *ret = NULL; |
|
+ |
|
+ memset(buf, 0, len); |
|
+ if (pipe(fds)) { |
|
+ ast_log(LOG_WARNING, "Pipe/Exec failed\n"); |
|
+ } else { |
|
+ pid = fork(); |
|
+ if (pid < 0) { |
|
+ ast_log(LOG_WARNING, "Fork failed\n"); |
|
+ close(fds[0]); |
|
+ close(fds[1]); |
|
+ } else if (pid) { |
|
+ /* parent */ |
|
+ close(fds[1]); |
|
+ read(fds[0], buf, len); |
|
+ close(fds[0]); |
|
+ ret = buf; |
|
+ } else { |
|
+ /* child */ |
|
+ char *argv[255] = {0}; |
|
+ int argc = 0; |
|
+ char *p; |
|
+ char *mycmd = ast_strdupa(command); |
|
+ close(fds[0]); |
|
+ dup2(fds[1], STDOUT_FILENO); |
|
+ argv[argc++] = mycmd; |
|
+ do { |
|
+ if ((p = strchr(mycmd, ' '))) { |
|
+ *p = '\0'; |
|
+ mycmd = ++p; |
|
+ argv[argc++] = mycmd; |
|
+ } |
|
+ } while (p != NULL); |
|
+ close(fds[1]); |
|
+ execv(argv[0], argv); |
|
+ ast_log(LOG_ERROR, "exec of %s failed\n", argv[0]); |
|
+ exit(0); |
|
+ } |
|
+ } |
|
+ return ret; |
|
+} |
|
+ |
|
+static int backticks_exec(struct ast_channel *chan, void *data) |
|
+{ |
|
+ int res = 0; |
|
+ const char *usage = "Usage: Backticks(<VARNAME>|<command>)"; |
|
+ char buf[1024], *argv[2], *mydata; |
|
+ int argc = 0; |
|
+ |
|
+ if (!data) { |
|
+ ast_log(LOG_WARNING, "%s\n", usage); |
|
+ return -1; |
|
+ } |
|
+ ast_autoservice_start(chan); |
|
+ if (!(mydata = ast_strdupa(data))) { |
|
+ ast_log(LOG_ERROR, "Memory Error!\n"); |
|
+ res = -1; |
|
+ } else { |
|
+ if((argc = ast_app_separate_args(mydata, '|', argv, sizeof(argv) / sizeof(argv[0]))) < 2) { |
|
+ ast_log(LOG_WARNING, "%s\n", usage); |
|
+ res = -1; |
|
+ } |
|
+ if (do_backticks(argv[1], buf, sizeof(buf))) |
|
+ pbx_builtin_setvar_helper(chan, argv[0], buf); |
|
+ else { |
|
+ ast_log(LOG_WARNING, "No Data!\n"); |
|
+ res = -1; |
|
+ } |
|
+ } |
|
+ ast_autoservice_stop(chan); |
|
+ return res; |
|
+} |
|
+ |
|
+static int function_backticks(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
|
+{ |
|
+ if (!do_backticks(data, buf, len)) { |
|
+ ast_log(LOG_WARNING, "No Data!\n"); |
|
+ return -1; |
|
+ } |
|
+ return 0; |
|
+} |
|
+ |
|
+static struct ast_custom_function backticks_function = { |
|
+ .name = "BACKTICKS", |
|
+ .desc = "Executes a shell command and evaluates to the result.", |
|
+ .syntax = "BACKTICKS(<command>)", |
|
+ .synopsis = "Executes a shell command.", |
|
+ .read = function_backticks |
|
+}; |
|
+ |
|
+static int unload_module(void) |
|
+{ |
|
+ ast_custom_function_unregister(&backticks_function); |
|
+ return ast_unregister_application(app); |
|
+} |
|
+ |
|
+static int load_module(void) |
|
+{ |
|
+ ast_custom_function_register(&backticks_function); |
|
+ return ast_register_application(app, backticks_exec, synopsis, desc); |
|
+} |
|
+ |
|
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "BACKTICKS() dialplan function"); |
|
+ |
|
Index: apps/app_meetme.c |
|
--- apps/app_meetme.c.orig 2009-01-22 17:53:12 +0100 |
|
+++ apps/app_meetme.c 2009-02-23 22:11:46 +0100 |
|
@@ -163,6 +163,7 @@ |
|
CONFFLAG_DURATION_LIMIT = (1 << 30), |
|
/*! Do not write any audio to this channel until the state is up. */ |
|
CONFFLAG_NO_AUDIO_UNTIL_UP = (1 << 31), |
|
+ CONFFLAG_USERNAME = (1 << 31), |
|
}; |
|
|
|
enum { |
|
@@ -172,6 +173,7 @@ |
|
OPT_ARG_DURATION_LIMIT = 3, |
|
OPT_ARG_MOH_CLASS = 4, |
|
OPT_ARG_ARRAY_SIZE = 5, |
|
+ OPT_ARG_USERNAME = 6, |
|
}; |
|
|
|
AST_APP_OPTIONS(meetme_opts, BEGIN_OPTIONS |
|
@@ -203,6 +205,7 @@ |
|
AST_APP_OPTION('1', CONFFLAG_NOONLYPERSON ), |
|
AST_APP_OPTION_ARG('S', CONFFLAG_DURATION_STOP, OPT_ARG_DURATION_STOP), |
|
AST_APP_OPTION_ARG('L', CONFFLAG_DURATION_LIMIT, OPT_ARG_DURATION_LIMIT), |
|
+ AST_APP_OPTION_ARG('n', CONFFLAG_USERNAME, OPT_ARG_USERNAME), |
|
END_OPTIONS ); |
|
|
|
static const char *app = "MeetMe"; |
|
@@ -1830,6 +1833,12 @@ |
|
if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW))) { |
|
char destdir[PATH_MAX]; |
|
|
|
+ if ( (confflags & CONFFLAG_USERNAME) |
|
+ && !ast_strlen_zero(optargs[OPT_ARG_USERNAME]) |
|
+ && ast_fileexists(optargs[OPT_ARG_USERNAME], NULL, NULL)) |
|
+ snprintf(destdir, sizeof(destdir), "%s", optargs[OPT_ARG_USERNAME]); |
|
+ else { |
|
+ |
|
snprintf(destdir, sizeof(destdir), "%s/meetme", ast_config_AST_SPOOL_DIR); |
|
|
|
if (ast_mkdir(destdir, 0777) != 0) { |
|
@@ -1846,6 +1855,7 @@ |
|
res = ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL); |
|
if (res == -1) |
|
goto outrun; |
|
+ } |
|
} |
|
|
|
ast_mutex_lock(&conf->playlock); |
|
Index: build_tools/make_defaults_h |
|
--- build_tools/make_defaults_h.orig 2008-01-24 23:58:10 +0100 |
|
+++ build_tools/make_defaults_h 2009-02-23 22:08:08 +0100 |
|
@@ -17,7 +17,7 @@ |
|
#define DEFAULT_PID "${INSTALL_PATH}${ASTVARRUNDIR}/asterisk.pid" |
|
|
|
#define DEFAULT_VAR_DIR "${INSTALL_PATH}${ASTVARLIBDIR}" |
|
-#define DEFAULT_DB "${INSTALL_PATH}${ASTDBDIR}/astdb" |
|
+#define DEFAULT_DB "${INSTALL_PATH}${ASTDBDIR}/asterisk.db" |
|
|
|
#define DEFAULT_DATA_DIR "${INSTALL_PATH}${ASTDATADIR}" |
|
#define DEFAULT_KEY_DIR "${INSTALL_PATH}${ASTDATADIR}/keys" |
|
Index: cdr/cdr_custom.c |
|
--- cdr/cdr_custom.c.orig 2008-03-25 23:52:24 +0100 |
|
+++ cdr/cdr_custom.c 2009-02-23 22:08:08 +0100 |
|
@@ -78,7 +78,7 @@ |
|
ast_log(LOG_WARNING, "Format string too long, will be truncated, at line %d\n", var->lineno); |
|
ast_copy_string(format, var->value, sizeof(format) - 1); |
|
strcat(format,"\n"); |
|
- snprintf(master, sizeof(master),"%s/%s/%s", ast_config_AST_LOG_DIR, name, var->name); |
|
+ snprintf(master, sizeof(master),"%s/cdr/%s", ast_config_AST_LOG_DIR, var->name); |
|
if (var->next) { |
|
ast_log(LOG_NOTICE, "Sorry, only one mapping is supported at this time, mapping '%s' will be ignored at line %d.\n", var->next->name, var->next->lineno); |
|
break; |
|
Index: cdr/cdr_sqlite3_custom.c |
|
--- cdr/cdr_sqlite3_custom.c.orig 2008-08-14 20:48:39 +0200 |
|
+++ cdr/cdr_sqlite3_custom.c 2009-02-23 22:08:08 +0100 |
|
@@ -317,7 +317,7 @@ |
|
return AST_MODULE_LOAD_DECLINE; |
|
|
|
/* is the database there? */ |
|
- snprintf(filename, sizeof(filename), "%s/master.db", ast_config_AST_LOG_DIR); |
|
+ snprintf(filename, sizeof(filename), "%s/cdr/master.db", ast_config_AST_LOG_DIR); |
|
res = sqlite3_open(filename, &db); |
|
if (res != SQLITE_OK) { |
|
ast_log(LOG_ERROR, "Could not open database %s.\n", filename); |
|
Index: channels/console_video.h |
|
--- channels/console_video.h.orig 2008-01-09 19:03:40 +0100 |
|
+++ channels/console_video.h 2009-02-23 22:08:08 +0100 |
|
@@ -28,10 +28,7 @@ |
|
"console {device}" |
|
#else |
|
|
|
-#include <ffmpeg/avcodec.h> |
|
-#ifndef OLD_FFMPEG |
|
-#include <ffmpeg/swscale.h> /* requires a recent ffmpeg */ |
|
-#endif |
|
+#include <libavcoded/avcodec.h> |
|
|
|
#define CONSOLE_VIDEO_CMDS \ |
|
"console {videodevice|videocodec" \ |
|
Index: configure |
|
--- configure.orig 2009-01-30 00:47:00 +0100 |
|
+++ configure 2009-02-23 22:08:08 +0100 |
|
@@ -4040,12 +4040,6 @@ |
|
# note- does not work on FreeBSD |
|
|
|
case "${host_os}" in |
|
- freebsd*) |
|
- ac_default_prefix=/usr/local |
|
- CPPFLAGS=-I/usr/local/include |
|
- LDFLAGS=-L/usr/local/lib |
|
- ;; |
|
- |
|
*) |
|
ac_default_prefix=/usr |
|
if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then |
|
Index: include/asterisk/module.h |
|
--- include/asterisk/module.h.orig 2008-11-29 19:37:55 +0100 |
|
+++ include/asterisk/module.h 2009-02-23 22:08:08 +0100 |
|
@@ -271,7 +271,7 @@ |
|
/* forward declare this pointer in modules, so that macro/function |
|
calls that need it can get it, since it will actually be declared |
|
and populated at the end of the module's source file... */ |
|
-const static __attribute__((unused)) struct ast_module_info *ast_module_info; |
|
+static const __attribute__((unused)) struct ast_module_info *ast_module_info; |
|
|
|
#if !defined(EMBEDDED_MODULE) |
|
#define __MODULE_INFO_SECTION |
|
Index: main/Makefile |
|
--- main/Makefile.orig 2008-11-29 19:37:55 +0100 |
|
+++ main/Makefile 2009-02-23 22:08:08 +0100 |
|
@@ -81,10 +81,7 @@ |
|
endif |
|
|
|
ifeq ($(OSARCH),FreeBSD) |
|
- # -V is understood by BSD Make, not by GNU make. |
|
- BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) |
|
- AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi) |
|
- AST_LIBS+=-lcrypto |
|
+ AST_LIBS+=-lpthread -lcrypto |
|
endif |
|
|
|
ifneq ($(findstring $(OSARCH), mingw32 cygwin ),) |
|
Index: main/file.c |
|
--- main/file.c.orig 2009-02-04 16:30:54 +0100 |
|
+++ main/file.c 2009-02-23 22:08:08 +0100 |
|
@@ -247,7 +247,7 @@ |
|
char *fn = NULL; |
|
|
|
if (!strcmp(ext, "wav49")) |
|
- ext = "WAV"; |
|
+ ext = "wav"; |
|
|
|
if (filename[0] == '/') { |
|
if (asprintf(&fn, "%s.%s", filename, ext) < 0) { |
|
Index: main/http.c |
|
--- main/http.c.orig 2009-01-14 00:11:19 +0100 |
|
+++ main/http.c 2009-02-23 22:08:08 +0100 |
|
@@ -435,14 +435,8 @@ |
|
ast_log(LOG_WARNING, "Got unexpected GMIME_IS_MESSAGE_PARTIAL\n"); |
|
return; |
|
} else if (GMIME_IS_MULTIPART(part)) { |
|
- GList *l; |
|
- |
|
ast_log(LOG_WARNING, "Got unexpected GMIME_IS_MULTIPART, trying to process subparts\n"); |
|
- l = GMIME_MULTIPART (part)->subparts; |
|
- while (l) { |
|
- process_message_callback(l->data, cbinfo); |
|
- l = l->next; |
|
- } |
|
+ g_mime_multipart_foreach(GMIME_MULTIPART(part), process_message_callback, cbinfo); |
|
} else if (GMIME_IS_PART(part)) { |
|
const char *filename; |
|
|
|
Index: main/tcptls.c |
|
--- main/tcptls.c.orig 2009-02-04 19:55:32 +0100 |
|
+++ main/tcptls.c 2009-02-23 22:08:08 +0100 |
|
@@ -210,6 +210,7 @@ |
|
if (!ast_strlen_zero(cfg->cafile) || !ast_strlen_zero(cfg->capath)) { |
|
if (SSL_CTX_load_verify_locations(cfg->ssl_ctx, S_OR(cfg->cafile, NULL), S_OR(cfg->capath,NULL)) == 0) |
|
ast_verb(0, "SSL CA file(%s)/path(%s) error\n", cfg->cafile, cfg->capath); |
|
+ SSL_CTX_set_client_CA_list(cfg->ssl_ctx, S_OR(cfg->cafile, NULL)); |
|
} |
|
|
|
ast_verb(0, "SSL certificate ok\n"); |
|
Index: menuselect-tree |
|
--- menuselect-tree.orig 2009-02-23 18:32:38 +0100 |
|
+++ menuselect-tree 2009-02-23 22:08:08 +0100 |
|
@@ -155,6 +155,8 @@ |
|
</member> |
|
<member name="app_system" displayname="Generic System() application" remove_on_change="apps/app_system.o apps/app_system.so"> |
|
</member> |
|
+<member name="app_backticks" displayname="Generic Backticks() application" remove_on_change="apps/app_backticks.o apps/app_backticks.so"> |
|
+</member> |
|
<member name="app_talkdetect" displayname="Playback with Talk Detection" remove_on_change="apps/app_talkdetect.o apps/app_talkdetect.so"> |
|
</member> |
|
<member name="app_test" displayname="Interface Test Application" remove_on_change="apps/app_test.o apps/app_test.so"> |
|
@@ -617,9 +619,9 @@ |
|
<member name="CORE-SOUNDS-EN-ULAW" displayname="English, mu-Law format"> |
|
</member> |
|
<member name="CORE-SOUNDS-EN-ALAW" displayname="English, a-Law format"> |
|
+ <defaultenabled>yes</defaultenabled> |
|
</member> |
|
<member name="CORE-SOUNDS-EN-GSM" displayname="English, GSM format" > |
|
- <defaultenabled>yes</defaultenabled> |
|
</member> |
|
<member name="CORE-SOUNDS-EN-G729" displayname="English, G.729 format"> |
|
</member> |
|
@@ -677,6 +679,7 @@ |
|
<member name="EXTRA-SOUNDS-EN-ULAW" displayname="English, mu-Law format"> |
|
</member> |
|
<member name="EXTRA-SOUNDS-EN-ALAW" displayname="English, a-Law format"> |
|
+ <defaultenabled>yes</defaultenabled> |
|
</member> |
|
<member name="EXTRA-SOUNDS-EN-GSM" displayname="English, GSM format" > |
|
</member> |
|
Index: sounds/sounds.xml |
|
--- sounds/sounds.xml.orig 2008-03-06 05:46:17 +0100 |
|
+++ sounds/sounds.xml 2009-02-23 22:08:08 +0100 |
|
@@ -4,9 +4,9 @@ |
|
<member name="CORE-SOUNDS-EN-ULAW" displayname="English, mu-Law format"> |
|
</member> |
|
<member name="CORE-SOUNDS-EN-ALAW" displayname="English, a-Law format"> |
|
+ <defaultenabled>yes</defaultenabled> |
|
</member> |
|
<member name="CORE-SOUNDS-EN-GSM" displayname="English, GSM format" > |
|
- <defaultenabled>yes</defaultenabled> |
|
</member> |
|
<member name="CORE-SOUNDS-EN-G729" displayname="English, G.729 format"> |
|
</member> |
|
@@ -64,6 +64,7 @@ |
|
<member name="EXTRA-SOUNDS-EN-ULAW" displayname="English, mu-Law format"> |
|
</member> |
|
<member name="EXTRA-SOUNDS-EN-ALAW" displayname="English, a-Law format"> |
|
+ <defaultenabled>yes</defaultenabled> |
|
</member> |
|
<member name="EXTRA-SOUNDS-EN-GSM" displayname="English, GSM format" > |
|
</member>
|
|
|