asterisk/asterisk.patch

Sun, 20 Mar 2011 20:00:02 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 20 Mar 2011 20:00:02 +0100
changeset 310
73d852a30c9a
parent 202
f29abea29121
child 311
263143ec0fb2
permissions
-rw-r--r--

Resynchronize with upstream package maintainer version.

michael@310 1 Index: Makefile
michael@310 2 --- Makefile.orig 2010-06-10 22:35:06.000000000 +0200
michael@310 3 +++ Makefile 2010-07-24 11:16:19.000000000 +0200
michael@310 4 @@ -126,40 +126,18 @@
michael@202 5
michael@310 6 # Define standard directories for various platforms
michael@310 7 # These apply if they are not redefined in asterisk.conf
michael@310 8 -ifeq ($(OSARCH),SunOS)
michael@310 9 - ASTETCDIR=/var/etc/asterisk
michael@310 10 - ASTLIBDIR=/opt/asterisk/lib
michael@310 11 - ASTVARLIBDIR=/var/opt/asterisk
michael@310 12 - ASTDBDIR=$(ASTVARLIBDIR)
michael@310 13 - ASTKEYDIR=$(ASTVARLIBDIR)
michael@310 14 - ASTSPOOLDIR=/var/spool/asterisk
michael@310 15 - ASTLOGDIR=/var/log/asterisk
michael@310 16 - ASTHEADERDIR=/opt/asterisk/include
michael@310 17 - ASTSBINDIR=/opt/asterisk/sbin
michael@310 18 - ASTVARRUNDIR=/var/run/asterisk
michael@310 19 - ASTMANDIR=/opt/asterisk/man
michael@310 20 -else
michael@310 21 ASTETCDIR=$(sysconfdir)/asterisk
michael@310 22 ASTLIBDIR=$(libdir)/asterisk
michael@310 23 ASTHEADERDIR=$(includedir)/asterisk
michael@310 24 ASTSBINDIR=$(sbindir)
michael@310 25 - ASTSPOOLDIR=$(localstatedir)/spool/asterisk
michael@310 26 - ASTLOGDIR=$(localstatedir)/log/asterisk
michael@310 27 - ASTVARRUNDIR=$(localstatedir)/run/asterisk
michael@310 28 + ASTSPOOLDIR=$(localstatedir)/spool
michael@310 29 + ASTLOGDIR=$(localstatedir)/log
michael@310 30 + ASTVARRUNDIR=$(localstatedir)/run
michael@310 31 ASTMANDIR=$(mandir)
michael@310 32 -ifneq ($(findstring BSD,$(OSARCH)),)
michael@310 33 - ASTVARLIBDIR=$(prefix)/share/asterisk
michael@310 34 - ASTVARRUNDIR=$(localstatedir)/run/asterisk
michael@310 35 - ASTDBDIR=$(localstatedir)/db/asterisk
michael@310 36 -else
michael@310 37 - ASTVARLIBDIR=$(localstatedir)/lib/asterisk
michael@310 38 - ASTDBDIR=$(ASTVARLIBDIR)
michael@310 39 -endif
michael@310 40 + ASTVARLIBDIR=$(localstatedir)/lib
michael@310 41 + ASTDBDIR=$(localstatedir)/db
michael@310 42 ASTKEYDIR=$(ASTVARLIBDIR)
michael@310 43 -endif
michael@310 44 -ifeq ($(ASTDATADIR),)
michael@310 45 ASTDATADIR:=$(ASTVARLIBDIR)
michael@310 46 -endif
michael@202 47
michael@310 48 # Asterisk.conf is located in ASTETCDIR or by using the -C flag
michael@310 49 # when starting Asterisk
michael@310 50 @@ -259,12 +237,6 @@
michael@310 51 _ASTCFLAGS+=-fsigned-char
michael@310 52 endif
michael@202 53
michael@310 54 -ifeq ($(OSARCH),FreeBSD)
michael@310 55 - # -V is understood by BSD Make, not by GNU make.
michael@310 56 - BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
michael@310 57 - _ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
michael@310 58 -endif
michael@202 59 -
michael@310 60 ifeq ($(OSARCH),NetBSD)
michael@310 61 _ASTCFLAGS+=-pthread -I/usr/pkg/include
michael@310 62 endif
michael@310 63 @@ -567,8 +539,7 @@
michael@310 64 fi
michael@310 65 mkdir -p $(DESTDIR)$(ASTDATADIR)/documentation
michael@310 66 mkdir -p $(DESTDIR)$(ASTDATADIR)/documentation/thirdparty
michael@310 67 - mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
michael@310 68 - mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
michael@310 69 + mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr
michael@310 70 mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
michael@310 71 mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
michael@310 72 mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
michael@310 73 Index: apps/app_backticks.c
michael@310 74 --- apps/app_backticks.c.orig 2010-07-24 11:12:31.000000000 +0200
michael@310 75 +++ apps/app_backticks.c 2010-07-24 11:12:31.000000000 +0200
michael@310 76 @@ -0,0 +1,129 @@
michael@202 77 +
michael@202 78 +#include "asterisk.h"
michael@202 79 +
michael@310 80 +ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.53 $")
michael@202 81 +
michael@310 82 +#include <stdio.h>
michael@310 83 +#include <asterisk/file.h>
michael@310 84 +#include <asterisk/logger.h>
michael@310 85 +#include <asterisk/channel.h>
michael@310 86 +#include <asterisk/pbx.h>
michael@310 87 +#include <asterisk/module.h>
michael@310 88 +#include <asterisk/lock.h>
michael@310 89 +#include <asterisk/app.h>
michael@310 90 +#include <stdlib.h>
michael@310 91 +#include <unistd.h>
michael@310 92 +#include <string.h>
michael@202 93 +
michael@310 94 +static char *app = "BackTicks";
michael@310 95 +static char *synopsis = "Execute a shell command and save the result as a variable.";
michael@310 96 +static char *desc = " Backticks(<VARNAME>|<command>)\n\n"
michael@310 97 + "Be sure to include a full path to the command!\n";
michael@202 98 +
michael@310 99 +static char *do_backticks(char *command, char *buf, size_t len)
michael@310 100 +{
michael@310 101 + int fds[2], pid = 0;
michael@310 102 + char *ret = NULL;
michael@202 103 +
michael@310 104 + memset(buf, 0, len);
michael@310 105 + if (pipe(fds)) {
michael@310 106 + ast_log(LOG_WARNING, "Pipe/Exec failed\n");
michael@310 107 + } else {
michael@310 108 + pid = fork();
michael@310 109 + if (pid < 0) {
michael@310 110 + ast_log(LOG_WARNING, "Fork failed\n");
michael@310 111 + close(fds[0]);
michael@310 112 + close(fds[1]);
michael@310 113 + } else if (pid) {
michael@310 114 + /* parent */
michael@310 115 + close(fds[1]);
michael@310 116 + read(fds[0], buf, len);
michael@310 117 + close(fds[0]);
michael@310 118 + ret = buf;
michael@310 119 + } else {
michael@310 120 + /* child */
michael@310 121 + char *argv[255] = {0};
michael@310 122 + int argc = 0;
michael@310 123 + char *p;
michael@310 124 + char *mycmd = ast_strdupa(command);
michael@310 125 + close(fds[0]);
michael@310 126 + dup2(fds[1], STDOUT_FILENO);
michael@310 127 + argv[argc++] = mycmd;
michael@310 128 + do {
michael@310 129 + if ((p = strchr(mycmd, ' '))) {
michael@310 130 + *p = '\0';
michael@310 131 + mycmd = ++p;
michael@310 132 + argv[argc++] = mycmd;
michael@310 133 + }
michael@310 134 + } while (p != NULL);
michael@310 135 + close(fds[1]);
michael@310 136 + execv(argv[0], argv);
michael@310 137 + ast_log(LOG_ERROR, "exec of %s failed\n", argv[0]);
michael@310 138 + exit(0);
michael@310 139 + }
michael@310 140 + }
michael@310 141 + return ret;
michael@202 142 +}
michael@202 143 +
michael@310 144 +static int backticks_exec(struct ast_channel *chan, void *data)
michael@202 145 +{
michael@310 146 + int res = 0;
michael@310 147 + const char *usage = "Usage: Backticks(<VARNAME>|<command>)";
michael@310 148 + char buf[1024], *argv[2], *mydata;
michael@310 149 + int argc = 0;
michael@310 150 +
michael@310 151 + if (!data) {
michael@310 152 + ast_log(LOG_WARNING, "%s\n", usage);
michael@310 153 + return -1;
michael@310 154 + }
michael@310 155 + ast_autoservice_start(chan);
michael@310 156 + if (!(mydata = ast_strdupa(data))) {
michael@310 157 + ast_log(LOG_ERROR, "Memory Error!\n");
michael@310 158 + res = -1;
michael@310 159 + } else {
michael@310 160 + if((argc = ast_app_separate_args(mydata, '|', argv, sizeof(argv) / sizeof(argv[0]))) < 2) {
michael@310 161 + ast_log(LOG_WARNING, "%s\n", usage);
michael@310 162 + res = -1;
michael@310 163 + }
michael@310 164 + if (do_backticks(argv[1], buf, sizeof(buf)))
michael@310 165 + pbx_builtin_setvar_helper(chan, argv[0], buf);
michael@310 166 + else {
michael@310 167 + ast_log(LOG_WARNING, "No Data!\n");
michael@310 168 + res = -1;
michael@310 169 + }
michael@310 170 + }
michael@310 171 + ast_autoservice_stop(chan);
michael@310 172 + return res;
michael@202 173 +}
michael@202 174 +
michael@310 175 +static int function_backticks(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
michael@202 176 +{
michael@310 177 + if (!do_backticks(data, buf, len)) {
michael@310 178 + ast_log(LOG_WARNING, "No Data!\n");
michael@310 179 + return -1;
michael@310 180 + }
michael@310 181 + return 0;
michael@202 182 +}
michael@202 183 +
michael@310 184 +static struct ast_custom_function backticks_function = {
michael@310 185 + .name = "BACKTICKS",
michael@310 186 + .desc = "Executes a shell command and evaluates to the result.",
michael@310 187 + .syntax = "BACKTICKS(<command>)",
michael@310 188 + .synopsis = "Executes a shell command.",
michael@310 189 + .read = function_backticks
michael@202 190 +};
michael@202 191 +
michael@202 192 +static int unload_module(void)
michael@202 193 +{
michael@310 194 + ast_custom_function_unregister(&backticks_function);
michael@310 195 + return ast_unregister_application(app);
michael@202 196 +}
michael@202 197 +
michael@202 198 +static int load_module(void)
michael@202 199 +{
michael@310 200 + ast_custom_function_register(&backticks_function);
michael@310 201 + return ast_register_application(app, backticks_exec, synopsis, desc);
michael@202 202 +}
michael@202 203 +
michael@310 204 +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "BACKTICKS() dialplan function");
michael@202 205 +
michael@310 206 Index: apps/app_meetme.c
michael@310 207 --- apps/app_meetme.c.orig 2010-06-23 23:15:53.000000000 +0200
michael@310 208 +++ apps/app_meetme.c 2010-07-24 11:12:31.000000000 +0200
michael@310 209 @@ -522,6 +522,7 @@
michael@310 210 CONFFLAG_DURATION_LIMIT = (1 << 30),
michael@310 211 /*! Do not write any audio to this channel until the state is up. */
michael@310 212 CONFFLAG_NO_AUDIO_UNTIL_UP = (1 << 31),
michael@310 213 + CONFFLAG_USERNAME = (1 << 31),
michael@310 214 };
michael@310 215
michael@310 216 enum {
michael@310 217 @@ -531,6 +532,7 @@
michael@310 218 OPT_ARG_DURATION_LIMIT = 3,
michael@310 219 OPT_ARG_MOH_CLASS = 4,
michael@310 220 OPT_ARG_ARRAY_SIZE = 5,
michael@310 221 + OPT_ARG_USERNAME = 6,
michael@310 222 };
michael@310 223
michael@310 224 AST_APP_OPTIONS(meetme_opts, BEGIN_OPTIONS
michael@310 225 @@ -563,6 +565,7 @@
michael@310 226 AST_APP_OPTION('1', CONFFLAG_NOONLYPERSON ),
michael@310 227 AST_APP_OPTION_ARG('S', CONFFLAG_DURATION_STOP, OPT_ARG_DURATION_STOP),
michael@310 228 AST_APP_OPTION_ARG('L', CONFFLAG_DURATION_LIMIT, OPT_ARG_DURATION_LIMIT),
michael@310 229 + AST_APP_OPTION_ARG('n', CONFFLAG_USERNAME, OPT_ARG_USERNAME),
michael@310 230 END_OPTIONS );
michael@310 231
michael@310 232 static const char *app = "MeetMe";
michael@310 233 @@ -2243,6 +2246,12 @@
michael@310 234 if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW))) {
michael@310 235 char destdir[PATH_MAX];
michael@310 236
michael@310 237 + if ( (confflags & CONFFLAG_USERNAME)
michael@310 238 + && !ast_strlen_zero(optargs[OPT_ARG_USERNAME])
michael@310 239 + && ast_fileexists(optargs[OPT_ARG_USERNAME], NULL, NULL))
michael@310 240 + snprintf(destdir, sizeof(destdir), "%s", optargs[OPT_ARG_USERNAME]);
michael@310 241 + else {
michael@202 242 +
michael@310 243 snprintf(destdir, sizeof(destdir), "%s/meetme", ast_config_AST_SPOOL_DIR);
michael@310 244
michael@310 245 if (ast_mkdir(destdir, 0777) != 0) {
michael@310 246 @@ -2259,6 +2268,7 @@
michael@310 247 res = ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL);
michael@310 248 if (res == -1)
michael@310 249 goto outrun;
michael@310 250 + }
michael@310 251 }
michael@310 252
michael@310 253 ast_mutex_lock(&conf->playlock);
michael@310 254 Index: build_tools/make_defaults_h
michael@310 255 --- build_tools/make_defaults_h.orig 2008-01-24 23:58:10.000000000 +0100
michael@310 256 +++ build_tools/make_defaults_h 2010-07-24 11:12:31.000000000 +0200
michael@310 257 @@ -17,7 +17,7 @@
michael@310 258 #define DEFAULT_PID "${INSTALL_PATH}${ASTVARRUNDIR}/asterisk.pid"
michael@310 259
michael@310 260 #define DEFAULT_VAR_DIR "${INSTALL_PATH}${ASTVARLIBDIR}"
michael@310 261 -#define DEFAULT_DB "${INSTALL_PATH}${ASTDBDIR}/astdb"
michael@310 262 +#define DEFAULT_DB "${INSTALL_PATH}${ASTDBDIR}/asterisk.db"
michael@310 263
michael@310 264 #define DEFAULT_DATA_DIR "${INSTALL_PATH}${ASTDATADIR}"
michael@310 265 #define DEFAULT_KEY_DIR "${INSTALL_PATH}${ASTDATADIR}/keys"
michael@310 266 Index: cdr/cdr_custom.c
michael@310 267 --- cdr/cdr_custom.c.orig 2008-11-20 18:48:58.000000000 +0100
michael@310 268 +++ cdr/cdr_custom.c 2010-07-24 11:12:31.000000000 +0200
michael@310 269 @@ -83,7 +83,7 @@
michael@310 270 ast_log(LOG_WARNING, "Format string too long, will be truncated, at line %d\n", var->lineno);
michael@310 271 ast_copy_string(format, var->value, sizeof(format) - 1);
michael@310 272 strcat(format,"\n");
michael@310 273 - snprintf(master, sizeof(master),"%s/%s/%s", ast_config_AST_LOG_DIR, name, var->name);
michael@310 274 + snprintf(master, sizeof(master),"%s/cdr/%s", ast_config_AST_LOG_DIR, var->name);
michael@310 275 if (var->next) {
michael@310 276 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);
michael@310 277 break;
michael@310 278 Index: cdr/cdr_sqlite3_custom.c
michael@310 279 --- cdr/cdr_sqlite3_custom.c.orig 2010-04-13 18:38:41.000000000 +0200
michael@310 280 +++ cdr/cdr_sqlite3_custom.c 2010-07-24 11:12:31.000000000 +0200
michael@310 281 @@ -300,7 +300,7 @@
michael@310 282 }
michael@310 283
michael@310 284 /* is the database there? */
michael@310 285 - snprintf(filename, sizeof(filename), "%s/master.db", ast_config_AST_LOG_DIR);
michael@310 286 + snprintf(filename, sizeof(filename), "%s/cdr/master.db", ast_config_AST_LOG_DIR);
michael@310 287 res = sqlite3_open(filename, &db);
michael@310 288 if (res != SQLITE_OK) {
michael@310 289 ast_log(LOG_ERROR, "Could not open database %s.\n", filename);
michael@310 290 Index: chan_capi-1.1.5/Makefile
michael@310 291 --- chan_capi-1.1.5/Makefile.orig 2010-04-06 19:33:25.000000000 +0200
michael@310 292 +++ chan_capi-1.1.5/Makefile 2010-07-24 11:12:31.000000000 +0200
michael@310 293 @@ -100,6 +100,9 @@
michael@310 294 CFLAGS+=-O2
michael@310 295 CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
michael@310 296 CFLAGS+=$(shell if uname -m | grep -q "ppc\|arm\|s390"; then echo "-fsigned-char"; fi)
michael@310 297 +ifeq (${USE_OWN_LIBCAPI},yes)
michael@310 298 +CFLAGS+=-DUSE_OWN_LIBCAPI
michael@310 299 +endif
michael@310 300
michael@310 301 LIBS=-ldl -lpthread -lm
michael@310 302 CC=gcc
michael@310 303 Index: chan_capi-1.1.5/chan_capi20.h
michael@310 304 --- chan_capi-1.1.5/chan_capi20.h.orig 2005-09-20 20:33:40.000000000 +0200
michael@310 305 +++ chan_capi-1.1.5/chan_capi20.h 2010-07-24 11:12:31.000000000 +0200
michael@310 306 @@ -8,6 +8,8 @@
michael@310 307
michael@310 308 #undef CAPI_OS_HINT
michael@310 309
michael@310 310 +#ifndef USE_OWN_LIBCAPI
michael@310 311 +
michael@310 312 #if (defined(__FreeBSD__) || defined(__OpenBSD__) || \
michael@310 313 defined(__NetBSD__) || defined(__APPLE__))
michael@310 314
michael@310 315 @@ -29,6 +31,8 @@
michael@310 316 #include <capiutils.h>
michael@310 317 #endif /* BSD */
michael@310 318
michael@202 319 +#endif
michael@202 320 +
michael@310 321 #ifndef HEADER_CID
michael@310 322 #define HEADER_CID(x) ((x)->adr.adrNCCI)
michael@310 323 #endif
michael@310 324 Index: chan_capi-1.1.5/chan_capi_utils.c
michael@310 325 --- chan_capi-1.1.5/chan_capi_utils.c.orig 2010-04-06 19:33:25.000000000 +0200
michael@310 326 +++ chan_capi-1.1.5/chan_capi_utils.c 2010-07-24 11:12:31.000000000 +0200
michael@310 327 @@ -1087,6 +1087,9 @@
michael@310 328 {
michael@310 329 MESSAGE_EXCHANGE_ERROR error;
michael@310 330 int waitcount = 50;
michael@310 331 +#ifndef CAPI_MANUFACTURER_LEN
michael@310 332 +#define CAPI_MANUFACTURER_LEN 64
michael@310 333 +#endif
michael@310 334 unsigned char manbuf[CAPI_MANUFACTURER_LEN];
michael@310 335 _cmsg CMSG;
michael@310 336
michael@310 337 Index: chan_capi-1.1.5/libcapi20/capi20.c
michael@310 338 --- chan_capi-1.1.5/libcapi20/capi20.c.orig 2010-04-06 19:33:25.000000000 +0200
michael@310 339 +++ chan_capi-1.1.5/libcapi20/capi20.c 2010-07-24 11:12:31.000000000 +0200
michael@310 340 @@ -19,8 +19,10 @@
michael@310 341 #include <stdio.h>
michael@310 342 #include <ctype.h>
michael@310 343 #include <assert.h>
michael@310 344 +#ifdef __linux__
michael@310 345 #define _LINUX_LIST_H
michael@310 346 #include <linux/capi.h>
michael@310 347 +#endif
michael@310 348
michael@310 349 #include <sys/socket.h>
michael@310 350 #include <netinet/in.h>
michael@310 351 @@ -48,17 +50,23 @@
michael@310 352
michael@310 353 #define SEND_BUFSIZ (128+2048)
michael@310 354
michael@202 355 +#if 0
michael@310 356 static char capidevname[] = "/dev/capi20";
michael@310 357 static char capidevnamenew[] = "/dev/isdn/capi20";
michael@310 358 +#endif
michael@310 359
michael@310 360 static int capi_fd = -1;
michael@310 361 +#if 0
michael@310 362 static capi_ioctl_struct ioctl_data;
michael@310 363 +#endif
michael@310 364
michael@310 365 static int remote_capi;
michael@310 366 +#if 0
michael@310 367 static char *globalconfigfilename = "/etc/capi20.conf";
michael@310 368 static char *userconfigfilename = ".capi20rc";
michael@310 369 static unsigned short int port;
michael@310 370 static char hostname[1024];
michael@310 371 +#endif
michael@310 372 static int tracelevel;
michael@310 373 static char *tracefile;
michael@310 374
michael@310 375 @@ -77,17 +85,21 @@
michael@310 376 #define RCAPI_AUTH_USER_REQ CAPICMD(0xff, 0x00)
michael@310 377 #define RCAPI_AUTH_USER_CONF CAPICMD(0xff, 0x01)
michael@310 378
michael@310 379 +#if 0
michael@310 380 static char *skip_whitespace(char *s)
michael@310 381 {
michael@310 382 while (*s && isspace(*s)) s++;
michael@310 383 return s;
michael@310 384 }
michael@310 385 +#endif
michael@310 386
michael@310 387 +#if 0
michael@310 388 static char *skip_nonwhitespace(char *s)
michael@310 389 {
michael@310 390 while (*s && !isspace(*s)) s++;
michael@310 391 return s;
michael@310 392 }
michael@310 393 +#endif
michael@310 394
michael@310 395 static unsigned char get_byte(unsigned char **p)
michael@310 396 {
michael@310 397 @@ -95,10 +107,12 @@
michael@310 398 return((unsigned char)*(*p - 1));
michael@310 399 }
michael@310 400
michael@310 401 +#if 0
michael@310 402 static unsigned short get_word(unsigned char **p)
michael@310 403 {
michael@310 404 return(get_byte(p) | (get_byte(p) << 8));
michael@310 405 }
michael@310 406 +#endif
michael@310 407
michael@310 408 static unsigned short get_netword(unsigned char **p)
michael@310 409 {
michael@310 410 @@ -144,6 +158,7 @@
michael@310 411 * read config file
michael@310 412 */
michael@310 413
michael@310 414 +#if 0
michael@310 415 static int read_config(void)
michael@310 416 {
michael@310 417 FILE *fp = NULL;
michael@310 418 @@ -197,11 +212,13 @@
michael@310 419 fclose(fp);
michael@310 420 return(1);
michael@310 421 }
michael@310 422 +#endif
michael@310 423
michael@310 424 /*
michael@310 425 * socket function
michael@310 426 */
michael@310 427
michael@310 428 +#if 0
michael@310 429 static int open_socket(void)
michael@310 430 {
michael@310 431 int fd;
michael@310 432 @@ -225,6 +242,7 @@
michael@310 433 close(fd);
michael@310 434 return(-1);
michael@310 435 }
michael@310 436 +#endif
michael@310 437
michael@310 438 static int socket_read(int fd, unsigned char *buf, int l)
michael@310 439 {
michael@310 440 @@ -328,6 +346,8 @@
michael@310 441 if (likely(capi_fd >= 0))
michael@310 442 return CapiNoError;
michael@310 443
michael@310 444 +#if 0
michael@310 445 +
michael@310 446 /*----- open managment link -----*/
michael@310 447 if (read_config() && (remote_capi)) {
michael@310 448 capi_fd = open_socket();
michael@310 449 @@ -347,6 +367,8 @@
michael@310 450 if (ioctl(capi_fd, CAPI_INSTALLED, 0) == 0)
michael@310 451 return CapiNoError;
michael@310 452
michael@202 453 +#endif
michael@202 454 +
michael@310 455 return CapiRegNotInstalled;
michael@310 456 }
michael@310 457
michael@310 458 @@ -421,6 +443,7 @@
michael@310 459 unsigned char *bufferstart;
michael@310 460 };
michael@310 461
michael@310 462 +#if 0
michael@310 463 static struct applinfo *alloc_buffers(
michael@310 464 unsigned MaxB3Connection,
michael@310 465 unsigned MaxB3Blks,
michael@310 466 @@ -459,6 +482,7 @@
michael@310 467 ap->lastfree->next = 0;
michael@310 468 return ap;
michael@310 469 }
michael@202 470 +#endif
michael@310 471
michael@310 472 static void free_buffers(struct applinfo *ap)
michael@310 473 {
michael@310 474 @@ -576,14 +600,17 @@
michael@310 475 unsigned MaxSizeB3,
michael@310 476 unsigned *ApplID)
michael@310 477 {
michael@310 478 +#if 0
michael@310 479 int applid = 0;
michael@310 480 char buf[PATH_MAX];
michael@310 481 int i, fd = -1;
michael@310 482
michael@310 483 *ApplID = 0;
michael@310 484 +#endif
michael@310 485
michael@310 486 if (capi20_isinstalled() != CapiNoError)
michael@310 487 return CapiRegNotInstalled;
michael@310 488 +#if 0
michael@310 489 if ((!remote_capi) || ((remote_capi) && ((fd = open_socket()) < 0))) {
michael@310 490 if ((fd = open(capidevname, O_RDWR|O_NONBLOCK, 0666)) < 0 &&
michael@310 491 (errno == ENOENT)) {
michael@310 492 @@ -621,6 +648,8 @@
michael@310 493 close(fd);
michael@310 494 return(errcode);
michael@310 495 }
michael@310 496 + }
michael@310 497 +#if 0
michael@310 498 } else if ((applid = ioctl(fd, CAPI_REGISTER, &ioctl_data)) < 0) {
michael@310 499 if (errno == EIO) {
michael@310 500 if (ioctl(fd, CAPI_GET_ERRCODE, &ioctl_data) < 0) {
michael@310 501 @@ -666,6 +695,7 @@
michael@310 502 applid = alloc_applid(fd);
michael@310 503 } // end old driver compatibility
michael@310 504 }
michael@310 505 +#endif
michael@310 506 if (remember_applid(applid, fd) < 0) {
michael@310 507 close(fd);
michael@310 508 return CapiRegOSResourceErr;
michael@310 509 @@ -676,6 +706,7 @@
michael@310 510 return CapiRegOSResourceErr;
michael@310 511 }
michael@310 512 *ApplID = applid;
michael@310 513 +#endif
michael@310 514 return CapiNoError;
michael@310 515 }
michael@310 516
michael@310 517 @@ -784,11 +815,15 @@
michael@310 518 ret = CapiIllAppNr;
michael@310 519 break;
michael@310 520 case EIO:
michael@310 521 +#if 0
michael@310 522 if (ioctl(fd, CAPI_GET_ERRCODE, &ioctl_data) < 0) {
michael@310 523 +#endif
michael@310 524 ret = CapiMsgOSResourceErr;
michael@310 525 +#if 0
michael@310 526 } else {
michael@310 527 ret = (unsigned)ioctl_data.errcode;
michael@310 528 }
michael@310 529 +#endif
michael@310 530 break;
michael@310 531 default:
michael@310 532 ret = CapiMsgOSResourceErr;
michael@310 533 @@ -842,7 +877,7 @@
michael@310 534 rcvbuf[15] = (data >> 24) & 0xff;
michael@310 535 } else {
michael@310 536 u_int64_t data;
michael@310 537 - ulong radr = (ulong)rcvbuf;
michael@310 538 + unsigned long radr = (unsigned long)rcvbuf;
michael@310 539 if (CAPIMSG_LEN(rcvbuf) < 30) {
michael@310 540 /*
michael@310 541 * grr, 64bit arch, but no data64 included,
michael@310 542 @@ -899,6 +934,9 @@
michael@310 543 {
michael@310 544 if (capi20_isinstalled() != CapiNoError)
michael@310 545 return 0;
michael@310 546 +#ifndef CAPI_MANUFACTURER_LEN
michael@310 547 +#define CAPI_MANUFACTURER_LEN 64
michael@310 548 +#endif
michael@310 549
michael@310 550 if (remote_capi) {
michael@310 551 unsigned char buf[100];
michael@310 552 @@ -911,15 +949,19 @@
michael@310 553 return Buf;
michael@310 554 }
michael@310 555
michael@310 556 +#if 0
michael@310 557 ioctl_data.contr = Ctrl;
michael@310 558
michael@310 559 if (ioctl(capi_fd, CAPI_GET_MANUFACTURER, &ioctl_data) < 0)
michael@310 560 +#endif
michael@310 561 return 0;
michael@310 562
michael@310 563 +#if 0
michael@310 564 memcpy(Buf, ioctl_data.manufacturer, CAPI_MANUFACTURER_LEN);
michael@310 565 Buf[CAPI_MANUFACTURER_LEN-1] = 0;
michael@310 566
michael@310 567 return Buf;
michael@310 568 +#endif
michael@310 569 }
michael@310 570
michael@310 571 unsigned char *
michael@310 572 @@ -934,16 +976,20 @@
michael@310 573 set_rcapicmd_header(&p, 14, RCAPI_GET_VERSION_REQ, Ctrl);
michael@310 574 if(!(remote_command(capi_fd, buf, 14, RCAPI_GET_VERSION_CONF)))
michael@310 575 return 0;
michael@310 576 - memcpy(Buf, buf + 1, sizeof(capi_version));
michael@310 577 + memcpy(Buf, buf + 1, 128 /* sizeof(capi_version) */);
michael@310 578 return Buf;
michael@310 579 }
michael@310 580
michael@310 581 +#if 0
michael@310 582 ioctl_data.contr = Ctrl;
michael@310 583 if (ioctl(capi_fd, CAPI_GET_VERSION, &ioctl_data) < 0) {
michael@310 584 +#endif
michael@310 585 return 0;
michael@310 586 +#if 0
michael@310 587 }
michael@310 588 memcpy(Buf, &ioctl_data.version, sizeof(capi_version));
michael@310 589 return Buf;
michael@310 590 +#endif
michael@310 591 }
michael@310 592
michael@310 593 unsigned char *
michael@310 594 @@ -952,6 +998,10 @@
michael@310 595 if (capi20_isinstalled() != CapiNoError)
michael@310 596 return 0;
michael@310 597
michael@310 598 +#ifndef CAPI_SERIAL_LEN
michael@310 599 +#define CAPI_SERIAL_LEN 8
michael@202 600 +#endif
michael@202 601 +
michael@310 602 if (remote_capi) {
michael@310 603 unsigned char buf[100];
michael@310 604 unsigned char *p = buf;
michael@310 605 @@ -963,15 +1013,19 @@
michael@310 606 return Buf;
michael@310 607 }
michael@310 608
michael@310 609 +#if 0
michael@310 610 ioctl_data.contr = Ctrl;
michael@310 611
michael@310 612 if (ioctl(capi_fd, CAPI_GET_SERIAL, &ioctl_data) < 0)
michael@202 613 +#endif
michael@310 614 return 0;
michael@310 615
michael@202 616 +#if 0
michael@310 617 memcpy(Buf, &ioctl_data.serial, CAPI_SERIAL_LEN);
michael@310 618 Buf[CAPI_SERIAL_LEN-1] = 0;
michael@310 619
michael@310 620 return Buf;
michael@202 621 +#endif
michael@202 622 }
michael@202 623
michael@310 624 unsigned
michael@310 625 @@ -993,7 +1047,7 @@
michael@310 626 unsigned short* tmp = (unsigned short*)buf;
michael@202 627
michael@310 628 if(*tmp == CapiNoError) {
michael@310 629 - memcpy(Buf, buf + 2, (Ctrl) ? sizeof(struct capi_profile) : 2);
michael@310 630 + memcpy(Buf, buf + 2, (Ctrl) ? 224 /* sizeof(struct capi_profile) */ : 2);
michael@310 631 }
michael@202 632
michael@310 633 fret = *tmp;
michael@310 634 @@ -1002,6 +1056,9 @@
michael@310 635 return (fret);
michael@202 636 }
michael@202 637
michael@310 638 +#if 1
michael@310 639 + return CapiMsgOSResourceErr;
michael@310 640 +#else
michael@310 641 ioctl_data.contr = Ctrl;
michael@202 642
michael@310 643 if (ioctl(capi_fd, CAPI_GET_PROFILE, &ioctl_data) < 0) {
michael@310 644 @@ -1018,6 +1075,7 @@
michael@310 645 sizeof(ioctl_data.profile.ncontroller));
michael@202 646 }
michael@310 647 return CapiNoError;
michael@310 648 +#endif
michael@310 649 }
michael@310 650 /*
michael@310 651 * functions added to the CAPI2.0 spec
michael@310 652 Index: chan_capi-1.1.5/libcapi20/convert.c
michael@310 653 --- chan_capi-1.1.5/libcapi20/convert.c.orig 2009-07-23 16:11:08.000000000 +0200
michael@310 654 +++ chan_capi-1.1.5/libcapi20/convert.c 2010-07-24 11:12:31.000000000 +0200
michael@310 655 @@ -11,7 +11,14 @@
michael@310 656 #include <stddef.h>
michael@310 657 #include <time.h>
michael@310 658 #include <ctype.h>
michael@310 659 +#ifdef __FreeBSD__
michael@310 660 +#include <sys/endian.h>
michael@310 661 +#define bswap_16 bswap16
michael@310 662 +#define bswap_32 bswap32
michael@310 663 +#define bswap_64 bswap64
michael@310 664 +#else
michael@310 665 #include <byteswap.h>
michael@310 666 +#endif
michael@310 667
michael@310 668 #include "capi20.h"
michael@310 669
michael@310 670 Index: channels/console_video.h
michael@310 671 --- channels/console_video.h.orig 2008-06-30 17:45:15.000000000 +0200
michael@310 672 +++ channels/console_video.h 2010-07-24 11:12:31.000000000 +0200
michael@310 673 @@ -28,10 +28,7 @@
michael@310 674 "console {device}"
michael@310 675 #else
michael@310 676
michael@310 677 -#include <ffmpeg/avcodec.h>
michael@310 678 -#ifndef OLD_FFMPEG
michael@310 679 -#include <ffmpeg/swscale.h> /* requires a recent ffmpeg */
michael@310 680 -#endif
michael@310 681 +#include <libavcoded/avcodec.h>
michael@310 682
michael@310 683 #define CONSOLE_VIDEO_CMDS \
michael@310 684 "console {videodevice|videocodec" \
michael@310 685 Index: configure
michael@310 686 --- configure.orig 2010-06-24 01:40:16.000000000 +0200
michael@310 687 +++ configure 2010-07-24 11:14:22.000000000 +0200
michael@310 688 @@ -4530,11 +4530,6 @@
michael@310 689 # note- does not work on FreeBSD
michael@310 690
michael@310 691 case "${host_os}" in
michael@310 692 - freebsd*)
michael@310 693 -
michael@310 694 - CPPFLAGS=-I/usr/local/include
michael@310 695 - LDFLAGS=-L/usr/local/lib
michael@310 696 - ;;
michael@310 697 openbsd*)
michael@310 698
michael@310 699 if test ${prefix} = '/usr/local' || test ${prefix} = 'NONE'; then
michael@310 700 Index: main/Makefile
michael@310 701 --- main/Makefile.orig 2010-06-25 20:58:37.000000000 +0200
michael@310 702 +++ main/Makefile 2010-07-24 11:12:31.000000000 +0200
michael@310 703 @@ -78,10 +78,7 @@
michael@310 704 endif
michael@310 705
michael@310 706 ifeq ($(OSARCH),FreeBSD)
michael@310 707 - # -V is understood by BSD Make, not by GNU make.
michael@310 708 - BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
michael@310 709 - AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
michael@310 710 - AST_LIBS+=-lcrypto
michael@310 711 + AST_LIBS+=-lpthread -lcrypto
michael@310 712 endif
michael@310 713
michael@310 714 ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
michael@310 715 Index: main/file.c
michael@310 716 --- main/file.c.orig 2010-03-25 17:26:13.000000000 +0100
michael@310 717 +++ main/file.c 2010-07-24 11:12:31.000000000 +0200
michael@310 718 @@ -254,7 +254,7 @@
michael@310 719 char *fn = NULL;
michael@310 720
michael@310 721 if (!strcmp(ext, "wav49"))
michael@310 722 - ext = "WAV";
michael@310 723 + ext = "wav";
michael@310 724
michael@310 725 if (filename[0] == '/') {
michael@310 726 if (asprintf(&fn, "%s.%s", filename, ext) < 0) {
michael@310 727 Index: main/tcptls.c
michael@310 728 --- main/tcptls.c.orig 2010-03-20 18:33:03.000000000 +0100
michael@310 729 +++ main/tcptls.c 2010-07-24 11:12:31.000000000 +0200
michael@310 730 @@ -325,6 +325,7 @@
michael@310 731 if (!ast_strlen_zero(cfg->cafile) || !ast_strlen_zero(cfg->capath)) {
michael@310 732 if (SSL_CTX_load_verify_locations(cfg->ssl_ctx, S_OR(cfg->cafile, NULL), S_OR(cfg->capath,NULL)) == 0)
michael@310 733 ast_verb(0, "SSL CA file(%s)/path(%s) error\n", cfg->cafile, cfg->capath);
michael@310 734 + SSL_CTX_set_client_CA_list(cfg->ssl_ctx, S_OR(cfg->cafile, NULL));
michael@202 735 }
michael@202 736
michael@310 737 ast_verb(0, "SSL certificate ok\n");
michael@310 738 Index: menuselect-tree
michael@310 739 --- menuselect-tree.orig 2010-07-22 21:20:17.000000000 +0200
michael@310 740 +++ menuselect-tree 2010-07-24 11:12:31.000000000 +0200
michael@310 741 @@ -153,6 +153,8 @@
michael@310 742 </member>
michael@310 743 <member name="app_system" displayname="Generic System() application" remove_on_change="apps/app_system.o apps/app_system.so">
michael@310 744 </member>
michael@310 745 +<member name="app_backticks" displayname="Generic Backticks() application" remove_on_change="apps/app_backticks.o apps/app_backticks.so">
michael@310 746 +</member>
michael@310 747 <member name="app_talkdetect" displayname="Playback with Talk Detection" remove_on_change="apps/app_talkdetect.o apps/app_talkdetect.so">
michael@310 748 </member>
michael@310 749 <member name="app_test" displayname="Interface Test Application" remove_on_change="apps/app_test.o apps/app_test.so">
michael@310 750 @@ -693,9 +695,9 @@
michael@310 751 <member name="CORE-SOUNDS-EN-ULAW" displayname="English, mu-Law format">
michael@310 752 </member>
michael@310 753 <member name="CORE-SOUNDS-EN-ALAW" displayname="English, a-Law format">
michael@310 754 + <defaultenabled>yes</defaultenabled>
michael@310 755 </member>
michael@310 756 <member name="CORE-SOUNDS-EN-GSM" displayname="English, GSM format" >
michael@310 757 - <defaultenabled>yes</defaultenabled>
michael@310 758 </member>
michael@310 759 <member name="CORE-SOUNDS-EN-G729" displayname="English, G.729 format">
michael@310 760 </member>
michael@310 761 @@ -771,6 +773,7 @@
michael@310 762 <member name="EXTRA-SOUNDS-EN-ULAW" displayname="English, mu-Law format">
michael@310 763 </member>
michael@310 764 <member name="EXTRA-SOUNDS-EN-ALAW" displayname="English, a-Law format">
michael@310 765 + <defaultenabled>yes</defaultenabled>
michael@310 766 </member>
michael@310 767 <member name="EXTRA-SOUNDS-EN-GSM" displayname="English, GSM format" >
michael@310 768 </member>
michael@310 769 Index: res/res_http_post.c
michael@310 770 --- res/res_http_post.c.orig 2009-10-27 18:12:09.000000000 +0100
michael@310 771 +++ res/res_http_post.c 2010-07-24 11:12:31.000000000 +0200
michael@310 772 @@ -122,14 +122,8 @@
michael@310 773 ast_log(LOG_WARNING, "Got unexpected GMIME_IS_MESSAGE_PARTIAL\n");
michael@310 774 return;
michael@310 775 } else if (GMIME_IS_MULTIPART(part)) {
michael@310 776 - GList *l;
michael@310 777 -
michael@310 778 - ast_log(LOG_WARNING, "Got unexpected GMIME_IS_MULTIPART, trying to process subparts\n");
michael@310 779 - l = GMIME_MULTIPART(part)->subparts;
michael@310 780 - while (l) {
michael@310 781 - process_message_callback(l->data, cbinfo);
michael@310 782 - l = l->next;
michael@310 783 - }
michael@310 784 + ast_log(LOG_WARNING, "Got unexpected GMIME_IS_MULTIPART, trying to process subparts\n");
michael@310 785 + g_mime_multipart_foreach(GMIME_MULTIPART(part), process_message_callback, cbinfo);
michael@310 786 } else if (GMIME_IS_PART(part)) {
michael@310 787 const char *filename;
michael@310 788
michael@310 789 Index: sounds/sounds.xml
michael@310 790 --- sounds/sounds.xml.orig 2009-08-18 22:31:40.000000000 +0200
michael@310 791 +++ sounds/sounds.xml 2010-07-24 11:12:31.000000000 +0200
michael@310 792 @@ -4,9 +4,9 @@
michael@310 793 <member name="CORE-SOUNDS-EN-ULAW" displayname="English, mu-Law format">
michael@310 794 </member>
michael@310 795 <member name="CORE-SOUNDS-EN-ALAW" displayname="English, a-Law format">
michael@310 796 + <defaultenabled>yes</defaultenabled>
michael@310 797 </member>
michael@310 798 <member name="CORE-SOUNDS-EN-GSM" displayname="English, GSM format" >
michael@310 799 - <defaultenabled>yes</defaultenabled>
michael@310 800 </member>
michael@310 801 <member name="CORE-SOUNDS-EN-G729" displayname="English, G.729 format">
michael@310 802 </member>
michael@310 803 @@ -82,6 +82,7 @@
michael@310 804 <member name="EXTRA-SOUNDS-EN-ULAW" displayname="English, mu-Law format">
michael@310 805 </member>
michael@310 806 <member name="EXTRA-SOUNDS-EN-ALAW" displayname="English, a-Law format">
michael@310 807 + <defaultenabled>yes</defaultenabled>
michael@310 808 </member>
michael@310 809 <member name="EXTRA-SOUNDS-EN-GSM" displayname="English, GSM format" >
michael@310 810 </member>

mercurial