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.

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

mercurial