michael@311: Index: addons/chan_ooh323.c michael@311: diff -Nau addons/chan_ooh323.c.orig addons/chan_ooh323.c michael@362: --- addons/chan_ooh323.c.orig 2011-08-09 18:13:09.000000000 +0200 michael@362: +++ addons/chan_ooh323.c 2011-09-14 14:29:50.740457577 +0200 michael@362: @@ -24,6 +24,12 @@ michael@202: michael@311: #include "chan_ooh323.h" michael@311: #include michael@311: +#if defined __SVR4 && defined __sun michael@311: +#include michael@311: +#ifndef IPTOS_MINCOST michael@311: +#define IPTOS_MINCOST 0x02 michael@311: +#endif michael@311: +#endif michael@202: michael@311: #define FORMAT_STRING_SIZE 512 michael@202: michael@311: Index: addons/ooh323c/src/ooCmdChannel.c michael@311: diff -Nau addons/ooh323c/src/ooCmdChannel.c.orig addons/ooh323c/src/ooCmdChannel.c michael@362: --- addons/ooh323c/src/ooCmdChannel.c.orig 2011-08-04 21:37:16.000000000 +0200 michael@362: +++ addons/ooh323c/src/ooCmdChannel.c 2011-09-14 14:29:50.740457577 +0200 michael@311: @@ -25,6 +25,10 @@ michael@311: #include "ooCalls.h" michael@311: #include "ooCmdChannel.h" michael@311: michael@311: +#ifndef AF_LOCAL michael@311: +#define AF_LOCAL AF_UNIX michael@311: +#define PF_LOCAL PF_UNIX michael@311: +#endif michael@311: michael@311: /** Global endpoint structure */ michael@311: extern OOH323EndPoint gH323ep; michael@311: Index: addons/ooh323c/src/ooSocket.c michael@311: diff -Nau addons/ooh323c/src/ooSocket.c.orig addons/ooh323c/src/ooSocket.c michael@362: --- addons/ooh323c/src/ooSocket.c.orig 2011-05-04 22:50:18.000000000 +0200 michael@362: +++ addons/ooh323c/src/ooSocket.c 2011-09-14 14:29:50.740457577 +0200 michael@311: @@ -24,6 +24,9 @@ michael@311: michael@311: #include "ooSocket.h" michael@311: #include "ootrace.h" michael@311: +#if defined __SVR4 && defined __sun michael@311: +#include michael@311: +#endif michael@311: #if defined(_WIN32_WCE) michael@311: static int inited = 0; michael@311: #define SEND_FLAGS 0 michael@311: Index: addons/ooh323cDriver.c michael@311: diff -Nau addons/ooh323cDriver.c.orig addons/ooh323cDriver.c michael@347: --- addons/ooh323cDriver.c.orig 2011-02-18 01:07:20.000000000 +0100 michael@362: +++ addons/ooh323cDriver.c 2011-09-14 14:29:50.740457577 +0200 michael@311: @@ -27,6 +27,11 @@ michael@311: michael@311: #define SEC_TO_HOLD_THREAD 24 michael@311: michael@311: +#ifndef AF_LOCAL michael@311: +#define AF_LOCAL AF_UNIX michael@311: +#define PF_LOCAL PF_UNIX michael@311: +#endif michael@311: + michael@311: extern struct ast_module *myself; michael@311: extern OOBOOL gH323Debug; michael@311: extern OOH323EndPoint gH323ep; michael@310: Index: apps/app_backticks.c michael@311: diff -Nau apps/app_backticks.c.orig apps/app_backticks.c michael@311: --- apps/app_backticks.c.orig 1970-01-01 01:00:00.000000000 +0100 michael@362: +++ apps/app_backticks.c 2011-09-14 14:29:50.740457577 +0200 michael@310: @@ -0,0 +1,129 @@ michael@202: + michael@202: +#include "asterisk.h" michael@202: + michael@311: +ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.52 $") michael@202: + michael@310: +#include michael@310: +#include michael@310: +#include michael@310: +#include michael@310: +#include michael@310: +#include michael@310: +#include michael@310: +#include michael@310: +#include michael@310: +#include michael@310: +#include michael@202: + michael@310: +static char *app = "BackTicks"; michael@310: +static char *synopsis = "Execute a shell command and save the result as a variable."; michael@310: +static char *desc = " Backticks(|)\n\n" michael@310: + "Be sure to include a full path to the command!\n"; michael@202: + michael@310: +static char *do_backticks(char *command, char *buf, size_t len) michael@310: +{ michael@310: + int fds[2], pid = 0; michael@310: + char *ret = NULL; michael@202: + michael@310: + memset(buf, 0, len); michael@310: + if (pipe(fds)) { michael@310: + ast_log(LOG_WARNING, "Pipe/Exec failed\n"); michael@310: + } else { michael@310: + pid = fork(); michael@310: + if (pid < 0) { michael@310: + ast_log(LOG_WARNING, "Fork failed\n"); michael@310: + close(fds[0]); michael@310: + close(fds[1]); michael@310: + } else if (pid) { michael@310: + /* parent */ michael@310: + close(fds[1]); michael@310: + read(fds[0], buf, len); michael@310: + close(fds[0]); michael@310: + ret = buf; michael@310: + } else { michael@310: + /* child */ michael@310: + char *argv[255] = {0}; michael@310: + int argc = 0; michael@310: + char *p; michael@310: + char *mycmd = ast_strdupa(command); michael@310: + close(fds[0]); michael@310: + dup2(fds[1], STDOUT_FILENO); michael@310: + argv[argc++] = mycmd; michael@310: + do { michael@310: + if ((p = strchr(mycmd, ' '))) { michael@310: + *p = '\0'; michael@310: + mycmd = ++p; michael@310: + argv[argc++] = mycmd; michael@310: + } michael@310: + } while (p != NULL); michael@310: + close(fds[1]); michael@310: + execv(argv[0], argv); michael@310: + ast_log(LOG_ERROR, "exec of %s failed\n", argv[0]); michael@310: + exit(0); michael@310: + } michael@310: + } michael@310: + return ret; michael@202: +} michael@202: + michael@310: +static int backticks_exec(struct ast_channel *chan, void *data) michael@202: +{ michael@310: + int res = 0; michael@310: + const char *usage = "Usage: Backticks(|)"; michael@310: + char buf[1024], *argv[2], *mydata; michael@310: + int argc = 0; michael@310: + michael@310: + if (!data) { michael@310: + ast_log(LOG_WARNING, "%s\n", usage); michael@310: + return -1; michael@310: + } michael@310: + ast_autoservice_start(chan); michael@310: + if (!(mydata = ast_strdupa(data))) { michael@310: + ast_log(LOG_ERROR, "Memory Error!\n"); michael@310: + res = -1; michael@310: + } else { michael@310: + if((argc = ast_app_separate_args(mydata, '|', argv, sizeof(argv) / sizeof(argv[0]))) < 2) { michael@310: + ast_log(LOG_WARNING, "%s\n", usage); michael@310: + res = -1; michael@310: + } michael@310: + if (do_backticks(argv[1], buf, sizeof(buf))) michael@310: + pbx_builtin_setvar_helper(chan, argv[0], buf); michael@310: + else { michael@310: + ast_log(LOG_WARNING, "No Data!\n"); michael@310: + res = -1; michael@310: + } michael@310: + } michael@310: + ast_autoservice_stop(chan); michael@310: + return res; michael@202: +} michael@202: + michael@310: +static int function_backticks(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) michael@202: +{ michael@310: + if (!do_backticks(data, buf, len)) { michael@310: + ast_log(LOG_WARNING, "No Data!\n"); michael@310: + return -1; michael@310: + } michael@310: + return 0; michael@202: +} michael@202: + michael@310: +static struct ast_custom_function backticks_function = { michael@310: + .name = "BACKTICKS", michael@310: + .desc = "Executes a shell command and evaluates to the result.", michael@310: + .syntax = "BACKTICKS()", michael@310: + .synopsis = "Executes a shell command.", michael@310: + .read = function_backticks michael@202: +}; michael@202: + michael@202: +static int unload_module(void) michael@202: +{ michael@310: + ast_custom_function_unregister(&backticks_function); michael@310: + return ast_unregister_application(app); michael@202: +} michael@202: + michael@202: +static int load_module(void) michael@202: +{ michael@310: + ast_custom_function_register(&backticks_function); michael@310: + return ast_register_application(app, backticks_exec, synopsis, desc); michael@202: +} michael@202: + michael@310: +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "BACKTICKS() dialplan function"); michael@202: + michael@310: Index: apps/app_meetme.c michael@311: diff -Nau apps/app_meetme.c.orig apps/app_meetme.c michael@362: --- apps/app_meetme.c.orig 2011-07-19 17:43:32.000000000 +0200 michael@362: +++ apps/app_meetme.c 2011-09-14 14:29:50.747960016 +0200 michael@362: @@ -606,6 +606,7 @@ michael@310: CONFFLAG_DURATION_LIMIT = (1 << 30), michael@310: /*! Do not write any audio to this channel until the state is up. */ michael@310: CONFFLAG_NO_AUDIO_UNTIL_UP = (1 << 31), michael@311: + CONFFLAG_USERNAME = (1 << 32), michael@310: }; michael@310: michael@311: /* !If set play an intro announcement at start of conference */ michael@362: @@ -619,6 +620,7 @@ michael@310: OPT_ARG_MOH_CLASS = 4, michael@311: OPT_ARG_INTROMSG = 5, michael@311: OPT_ARG_ARRAY_SIZE = 6, michael@311: + OPT_ARG_USERNAME = 7, michael@310: }; michael@310: michael@310: AST_APP_OPTIONS(meetme_opts, BEGIN_OPTIONS michael@362: @@ -652,6 +654,7 @@ michael@310: AST_APP_OPTION('1', CONFFLAG_NOONLYPERSON ), michael@310: AST_APP_OPTION_ARG('S', CONFFLAG_DURATION_STOP, OPT_ARG_DURATION_STOP), michael@310: AST_APP_OPTION_ARG('L', CONFFLAG_DURATION_LIMIT, OPT_ARG_DURATION_LIMIT), michael@310: + AST_APP_OPTION_ARG('n', CONFFLAG_USERNAME, OPT_ARG_USERNAME), michael@310: END_OPTIONS ); michael@310: michael@311: static const char * const app = "MeetMe"; michael@362: @@ -2447,6 +2450,12 @@ michael@311: ast_test_flag64(confflags, CONFFLAG_INTROUSERNOREVIEW))) { michael@310: char destdir[PATH_MAX]; michael@310: michael@311: + if (!ast_test_flag64(confflags, CONFFLAG_USERNAME) michael@310: + && !ast_strlen_zero(optargs[OPT_ARG_USERNAME]) michael@310: + && ast_fileexists(optargs[OPT_ARG_USERNAME], NULL, NULL)) michael@310: + snprintf(destdir, sizeof(destdir), "%s", optargs[OPT_ARG_USERNAME]); michael@310: + else { michael@202: + michael@310: snprintf(destdir, sizeof(destdir), "%s/meetme", ast_config_AST_SPOOL_DIR); michael@310: michael@310: if (ast_mkdir(destdir, 0777) != 0) { michael@362: @@ -2463,6 +2472,7 @@ michael@310: res = ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL); michael@310: if (res == -1) michael@310: goto outrun; michael@310: + } michael@310: } michael@310: michael@310: ast_mutex_lock(&conf->playlock); michael@311: Index: apps/app_voicemail.c michael@311: diff -Nau apps/app_voicemail.c.orig apps/app_voicemail.c michael@362: --- apps/app_voicemail.c.orig 2011-07-26 16:04:55.000000000 +0200 michael@362: +++ apps/app_voicemail.c 2011-09-14 14:29:50.747960016 +0200 michael@362: @@ -373,6 +373,7 @@ michael@311: static char imapport[8]; michael@311: static char imapflags[128]; michael@311: static char imapfolder[64]; michael@311: +static int imapsubfold = 0; michael@311: static char imapparentfolder[64] = "\0"; michael@311: static char greetingfolder[64]; michael@311: static char authuser[32]; michael@362: @@ -2504,7 +2505,7 @@ michael@310: } michael@310: michael@311: /* Build up server information */ michael@311: - ast_build_string(&t, &left, "{%s:%s/imap", imapserver, imapport); michael@311: + ast_build_string(&t, &left, "{%s:%s", imapserver, imapport); michael@310: michael@311: /* Add authentication user if present */ michael@311: if (!ast_strlen_zero(authuser)) michael@362: @@ -6161,6 +6162,7 @@ michael@311: /* simple. huh? */ michael@311: char sequence[10]; michael@311: char mailbox[256]; michael@311: + char folder[256]; michael@311: int res; michael@311: michael@311: /* get the real IMAP message number for this message */ michael@362: @@ -6176,10 +6178,24 @@ michael@311: mail_setflag(vms->mailstream, sequence, "\\Unseen"); michael@311: mail_clearflag(vms->mailstream, sequence, "\\Seen"); michael@311: } michael@311: - if (!strcasecmp(mbox(vmu, NEW_FOLDER), vms->curbox) && (box == NEW_FOLDER || box == OLD_FOLDER)) { michael@311: - ast_mutex_unlock(&vms->lock); michael@311: + michael@311: + if ((!strcasecmp(mbox(vmu, NEW_FOLDER), vms->curbox) || \ michael@311: + !strcasecmp(mbox(vmu, OLD_FOLDER), vms->curbox)) && \ michael@311: + (box == NEW_FOLDER || box == OLD_FOLDER)) { /* Don't copy data, */ michael@311: + ast_mutex_unlock(&vms->lock); /* just change Seen flag */ michael@311: return 0; michael@311: + } else if (box != NEW_FOLDER && box != OLD_FOLDER) { /* Do copy data */ michael@311: + if (imapsubfold == 1) /* using INBOX or subfolder */ michael@311: + snprintf(folder, sizeof(folder), "%s%c%s", imapfolder, delimiter, mbox(vmu, box)); michael@311: + else michael@311: + strncpy(folder, mbox(vmu, box), sizeof(folder)); michael@311: + int res = !mail_copy(vms->mailstream,sequence,folder); michael@311: + ast_mutex_unlock(&vms->lock); michael@311: + return res; michael@311: + } else { /* Copy data to INBOX delegating new/old status to Seen flag */ michael@311: + int res = !mail_copy(vms->mailstream,sequence,imapfolder); michael@311: } michael@311: + michael@311: /* Create the folder if it don't exist */ michael@311: imap_mailbox_name(mailbox, sizeof(mailbox), vms, box, 1); /* Get the full mailbox name */ michael@311: ast_debug(5, "Checking if folder exists: %s\n", mailbox); michael@362: @@ -10383,6 +10399,10 @@ michael@311: #ifndef IMAP_STORAGE michael@311: } else if (!cmd) { michael@311: vms.deleted[vms.curmsg] = 1; michael@311: +#else michael@311: + } else if (!cmd && (folder_int(vms.curbox) > 1 || box > 1)) { michael@311: + vms.deleted[vms.curmsg] = 1; /* Enforce deletion after */ michael@311: + deleted = 1; /* successful copy op */ michael@311: #endif michael@311: } else { michael@311: vms.deleted[vms.curmsg] = 0; michael@362: @@ -11874,6 +11894,15 @@ michael@311: } else { michael@311: ast_copy_string(imapfolder, "INBOX", sizeof(imapfolder)); michael@311: } michael@311: + /* IMAP saved (sub)folder location policy */ michael@311: + if ((val = ast_variable_retrieve(cfg, "general", "imapsubfold"))) { michael@311: + if (ast_false(val)) michael@311: + imapsubfold = 0; michael@311: + else michael@311: + imapsubfold = 1; michael@311: + } else { michael@311: + imapsubfold = 0; michael@311: + } michael@311: if ((val = ast_variable_retrieve(cfg, "general", "imapparentfolder"))) { michael@311: ast_copy_string(imapparentfolder, val, sizeof(imapparentfolder)); michael@311: } michael@362: Index: cdr/cdr_radius.c michael@362: diff -Nau cdr/cdr_radius.c.orig cdr/cdr_radius.c michael@362: --- cdr/cdr_radius.c.orig 2011-07-14 22:13:06.000000000 +0200 michael@362: +++ cdr/cdr_radius.c 2011-09-14 14:29:50.777958246 +0200 michael@362: @@ -106,10 +106,18 @@ michael@362: if (!rc_avpair_add(rh, tosend, PW_AST_SRC, &cdr->src, strlen(cdr->src), VENDOR_CODE)) michael@362: return -1; michael@362: michael@362: + /* RADIUS standard identifier patch */ michael@362: + if (!rc_avpair_add(rh, tosend, PW_CALLING_STATION_ID, &cdr->src, strlen(cdr->src), 0)) michael@362: + return -1; michael@362: + michael@362: /* Destination */ michael@362: if (!rc_avpair_add(rh, tosend, PW_AST_DST, &cdr->dst, strlen(cdr->dst), VENDOR_CODE)) michael@362: return -1; michael@362: michael@362: + /* RADIUS standard identifier patch */ michael@362: + if (!rc_avpair_add(rh, tosend, PW_CALLED_STATION_ID, &cdr->dst, strlen(cdr->dst), 0)) michael@362: + return -1; michael@362: + michael@362: /* Destination context */ michael@362: if (!rc_avpair_add(rh, tosend, PW_AST_DST_CTX, &cdr->dcontext, strlen(cdr->dcontext), VENDOR_CODE)) michael@362: return -1; michael@362: @@ -164,6 +172,10 @@ michael@362: if (!rc_avpair_add(rh, tosend, PW_AST_BILL_SEC, &cdr->billsec, 0, VENDOR_CODE)) michael@362: return -1; michael@362: michael@362: + /* RADIUS standard identifier patch */ michael@362: + if (!rc_avpair_add(rh, tosend, PW_ACCT_SESSION_TIME, &cdr->billsec, 0, 0)) michael@362: + return -1; michael@362: + michael@362: /* Disposition */ michael@362: tmp = ast_cdr_disp2str(cdr->disposition); michael@362: if (!rc_avpair_add(rh, tosend, PW_AST_DISPOSITION, tmp, strlen(tmp), VENDOR_CODE)) michael@362: @@ -187,10 +199,14 @@ michael@362: } michael@362: michael@362: /* Setting Acct-Session-Id & User-Name attributes for proper generation michael@362: - of Acct-Unique-Session-Id on server side */ michael@362: - /* Channel */ michael@362: - if (!rc_avpair_add(rh, tosend, PW_USER_NAME, &cdr->channel, strlen(cdr->channel), 0)) michael@362: - return -1; michael@362: + of Acct-Unique-Session-Id on server side Channel */ michael@362: + { michael@362: + char szChanuser[PATH_MAX] = {0}; michael@362: + strncpy(szChanuser, &cdr->channel, PATH_MAX-1); michael@362: + *(strrchr(szChanuser, '-')) = 0; michael@362: + if (!rc_avpair_add(rh, tosend, PW_USER_NAME, szChanuser, strlen(cdr->channel), 0)) michael@362: + return -1; michael@362: + } michael@362: michael@362: /* Unique ID */ michael@362: if (!rc_avpair_add(rh, tosend, PW_ACCT_SESSION_ID, &cdr->uniqueid, strlen(cdr->uniqueid), 0)) michael@362: Index: chan_capi-1.1.5.20110914/chan_capi20.h michael@362: diff -Nau chan_capi-1.1.5.20110914/chan_capi20.h.orig chan_capi-1.1.5.20110914/chan_capi20.h michael@362: --- chan_capi-1.1.5.20110914/chan_capi20.h.orig 2011-01-07 02:29:32.000000000 +0100 michael@362: +++ chan_capi-1.1.5.20110914/chan_capi20.h 2011-05-23 17:35:28.348531751 +0200 michael@311: @@ -4,10 +4,13 @@ michael@311: * first. Else the checks below will fail. michael@311: */ michael@311: michael@311: +#include michael@311: #include michael@310: michael@310: #undef CAPI_OS_HINT michael@310: michael@310: +#ifndef USE_OWN_LIBCAPI michael@310: + michael@310: #if (defined(__FreeBSD__) || defined(__OpenBSD__) || \ michael@310: defined(__NetBSD__) || defined(__APPLE__)) michael@310: michael@311: @@ -29,6 +32,8 @@ michael@310: #include michael@310: #endif /* BSD */ michael@310: michael@202: +#endif michael@202: + michael@310: #ifndef HEADER_CID michael@310: #define HEADER_CID(x) ((x)->adr.adrNCCI) michael@310: #endif michael@362: Index: chan_capi-1.1.5.20110914/chan_capi_utils.c michael@362: diff -Nau chan_capi-1.1.5.20110914/chan_capi_utils.c.orig chan_capi-1.1.5.20110914/chan_capi_utils.c michael@362: --- chan_capi-1.1.5.20110914/chan_capi_utils.c.orig 2011-01-07 02:29:32.000000000 +0100 michael@362: +++ chan_capi-1.1.5.20110914/chan_capi_utils.c 2011-05-23 17:35:28.348531751 +0200 michael@362: @@ -1158,6 +1158,9 @@ michael@310: { michael@310: MESSAGE_EXCHANGE_ERROR error; michael@310: int waitcount = 50; michael@310: +#ifndef CAPI_MANUFACTURER_LEN michael@310: +#define CAPI_MANUFACTURER_LEN 64 michael@310: +#endif michael@310: unsigned char manbuf[CAPI_MANUFACTURER_LEN]; michael@310: _cmsg CMSG; michael@310: michael@362: Index: chan_capi-1.1.5.20110914/libcapi20/capi20.c michael@362: diff -Nau chan_capi-1.1.5.20110914/libcapi20/capi20.c.orig chan_capi-1.1.5.20110914/libcapi20/capi20.c michael@362: --- chan_capi-1.1.5.20110914/libcapi20/capi20.c.orig 2011-01-07 02:29:31.000000000 +0100 michael@362: +++ chan_capi-1.1.5.20110914/libcapi20/capi20.c 2011-05-23 17:35:28.348531751 +0200 michael@310: @@ -19,8 +19,10 @@ michael@310: #include michael@310: #include michael@310: #include michael@310: +#ifdef __linux__ michael@310: #define _LINUX_LIST_H michael@310: #include michael@310: +#endif michael@310: michael@310: #include michael@310: #include michael@310: @@ -48,17 +50,23 @@ michael@310: michael@310: #define SEND_BUFSIZ (128+2048) michael@310: michael@202: +#if 0 michael@310: static char capidevname[] = "/dev/capi20"; michael@310: static char capidevnamenew[] = "/dev/isdn/capi20"; michael@310: +#endif michael@310: michael@310: static int capi_fd = -1; michael@310: +#if 0 michael@310: static capi_ioctl_struct ioctl_data; michael@310: +#endif michael@310: michael@310: static int remote_capi; michael@310: +#if 0 michael@310: static char *globalconfigfilename = "/etc/capi20.conf"; michael@310: static char *userconfigfilename = ".capi20rc"; michael@310: static unsigned short int port; michael@310: static char hostname[1024]; michael@310: +#endif michael@310: static int tracelevel; michael@310: static char *tracefile; michael@310: michael@310: @@ -77,17 +85,21 @@ michael@310: #define RCAPI_AUTH_USER_REQ CAPICMD(0xff, 0x00) michael@310: #define RCAPI_AUTH_USER_CONF CAPICMD(0xff, 0x01) michael@310: michael@310: +#if 0 michael@310: static char *skip_whitespace(char *s) michael@310: { michael@310: while (*s && isspace(*s)) s++; michael@310: return s; michael@310: } michael@310: +#endif michael@310: michael@310: +#if 0 michael@310: static char *skip_nonwhitespace(char *s) michael@310: { michael@310: while (*s && !isspace(*s)) s++; michael@310: return s; michael@310: } michael@310: +#endif michael@310: michael@310: static unsigned char get_byte(unsigned char **p) michael@310: { michael@310: @@ -95,10 +107,12 @@ michael@310: return((unsigned char)*(*p - 1)); michael@310: } michael@310: michael@310: +#if 0 michael@310: static unsigned short get_word(unsigned char **p) michael@310: { michael@310: return(get_byte(p) | (get_byte(p) << 8)); michael@310: } michael@310: +#endif michael@310: michael@310: static unsigned short get_netword(unsigned char **p) michael@310: { michael@310: @@ -144,6 +158,7 @@ michael@310: * read config file michael@310: */ michael@310: michael@310: +#if 0 michael@310: static int read_config(void) michael@310: { michael@310: FILE *fp = NULL; michael@310: @@ -197,11 +212,13 @@ michael@310: fclose(fp); michael@310: return(1); michael@310: } michael@310: +#endif michael@310: michael@310: /* michael@310: * socket function michael@310: */ michael@310: michael@310: +#if 0 michael@310: static int open_socket(void) michael@310: { michael@310: int fd; michael@310: @@ -225,6 +242,7 @@ michael@310: close(fd); michael@310: return(-1); michael@310: } michael@310: +#endif michael@310: michael@310: static int socket_read(int fd, unsigned char *buf, int l) michael@310: { michael@310: @@ -328,6 +346,8 @@ michael@310: if (likely(capi_fd >= 0)) michael@310: return CapiNoError; michael@310: michael@310: +#if 0 michael@310: + michael@310: /*----- open managment link -----*/ michael@310: if (read_config() && (remote_capi)) { michael@310: capi_fd = open_socket(); michael@310: @@ -347,6 +367,8 @@ michael@310: if (ioctl(capi_fd, CAPI_INSTALLED, 0) == 0) michael@310: return CapiNoError; michael@310: michael@202: +#endif michael@202: + michael@310: return CapiRegNotInstalled; michael@310: } michael@310: michael@310: @@ -421,6 +443,7 @@ michael@310: unsigned char *bufferstart; michael@310: }; michael@310: michael@310: +#if 0 michael@310: static struct applinfo *alloc_buffers( michael@310: unsigned MaxB3Connection, michael@310: unsigned MaxB3Blks, michael@310: @@ -459,6 +482,7 @@ michael@310: ap->lastfree->next = 0; michael@310: return ap; michael@310: } michael@202: +#endif michael@310: michael@310: static void free_buffers(struct applinfo *ap) michael@310: { michael@310: @@ -576,14 +600,17 @@ michael@310: unsigned MaxSizeB3, michael@310: unsigned *ApplID) michael@310: { michael@310: +#if 0 michael@310: int applid = 0; michael@310: char buf[PATH_MAX]; michael@310: int i, fd = -1; michael@310: michael@310: *ApplID = 0; michael@310: +#endif michael@310: michael@310: if (capi20_isinstalled() != CapiNoError) michael@310: return CapiRegNotInstalled; michael@310: +#if 0 michael@310: if ((!remote_capi) || ((remote_capi) && ((fd = open_socket()) < 0))) { michael@310: if ((fd = open(capidevname, O_RDWR|O_NONBLOCK, 0666)) < 0 && michael@310: (errno == ENOENT)) { michael@310: @@ -621,6 +648,8 @@ michael@310: close(fd); michael@310: return(errcode); michael@310: } michael@310: + } michael@310: +#if 0 michael@310: } else if ((applid = ioctl(fd, CAPI_REGISTER, &ioctl_data)) < 0) { michael@310: if (errno == EIO) { michael@310: if (ioctl(fd, CAPI_GET_ERRCODE, &ioctl_data) < 0) { michael@310: @@ -666,6 +695,7 @@ michael@310: applid = alloc_applid(fd); michael@310: } // end old driver compatibility michael@310: } michael@310: +#endif michael@310: if (remember_applid(applid, fd) < 0) { michael@310: close(fd); michael@310: return CapiRegOSResourceErr; michael@310: @@ -676,6 +706,7 @@ michael@310: return CapiRegOSResourceErr; michael@310: } michael@310: *ApplID = applid; michael@310: +#endif michael@310: return CapiNoError; michael@310: } michael@310: michael@310: @@ -784,11 +815,15 @@ michael@310: ret = CapiIllAppNr; michael@310: break; michael@310: case EIO: michael@310: +#if 0 michael@310: if (ioctl(fd, CAPI_GET_ERRCODE, &ioctl_data) < 0) { michael@310: +#endif michael@310: ret = CapiMsgOSResourceErr; michael@310: +#if 0 michael@310: } else { michael@310: ret = (unsigned)ioctl_data.errcode; michael@310: } michael@310: +#endif michael@310: break; michael@310: default: michael@310: ret = CapiMsgOSResourceErr; michael@310: @@ -842,7 +877,7 @@ michael@310: rcvbuf[15] = (data >> 24) & 0xff; michael@310: } else { michael@310: u_int64_t data; michael@310: - ulong radr = (ulong)rcvbuf; michael@310: + unsigned long radr = (unsigned long)rcvbuf; michael@310: if (CAPIMSG_LEN(rcvbuf) < 30) { michael@310: /* michael@310: * grr, 64bit arch, but no data64 included, michael@310: @@ -899,6 +934,9 @@ michael@310: { michael@310: if (capi20_isinstalled() != CapiNoError) michael@310: return 0; michael@310: +#ifndef CAPI_MANUFACTURER_LEN michael@310: +#define CAPI_MANUFACTURER_LEN 64 michael@310: +#endif michael@310: michael@310: if (remote_capi) { michael@310: unsigned char buf[100]; michael@310: @@ -911,15 +949,19 @@ michael@310: return Buf; michael@310: } michael@310: michael@310: +#if 0 michael@310: ioctl_data.contr = Ctrl; michael@310: michael@310: if (ioctl(capi_fd, CAPI_GET_MANUFACTURER, &ioctl_data) < 0) michael@310: +#endif michael@310: return 0; michael@310: michael@310: +#if 0 michael@310: memcpy(Buf, ioctl_data.manufacturer, CAPI_MANUFACTURER_LEN); michael@310: Buf[CAPI_MANUFACTURER_LEN-1] = 0; michael@310: michael@310: return Buf; michael@310: +#endif michael@310: } michael@310: michael@310: unsigned char * michael@310: @@ -934,16 +976,20 @@ michael@310: set_rcapicmd_header(&p, 14, RCAPI_GET_VERSION_REQ, Ctrl); michael@310: if(!(remote_command(capi_fd, buf, 14, RCAPI_GET_VERSION_CONF))) michael@310: return 0; michael@310: - memcpy(Buf, buf + 1, sizeof(capi_version)); michael@310: + memcpy(Buf, buf + 1, 128 /* sizeof(capi_version) */); michael@310: return Buf; michael@310: } michael@310: michael@310: +#if 0 michael@310: ioctl_data.contr = Ctrl; michael@310: if (ioctl(capi_fd, CAPI_GET_VERSION, &ioctl_data) < 0) { michael@310: +#endif michael@310: return 0; michael@310: +#if 0 michael@310: } michael@310: memcpy(Buf, &ioctl_data.version, sizeof(capi_version)); michael@310: return Buf; michael@310: +#endif michael@310: } michael@310: michael@310: unsigned char * michael@310: @@ -952,6 +998,10 @@ michael@310: if (capi20_isinstalled() != CapiNoError) michael@310: return 0; michael@310: michael@310: +#ifndef CAPI_SERIAL_LEN michael@310: +#define CAPI_SERIAL_LEN 8 michael@202: +#endif michael@202: + michael@310: if (remote_capi) { michael@310: unsigned char buf[100]; michael@310: unsigned char *p = buf; michael@310: @@ -963,15 +1013,19 @@ michael@310: return Buf; michael@310: } michael@310: michael@310: +#if 0 michael@310: ioctl_data.contr = Ctrl; michael@310: michael@310: if (ioctl(capi_fd, CAPI_GET_SERIAL, &ioctl_data) < 0) michael@202: +#endif michael@310: return 0; michael@310: michael@202: +#if 0 michael@310: memcpy(Buf, &ioctl_data.serial, CAPI_SERIAL_LEN); michael@310: Buf[CAPI_SERIAL_LEN-1] = 0; michael@310: michael@310: return Buf; michael@202: +#endif michael@202: } michael@202: michael@310: unsigned michael@311: @@ -1018,6 +1072,7 @@ michael@310: sizeof(ioctl_data.profile.ncontroller)); michael@202: } michael@310: return CapiNoError; michael@310: +#endif michael@310: } michael@310: /* michael@310: * functions added to the CAPI2.0 spec michael@362: Index: chan_capi-1.1.5.20110914/libcapi20/convert.c michael@362: diff -Nau chan_capi-1.1.5.20110914/libcapi20/convert.c.orig chan_capi-1.1.5.20110914/libcapi20/convert.c michael@362: --- chan_capi-1.1.5.20110914/libcapi20/convert.c.orig 2011-01-07 02:29:31.000000000 +0100 michael@362: +++ chan_capi-1.1.5.20110914/libcapi20/convert.c 2011-05-23 17:35:28.348531751 +0200 michael@310: @@ -11,7 +11,14 @@ michael@310: #include michael@310: #include michael@310: #include michael@310: +#ifdef __FreeBSD__ michael@310: +#include michael@310: +#define bswap_16 bswap16 michael@310: +#define bswap_32 bswap32 michael@310: +#define bswap_64 bswap64 michael@310: +#else michael@310: #include michael@310: +#endif michael@310: michael@310: #include "capi20.h" michael@310: michael@362: Index: chan_capi-1.1.5.20110914/Makefile michael@362: diff -Nau chan_capi-1.1.5.20110914/Makefile.orig chan_capi-1.1.5.20110914/Makefile michael@362: --- chan_capi-1.1.5.20110914/Makefile.orig 2011-01-07 02:29:32.000000000 +0100 michael@362: +++ chan_capi-1.1.5.20110914/Makefile 2011-05-23 17:35:28.348531751 +0200 michael@362: @@ -114,6 +114,9 @@ michael@311: CFLAGS+=-O2 michael@311: CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi) michael@311: CFLAGS+=$(shell if uname -m | grep -q "ppc\|arm\|s390"; then echo "-fsigned-char"; fi) michael@311: +ifeq (${USE_OWN_LIBCAPI},yes) michael@311: +CFLAGS+=-DUSE_OWN_LIBCAPI michael@311: +endif michael@311: ifeq (${DIVA_STREAMING},1) michael@311: CFLAGS += -DDIVA_STREAMING=1 michael@311: endif michael@311: Index: channels/chan_sip.c michael@311: diff -Nau channels/chan_sip.c.orig channels/chan_sip.c michael@362: --- channels/chan_sip.c.orig 2011-08-10 00:12:59.000000000 +0200 michael@362: +++ channels/chan_sip.c 2011-09-14 14:29:50.757959000 +0200 michael@362: @@ -11647,7 +11647,16 @@ michael@311: } else { michael@311: if (sipmethod == SIP_NOTIFY && !ast_strlen_zero(p->theirtag)) { michael@311: /* If this is a NOTIFY, use the From: tag in the subscribe (RFC 3265) */ michael@311: - snprintf(to, sizeof(to), "<%s%s>;tag=%s", (strncasecmp(p->uri, "sip:", 4) ? "sip:" : ""), p->uri, p->theirtag); michael@311: + if (strncasecmp(p->uri, "sip:", strlen("sip:"))) michael@311: + if (strncasecmp(p->uri, "sips:", strlen("sips:"))) michael@311: + if (p->socket.type == SIP_TRANSPORT_TLS) michael@311: + snprintf(to, sizeof(to), "<%s%s>;tag=%s", "sips:", p->uri, p->theirtag); michael@311: + else michael@311: + snprintf(to, sizeof(to), "<%s%s>;tag=%s", "sips:", p->uri, p->theirtag); michael@311: + else /* if (strncasecmp(p->uri, "sips:"... */ michael@311: + snprintf(to, sizeof(to), "<%s%s>;tag=%s", "", p->uri, p->theirtag); michael@311: + else /* if (strncasecmp(p->uri, "sip:"... */ michael@311: + snprintf(to, sizeof(to), "<%s%s>;tag=%s", "", p->uri, p->theirtag); michael@311: } else if (p->options && p->options->vxml_url) { michael@311: /* If there is a VXML URL append it to the SIP URL */ michael@311: snprintf(to, sizeof(to), "<%s>;%s", p->uri, p->options->vxml_url); michael@310: Index: channels/console_video.h michael@311: diff -Nau channels/console_video.h.orig channels/console_video.h michael@310: --- channels/console_video.h.orig 2008-06-30 17:45:15.000000000 +0200 michael@362: +++ channels/console_video.h 2011-09-14 14:29:50.767970949 +0200 michael@310: @@ -28,10 +28,7 @@ michael@310: "console {device}" michael@310: #else michael@310: michael@310: -#include michael@310: -#ifndef OLD_FFMPEG michael@310: -#include /* requires a recent ffmpeg */ michael@310: -#endif michael@310: +#include michael@310: michael@310: #define CONSOLE_VIDEO_CMDS \ michael@310: "console {videodevice|videocodec" \ michael@310: Index: configure michael@311: diff -Nau configure.orig configure michael@362: --- configure.orig 2011-08-25 21:08:04.000000000 +0200 michael@362: +++ configure 2011-09-14 14:29:50.767970949 +0200 michael@347: @@ -4704,11 +4704,6 @@ michael@311: esac michael@310: michael@310: case "${host_os}" in michael@310: - freebsd*) michael@347: - ac_default_prefix=/usr/local michael@310: - CPPFLAGS=-I/usr/local/include michael@310: - LDFLAGS=-L/usr/local/lib michael@310: - ;; michael@310: openbsd*) michael@347: ac_default_prefix=/usr/local michael@310: if test ${prefix} = '/usr/local' || test ${prefix} = 'NONE'; then michael@362: @@ -18308,8 +18303,8 @@ michael@311: if test -f "${IMAP_TK_DIR}/c-client/LDFLAGS"; then michael@311: imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS` michael@311: fi michael@311: - imap_libs="${IMAP_TK_DIR}/c-client/c-client.a" michael@311: - imap_include="-I${IMAP_TK_DIR}/c-client" michael@311: + imap_libs="-limap -lssl -lcrypto -lcrypt" michael@311: + imap_include="-DUSE_SYSTEM_IMAP -I${IMAP_TK_DIR}/include/imap" michael@311: CPPFLAGS="${CPPFLAGS} ${imap_include}" michael@311: LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}` michael@311: cat confdefs.h - <<_ACEOF >conftest.$ac_ext michael@362: @@ -25541,19 +25536,19 @@ michael@311: michael@311: # now check for the header. michael@311: if test "${AST_LUA_FOUND}" = "yes"; then michael@311: - LUA_LIB="${pbxlibdir} -llua5.1 -lm" michael@311: + LUA_LIB="${pbxlibdir} -llua -lm" michael@311: # if --with-LUA=DIR has been specified, use it. michael@311: if test "x${LUA_DIR}" != "x"; then michael@311: LUA_INCLUDE="-I${LUA_DIR}/include" michael@311: fi michael@311: LUA_INCLUDE="${LUA_INCLUDE} " michael@311: - if test "xlua5.1/lua.h" = "x" ; then # no header, assume found michael@311: + if test "xlua/lua.h" = "x" ; then # no header, assume found michael@311: LUA_HEADER_FOUND="1" michael@311: else # check for the header michael@311: ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" michael@311: CPPFLAGS="${CPPFLAGS} ${LUA_INCLUDE}" michael@311: - ac_fn_c_check_header_mongrel "$LINENO" "lua5.1/lua.h" "ac_cv_header_lua5_1_lua_h" "$ac_includes_default" michael@311: -if test "x$ac_cv_header_lua5_1_lua_h" = x""yes; then : michael@311: + ac_fn_c_check_header_mongrel "$LINENO" "lua/lua.h" "ac_cv_header_lua_lua_h" "$ac_includes_default" michael@311: +if test "x$ac_cv_header_lua_lua_h" = x""yes; then : michael@311: LUA_HEADER_FOUND=1 michael@311: else michael@311: LUA_HEADER_FOUND=0 michael@362: @@ -25581,9 +25576,9 @@ michael@311: michael@311: if test "x${PBX_LUA}" = "x1" ; then michael@311: if test x"${LUA_DIR}" = x; then michael@311: - LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua5.1" michael@311: + LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua" michael@311: else michael@311: - LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua5.1" michael@311: + LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua" michael@311: fi michael@311: fi michael@311: michael@362: @@ -26262,7 +26257,7 @@ michael@311: pbxlibdir="-L${SQLITE_DIR}" michael@311: fi michael@311: fi michael@311: - pbxfuncname="sqlite_exec" michael@311: + pbxfuncname="sqlite3_exec" michael@311: if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers michael@311: AST_SQLITE_FOUND=yes michael@311: else michael@362: @@ -26976,16 +26971,16 @@ michael@311: if test "x${PBX_GMIME}" != "x1" -a "${USE_GMIME}" != "no"; then michael@311: PBX_GMIME=0 michael@311: if test -n "$ac_tool_prefix"; then michael@311: - # Extract the first word of "${ac_tool_prefix}gmime-config", so it can be a program name with args. michael@311: -set dummy ${ac_tool_prefix}gmime-config; ac_word=$2 michael@311: + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. michael@311: + set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 michael@311: { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 michael@311: $as_echo_n "checking for $ac_word... " >&6; } michael@311: -if test "${ac_cv_path_CONFIG_GMIME+set}" = set; then : michael@311: +if test "${ac_cv_prog_PKGCONFIG+set}" = set; then michael@311: $as_echo_n "(cached) " >&6 michael@311: else michael@311: - case $CONFIG_GMIME in michael@311: + case $PKGCONFIG in michael@311: [\\/]* | ?:[\\/]*) michael@311: - ac_cv_path_CONFIG_GMIME="$CONFIG_GMIME" # Let the user override the test with a path. michael@311: + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. michael@311: ;; michael@311: *) michael@311: as_save_IFS=$IFS; IFS=$PATH_SEPARATOR michael@362: @@ -26996,7 +26991,7 @@ michael@311: test -z "$as_dir" && as_dir=. michael@311: for ac_exec_ext in '' $ac_executable_extensions; do michael@311: if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then michael@311: - ac_cv_path_CONFIG_GMIME="$as_dir/$ac_word$ac_exec_ext" michael@311: + ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" michael@311: $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 michael@311: break 2 michael@311: fi michael@362: @@ -27007,10 +27002,10 @@ michael@311: ;; michael@311: esac michael@311: fi michael@311: -CONFIG_GMIME=$ac_cv_path_CONFIG_GMIME michael@311: -if test -n "$CONFIG_GMIME"; then michael@311: - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONFIG_GMIME" >&5 michael@311: -$as_echo "$CONFIG_GMIME" >&6; } michael@311: +PKGCONFIG=$ac_cv_path_PKGCONFIG michael@311: +if test -n "$PKGCONFIG"; then michael@311: + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 michael@311: +$as_echo "$PKGCONFIG" >&6; } michael@311: else michael@311: { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 michael@311: $as_echo "no" >&6; } michael@362: @@ -27018,18 +27013,18 @@ michael@311: michael@311: michael@311: fi michael@311: -if test -z "$ac_cv_path_CONFIG_GMIME"; then michael@311: - ac_pt_CONFIG_GMIME=$CONFIG_GMIME michael@311: - # Extract the first word of "gmime-config", so it can be a program name with args. michael@311: -set dummy gmime-config; ac_word=$2 michael@311: +if test -z "$ac_cv_path_PKGCONFIG"; then michael@311: + ac_pt_PKGCONFIG=$PKGCONFIG michael@311: + # Extract the first word of "pkg-config", so it can be a program name with args. michael@311: +set dummy pkg-config; ac_word=$2 michael@311: { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 michael@311: $as_echo_n "checking for $ac_word... " >&6; } michael@311: -if test "${ac_cv_path_ac_pt_CONFIG_GMIME+set}" = set; then : michael@311: +if test "${ac_cv_path_ac_pt_PKGCONFIG+set}" = set; then : michael@311: $as_echo_n "(cached) " >&6 michael@311: else michael@311: - case $ac_pt_CONFIG_GMIME in michael@311: + case $ac_pt_PKGCONFIG in michael@311: [\\/]* | ?:[\\/]*) michael@311: - ac_cv_path_ac_pt_CONFIG_GMIME="$ac_pt_CONFIG_GMIME" # Let the user override the test with a path. michael@311: + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. michael@311: ;; michael@311: *) michael@311: as_save_IFS=$IFS; IFS=$PATH_SEPARATOR michael@362: @@ -27040,7 +27035,7 @@ michael@311: test -z "$as_dir" && as_dir=. michael@311: for ac_exec_ext in '' $ac_executable_extensions; do michael@311: if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then michael@311: - ac_cv_path_ac_pt_CONFIG_GMIME="$as_dir/$ac_word$ac_exec_ext" michael@311: + ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" michael@311: $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 michael@311: break 2 michael@311: fi michael@362: @@ -27051,17 +27046,17 @@ michael@311: ;; michael@311: esac michael@311: fi michael@311: -ac_pt_CONFIG_GMIME=$ac_cv_path_ac_pt_CONFIG_GMIME michael@311: -if test -n "$ac_pt_CONFIG_GMIME"; then michael@311: - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_GMIME" >&5 michael@311: -$as_echo "$ac_pt_CONFIG_GMIME" >&6; } michael@311: +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG michael@311: +if test -n "$ac_pt_PKGCONFIG"; then michael@311: + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 michael@311: +$as_echo "${ECHO_T}$ac_pt_PKGCONFIG" >&6; } michael@311: else michael@311: { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 michael@311: $as_echo "no" >&6; } michael@311: fi michael@311: michael@311: - if test "x$ac_pt_CONFIG_GMIME" = x; then michael@311: - CONFIG_GMIME="No" michael@311: + if test "x$ac_pt_PKGCONFIG" = x; then michael@311: + PKGCONFIG="No" michael@311: else michael@311: case $cross_compiling:$ac_tool_warned in michael@311: yes:) michael@362: @@ -27069,17 +27064,15 @@ michael@311: $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} michael@311: ac_tool_warned=yes ;; michael@311: esac michael@311: - CONFIG_GMIME=$ac_pt_CONFIG_GMIME michael@311: + PKGCONFIG=$ac_pt_PKGCONFIG michael@311: fi michael@311: else michael@311: - CONFIG_GMIME="$ac_cv_path_CONFIG_GMIME" michael@311: + PKGCONFIG="$ac_cv_path_PKGCONFIG" michael@311: fi michael@311: michael@311: - if test ! "x${CONFIG_GMIME}" = xNo; then michael@311: - if test x"" = x ; then A=--cflags ; else A="" ; fi michael@311: - GMIME_INCLUDE=$(${CONFIG_GMIME} $A) michael@311: - if test x"" = x ; then A=--libs ; else A="" ; fi michael@311: - GMIME_LIB=$(${CONFIG_GMIME} $A) michael@311: + if test ! "x${PKGCONFIG}" = xNo; then michael@311: + GMIME_INCLUDE=$(${PKGCONFIG} gmime-2.4 --cflags 2>/dev/null) michael@311: + GMIME_LIB=$(${PKGCONFIG} gmime-2.4 --libs) michael@311: if test x"#include " != x ; then michael@311: saved_cppflags="${CPPFLAGS}" michael@311: if test "x${GMIME_DIR}" != "x"; then michael@311: Index: formats/format_pcm.c michael@311: diff -Nau formats/format_pcm.c.orig formats/format_pcm.c michael@362: --- formats/format_pcm.c.orig 2011-07-14 22:13:06.000000000 +0200 michael@362: +++ formats/format_pcm.c 2011-09-14 14:29:50.767970949 +0200 michael@362: @@ -354,6 +354,7 @@ michael@311: ast_log(LOG_WARNING, "Unable to write header\n"); michael@311: return -1; michael@311: } michael@311: + fflush(f); /* issues.asterisk.org bug 0016610 */ michael@311: return 0; michael@311: } michael@311: michael@311: Index: formats/format_wav.c michael@311: diff -Nau formats/format_wav.c.orig formats/format_wav.c michael@362: --- formats/format_wav.c.orig 2011-07-29 19:18:56.000000000 +0200 michael@362: +++ formats/format_wav.c 2011-09-14 14:29:50.767970949 +0200 michael@362: @@ -308,6 +308,7 @@ michael@311: ast_log(LOG_WARNING, "Unable to write header\n"); michael@311: return -1; michael@311: } michael@311: + fflush(f); /* issues.asterisk.org bug 0016610 */ michael@311: return 0; michael@311: } michael@311: michael@311: Index: formats/format_wav_gsm.c michael@311: diff -Nau formats/format_wav_gsm.c.orig formats/format_wav_gsm.c michael@362: --- formats/format_wav_gsm.c.orig 2011-07-14 22:13:06.000000000 +0200 michael@362: +++ formats/format_wav_gsm.c 2011-09-14 14:29:50.767970949 +0200 michael@362: @@ -366,6 +366,7 @@ michael@311: ast_log(LOG_WARNING, "Unable to write header\n"); michael@311: return -1; michael@311: } michael@311: + fflush(f); /* issues.asterisk.org bug 0016610 */ michael@311: return 0; michael@311: } michael@311: michael@311: Index: main/db1-ast/hash/hash.h michael@311: diff -Nau main/db1-ast/hash/hash.h.orig main/db1-ast/hash/hash.h michael@311: --- main/db1-ast/hash/hash.h.orig 2006-08-21 04:11:39.000000000 +0200 michael@362: +++ main/db1-ast/hash/hash.h 2011-09-14 14:29:50.767970949 +0200 michael@311: @@ -36,6 +36,8 @@ michael@311: * @(#)hash.h 8.3 (Berkeley) 5/31/94 michael@311: */ michael@311: michael@311: +#include michael@311: + michael@311: /* Operations */ michael@311: typedef enum { michael@311: HASH_GET, HASH_PUT, HASH_PUTNEW, HASH_DELETE, HASH_FIRST, HASH_NEXT michael@311: Index: main/db1-ast/hash/ndbm.c michael@311: diff -Nau main/db1-ast/hash/ndbm.c.orig main/db1-ast/hash/ndbm.c michael@311: --- main/db1-ast/hash/ndbm.c.orig 2006-08-21 04:11:39.000000000 +0200 michael@362: +++ main/db1-ast/hash/ndbm.c 2011-09-14 14:29:50.767970949 +0200 michael@311: @@ -49,7 +49,8 @@ michael@311: #include michael@311: #include michael@311: michael@311: -#include michael@311: +#include "../include/ndbm.h" michael@311: +#include "../include/db.h" michael@311: #include "hash.h" michael@311: michael@311: /* michael@311: Index: main/features.c michael@311: diff -Nau main/features.c.orig main/features.c michael@362: --- main/features.c.orig 2011-08-10 00:12:59.000000000 +0200 michael@362: +++ main/features.c 2011-09-14 14:29:50.777958246 +0200 michael@362: @@ -1646,6 +1646,10 @@ michael@311: snprintf(args, len, "%s,%s,m", S_OR(touch_format, "wav"), touch_filename); michael@311: } michael@311: michael@311: + for(x = 0; x < strlen(touch_filename); x++) { michael@311: + if (args[x] == '/') michael@311: + args[x] = '-'; michael@311: + } michael@311: for(x = 0; x < strlen(args); x++) { michael@311: if (args[x] == '/') michael@311: args[x] = '-'; michael@362: @@ -1762,6 +1766,10 @@ michael@311: snprintf(args, len, "%s.%s,b", touch_filename, S_OR(touch_format, "wav")); michael@311: } michael@311: michael@311: + for( x = 0; x < strlen(touch_filename); x++) { michael@311: + if (args[x] == '/') michael@311: + args[x] = '-'; michael@311: + } michael@311: for( x = 0; x < strlen(args); x++) { michael@311: if (args[x] == '/') michael@311: args[x] = '-'; michael@311: Index: main/file.c michael@311: diff -Nau main/file.c.orig main/file.c michael@362: --- main/file.c.orig 2011-07-05 15:23:57.000000000 +0200 michael@362: +++ main/file.c 2011-09-14 14:29:50.777958246 +0200 michael@362: @@ -256,7 +256,7 @@ michael@311: char *fn = NULL; michael@311: michael@311: if (!strcmp(ext, "wav49")) michael@311: - ext = "WAV"; michael@311: + ext = "wav"; michael@311: michael@311: if (filename[0] == '/') { michael@311: if (asprintf(&fn, "%s.%s", filename, ext) < 0) { michael@310: Index: main/Makefile michael@311: diff -Nau main/Makefile.orig main/Makefile michael@362: --- main/Makefile.orig 2011-08-03 17:14:36.000000000 +0200 michael@362: +++ main/Makefile 2011-09-14 14:29:50.777958246 +0200 michael@311: @@ -69,10 +69,7 @@ michael@310: endif michael@310: michael@310: ifeq ($(OSARCH),FreeBSD) michael@310: - # -V is understood by BSD Make, not by GNU make. michael@310: - BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) michael@310: - AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi) michael@310: - AST_LIBS+=-lcrypto michael@310: + AST_LIBS+=-lpthread -lcrypto michael@310: endif michael@310: michael@310: ifneq ($(findstring $(OSARCH), mingw32 cygwin ),) michael@310: Index: main/tcptls.c michael@311: diff -Nau main/tcptls.c.orig main/tcptls.c michael@362: --- main/tcptls.c.orig 2011-05-23 18:18:33.000000000 +0200 michael@362: +++ main/tcptls.c 2011-09-14 14:29:50.777958246 +0200 michael@362: @@ -357,6 +357,7 @@ michael@310: if (!ast_strlen_zero(cfg->cafile) || !ast_strlen_zero(cfg->capath)) { michael@310: if (SSL_CTX_load_verify_locations(cfg->ssl_ctx, S_OR(cfg->cafile, NULL), S_OR(cfg->capath,NULL)) == 0) michael@310: ast_verb(0, "SSL CA file(%s)/path(%s) error\n", cfg->cafile, cfg->capath); michael@310: + SSL_CTX_set_client_CA_list(cfg->ssl_ctx, S_OR(cfg->cafile, NULL)); michael@202: } michael@202: michael@310: ast_verb(0, "SSL certificate ok\n"); michael@311: Index: main/udptl.c michael@311: diff -Nau main/udptl.c.orig main/udptl.c michael@362: --- main/udptl.c.orig 2011-05-03 21:55:49.000000000 +0200 michael@362: +++ main/udptl.c 2011-09-14 14:29:50.777958246 +0200 michael@311: @@ -98,6 +98,18 @@ michael@311: michael@311: #define UDPTL_BUF_MASK 15 michael@311: michael@311: +/*! Copied from chan_oss.c, corrects link errors: michael@311: +udptl.o: In function `calculate_local_max_datagram': michael@311: +main/udptl.c:740: undefined reference to `MIN' michael@311: +udptl.o: In function `calculate_far_max_ifp': michael@311: +main/udptl.c:770: undefined reference to `MAX' */ michael@311: +#ifndef MIN michael@311: +#define MIN(a,b) ((a) < (b) ? (a) : (b)) michael@311: +#endif michael@311: +#ifndef MAX michael@311: +#define MAX(a,b) ((a) > (b) ? (a) : (b)) michael@311: +#endif michael@311: + michael@311: typedef struct { michael@311: int buf_len; michael@311: uint8_t buf[LOCAL_FAX_MAX_DATAGRAM]; michael@311: Index: Makefile michael@311: diff -Nau Makefile.orig Makefile michael@362: --- Makefile.orig 2011-08-25 21:08:04.000000000 +0200 michael@362: +++ Makefile 2011-09-14 14:29:50.777958246 +0200 michael@311: @@ -230,15 +230,6 @@ michael@311: _ASTCFLAGS+=-fsigned-char michael@311: endif michael@311: michael@311: -ifeq ($(OSARCH),FreeBSD) michael@311: - ifeq ($(PROC),i386) michael@311: - _ASTCFLAGS+=-march=i686 michael@311: - endif michael@311: - # -V is understood by BSD Make, not by GNU make. michael@311: - BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) michael@311: - _ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi) michael@311: -endif michael@311: - michael@311: ifeq ($(OSARCH),NetBSD) michael@311: _ASTCFLAGS+=-pthread -I/usr/pkg/include michael@311: endif