Sat, 24 Mar 2012 21:40:49 +0100
Introduce many changes to the buildconf and source code including:
(01) clean up, update, and partially update default config files,
(02) seems that Melware is unable to perform release engineering so
update chan_capi to new daily snapshot to solve echo problems,
(03) correct Asterisk inadequate hard coded gmime version check,
(04) force postgresql pthreads linkage to solve build problem,
(05) remove buggy hard coded LibXML configure definitions,
(06) remove local architecture specification to allow GCC
internal logic to determine proper CPU type instead,
(07) remove vendor sound install target causing uncontrolled
downloads and non RPM managed file installation,
(08) solve long outstanding bug in tcptls causing Asterisk
to ignore any intermediate CA certificate signatures,
(09) back out Digium engineering team's bright idea of replacing the
very portable and pervasive POSIX rand(1) with ast_random(), and
then not even implementing it causing all references to fail in
platforms not providing the very new POSIX.1-2008 mkdtemp(3)
function only distributed by BSD and some Linux,
(10) withdraw advanced linker symbol manipulations from SVR5 builds
until either Binutils supports hybrid versioned and anonymous
linker scripts or GCC stops hard coding versioned linker scripts,
(11) correct missing library linkage, some tailored to a specific OS,
(12) remove outdated logic for the no longer distributed gmime-config(1),
(13) remove local gmime buildconf hacks now that Asterisk has corrected
their own build configuration to almost portably support gmime,
(14) solve build problems relating to undetected LibXML paths,
(15) correct erroneous out of tree include definitions,
(16) improve some variable and comment naming,
(17) simplify sound language path hierarchy creation,
and correct australian english installation logic.
michael@311 | 1 | Index: addons/chan_ooh323.c |
michael@311 | 2 | diff -Nau addons/chan_ooh323.c.orig addons/chan_ooh323.c |
michael@405 | 3 | --- addons/chan_ooh323.c.orig 2012-01-26 21:14:50.000000000 +0100 |
michael@405 | 4 | +++ addons/chan_ooh323.c 2012-03-18 17:47:07.875949857 +0100 |
michael@362 | 5 | @@ -24,6 +24,12 @@ |
michael@202 | 6 | |
michael@311 | 7 | #include "chan_ooh323.h" |
michael@311 | 8 | #include <math.h> |
michael@311 | 9 | +#if defined __SVR4 && defined __sun |
michael@311 | 10 | +#include <sys/sockio.h> |
michael@311 | 11 | +#ifndef IPTOS_MINCOST |
michael@311 | 12 | +#define IPTOS_MINCOST 0x02 |
michael@311 | 13 | +#endif |
michael@311 | 14 | +#endif |
michael@202 | 15 | |
michael@311 | 16 | #define FORMAT_STRING_SIZE 512 |
michael@202 | 17 | |
michael@311 | 18 | Index: addons/ooh323c/src/ooCmdChannel.c |
michael@311 | 19 | diff -Nau addons/ooh323c/src/ooCmdChannel.c.orig addons/ooh323c/src/ooCmdChannel.c |
michael@362 | 20 | --- addons/ooh323c/src/ooCmdChannel.c.orig 2011-08-04 21:37:16.000000000 +0200 |
michael@405 | 21 | +++ addons/ooh323c/src/ooCmdChannel.c 2012-03-18 17:47:07.875949857 +0100 |
michael@311 | 22 | @@ -25,6 +25,10 @@ |
michael@311 | 23 | #include "ooCalls.h" |
michael@311 | 24 | #include "ooCmdChannel.h" |
michael@311 | 25 | |
michael@311 | 26 | +#ifndef AF_LOCAL |
michael@311 | 27 | +#define AF_LOCAL AF_UNIX |
michael@311 | 28 | +#define PF_LOCAL PF_UNIX |
michael@311 | 29 | +#endif |
michael@311 | 30 | |
michael@311 | 31 | /** Global endpoint structure */ |
michael@311 | 32 | extern OOH323EndPoint gH323ep; |
michael@311 | 33 | Index: addons/ooh323c/src/ooSocket.c |
michael@311 | 34 | diff -Nau addons/ooh323c/src/ooSocket.c.orig addons/ooh323c/src/ooSocket.c |
michael@362 | 35 | --- addons/ooh323c/src/ooSocket.c.orig 2011-05-04 22:50:18.000000000 +0200 |
michael@405 | 36 | +++ addons/ooh323c/src/ooSocket.c 2012-03-18 17:47:07.875949857 +0100 |
michael@311 | 37 | @@ -24,6 +24,9 @@ |
michael@311 | 38 | |
michael@311 | 39 | #include "ooSocket.h" |
michael@311 | 40 | #include "ootrace.h" |
michael@311 | 41 | +#if defined __SVR4 && defined __sun |
michael@311 | 42 | +#include <sys/sockio.h> |
michael@311 | 43 | +#endif |
michael@311 | 44 | #if defined(_WIN32_WCE) |
michael@311 | 45 | static int inited = 0; |
michael@311 | 46 | #define SEND_FLAGS 0 |
michael@311 | 47 | Index: addons/ooh323cDriver.c |
michael@311 | 48 | diff -Nau addons/ooh323cDriver.c.orig addons/ooh323cDriver.c |
michael@347 | 49 | --- addons/ooh323cDriver.c.orig 2011-02-18 01:07:20.000000000 +0100 |
michael@405 | 50 | +++ addons/ooh323cDriver.c 2012-03-18 17:47:07.875949857 +0100 |
michael@311 | 51 | @@ -27,6 +27,11 @@ |
michael@311 | 52 | |
michael@311 | 53 | #define SEC_TO_HOLD_THREAD 24 |
michael@311 | 54 | |
michael@311 | 55 | +#ifndef AF_LOCAL |
michael@311 | 56 | +#define AF_LOCAL AF_UNIX |
michael@311 | 57 | +#define PF_LOCAL PF_UNIX |
michael@311 | 58 | +#endif |
michael@311 | 59 | + |
michael@311 | 60 | extern struct ast_module *myself; |
michael@311 | 61 | extern OOBOOL gH323Debug; |
michael@311 | 62 | extern OOH323EndPoint gH323ep; |
michael@310 | 63 | Index: apps/app_backticks.c |
michael@311 | 64 | diff -Nau apps/app_backticks.c.orig apps/app_backticks.c |
michael@311 | 65 | --- apps/app_backticks.c.orig 1970-01-01 01:00:00.000000000 +0100 |
michael@405 | 66 | +++ apps/app_backticks.c 2012-03-18 17:47:07.875949857 +0100 |
michael@310 | 67 | @@ -0,0 +1,129 @@ |
michael@202 | 68 | + |
michael@202 | 69 | +#include "asterisk.h" |
michael@202 | 70 | + |
michael@311 | 71 | +ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.52 $") |
michael@202 | 72 | + |
michael@310 | 73 | +#include <stdio.h> |
michael@310 | 74 | +#include <asterisk/file.h> |
michael@310 | 75 | +#include <asterisk/logger.h> |
michael@310 | 76 | +#include <asterisk/channel.h> |
michael@310 | 77 | +#include <asterisk/pbx.h> |
michael@310 | 78 | +#include <asterisk/module.h> |
michael@310 | 79 | +#include <asterisk/lock.h> |
michael@310 | 80 | +#include <asterisk/app.h> |
michael@310 | 81 | +#include <stdlib.h> |
michael@310 | 82 | +#include <unistd.h> |
michael@310 | 83 | +#include <string.h> |
michael@202 | 84 | + |
michael@310 | 85 | +static char *app = "BackTicks"; |
michael@310 | 86 | +static char *synopsis = "Execute a shell command and save the result as a variable."; |
michael@310 | 87 | +static char *desc = " Backticks(<VARNAME>|<command>)\n\n" |
michael@310 | 88 | + "Be sure to include a full path to the command!\n"; |
michael@202 | 89 | + |
michael@310 | 90 | +static char *do_backticks(char *command, char *buf, size_t len) |
michael@310 | 91 | +{ |
michael@310 | 92 | + int fds[2], pid = 0; |
michael@310 | 93 | + char *ret = NULL; |
michael@202 | 94 | + |
michael@310 | 95 | + memset(buf, 0, len); |
michael@310 | 96 | + if (pipe(fds)) { |
michael@310 | 97 | + ast_log(LOG_WARNING, "Pipe/Exec failed\n"); |
michael@310 | 98 | + } else { |
michael@310 | 99 | + pid = fork(); |
michael@310 | 100 | + if (pid < 0) { |
michael@310 | 101 | + ast_log(LOG_WARNING, "Fork failed\n"); |
michael@310 | 102 | + close(fds[0]); |
michael@310 | 103 | + close(fds[1]); |
michael@310 | 104 | + } else if (pid) { |
michael@310 | 105 | + /* parent */ |
michael@310 | 106 | + close(fds[1]); |
michael@310 | 107 | + read(fds[0], buf, len); |
michael@310 | 108 | + close(fds[0]); |
michael@310 | 109 | + ret = buf; |
michael@310 | 110 | + } else { |
michael@310 | 111 | + /* child */ |
michael@310 | 112 | + char *argv[255] = {0}; |
michael@310 | 113 | + int argc = 0; |
michael@310 | 114 | + char *p; |
michael@310 | 115 | + char *mycmd = ast_strdupa(command); |
michael@310 | 116 | + close(fds[0]); |
michael@310 | 117 | + dup2(fds[1], STDOUT_FILENO); |
michael@310 | 118 | + argv[argc++] = mycmd; |
michael@310 | 119 | + do { |
michael@310 | 120 | + if ((p = strchr(mycmd, ' '))) { |
michael@310 | 121 | + *p = '\0'; |
michael@310 | 122 | + mycmd = ++p; |
michael@310 | 123 | + argv[argc++] = mycmd; |
michael@310 | 124 | + } |
michael@310 | 125 | + } while (p != NULL); |
michael@310 | 126 | + close(fds[1]); |
michael@310 | 127 | + execv(argv[0], argv); |
michael@310 | 128 | + ast_log(LOG_ERROR, "exec of %s failed\n", argv[0]); |
michael@310 | 129 | + exit(0); |
michael@310 | 130 | + } |
michael@310 | 131 | + } |
michael@310 | 132 | + return ret; |
michael@202 | 133 | +} |
michael@202 | 134 | + |
michael@310 | 135 | +static int backticks_exec(struct ast_channel *chan, void *data) |
michael@202 | 136 | +{ |
michael@310 | 137 | + int res = 0; |
michael@310 | 138 | + const char *usage = "Usage: Backticks(<VARNAME>|<command>)"; |
michael@310 | 139 | + char buf[1024], *argv[2], *mydata; |
michael@310 | 140 | + int argc = 0; |
michael@310 | 141 | + |
michael@310 | 142 | + if (!data) { |
michael@310 | 143 | + ast_log(LOG_WARNING, "%s\n", usage); |
michael@310 | 144 | + return -1; |
michael@310 | 145 | + } |
michael@310 | 146 | + ast_autoservice_start(chan); |
michael@310 | 147 | + if (!(mydata = ast_strdupa(data))) { |
michael@310 | 148 | + ast_log(LOG_ERROR, "Memory Error!\n"); |
michael@310 | 149 | + res = -1; |
michael@310 | 150 | + } else { |
michael@310 | 151 | + if((argc = ast_app_separate_args(mydata, '|', argv, sizeof(argv) / sizeof(argv[0]))) < 2) { |
michael@310 | 152 | + ast_log(LOG_WARNING, "%s\n", usage); |
michael@310 | 153 | + res = -1; |
michael@310 | 154 | + } |
michael@310 | 155 | + if (do_backticks(argv[1], buf, sizeof(buf))) |
michael@310 | 156 | + pbx_builtin_setvar_helper(chan, argv[0], buf); |
michael@310 | 157 | + else { |
michael@310 | 158 | + ast_log(LOG_WARNING, "No Data!\n"); |
michael@310 | 159 | + res = -1; |
michael@310 | 160 | + } |
michael@310 | 161 | + } |
michael@310 | 162 | + ast_autoservice_stop(chan); |
michael@310 | 163 | + return res; |
michael@202 | 164 | +} |
michael@202 | 165 | + |
michael@310 | 166 | +static int function_backticks(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
michael@202 | 167 | +{ |
michael@310 | 168 | + if (!do_backticks(data, buf, len)) { |
michael@310 | 169 | + ast_log(LOG_WARNING, "No Data!\n"); |
michael@310 | 170 | + return -1; |
michael@310 | 171 | + } |
michael@310 | 172 | + return 0; |
michael@202 | 173 | +} |
michael@202 | 174 | + |
michael@310 | 175 | +static struct ast_custom_function backticks_function = { |
michael@310 | 176 | + .name = "BACKTICKS", |
michael@310 | 177 | + .desc = "Executes a shell command and evaluates to the result.", |
michael@310 | 178 | + .syntax = "BACKTICKS(<command>)", |
michael@310 | 179 | + .synopsis = "Executes a shell command.", |
michael@310 | 180 | + .read = function_backticks |
michael@202 | 181 | +}; |
michael@202 | 182 | + |
michael@202 | 183 | +static int unload_module(void) |
michael@202 | 184 | +{ |
michael@310 | 185 | + ast_custom_function_unregister(&backticks_function); |
michael@310 | 186 | + return ast_unregister_application(app); |
michael@202 | 187 | +} |
michael@202 | 188 | + |
michael@202 | 189 | +static int load_module(void) |
michael@202 | 190 | +{ |
michael@310 | 191 | + ast_custom_function_register(&backticks_function); |
michael@310 | 192 | + return ast_register_application(app, backticks_exec, synopsis, desc); |
michael@202 | 193 | +} |
michael@202 | 194 | + |
michael@310 | 195 | +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "BACKTICKS() dialplan function"); |
michael@202 | 196 | + |
michael@310 | 197 | Index: apps/app_meetme.c |
michael@311 | 198 | diff -Nau apps/app_meetme.c.orig apps/app_meetme.c |
michael@405 | 199 | --- apps/app_meetme.c.orig 2012-01-09 16:37:12.000000000 +0100 |
michael@405 | 200 | +++ apps/app_meetme.c 2012-03-18 17:47:07.875949857 +0100 |
michael@405 | 201 | @@ -614,6 +614,7 @@ |
michael@310 | 202 | |
michael@398 | 203 | /*! Do not write any audio to this channel until the state is up. */ |
michael@398 | 204 | #define CONFFLAG_NO_AUDIO_UNTIL_UP (1ULL << 31) |
michael@398 | 205 | +#define CONFFLAG_USERNAME (1 << 32) |
michael@398 | 206 | /*! If set play an intro announcement at start of conference */ |
michael@398 | 207 | #define CONFFLAG_INTROMSG (1ULL << 32) |
michael@398 | 208 | |
michael@405 | 209 | @@ -625,6 +626,7 @@ |
michael@310 | 210 | OPT_ARG_MOH_CLASS = 4, |
michael@311 | 211 | OPT_ARG_INTROMSG = 5, |
michael@311 | 212 | OPT_ARG_ARRAY_SIZE = 6, |
michael@311 | 213 | + OPT_ARG_USERNAME = 7, |
michael@310 | 214 | }; |
michael@310 | 215 | |
michael@310 | 216 | AST_APP_OPTIONS(meetme_opts, BEGIN_OPTIONS |
michael@405 | 217 | @@ -658,6 +660,7 @@ |
michael@310 | 218 | AST_APP_OPTION('1', CONFFLAG_NOONLYPERSON ), |
michael@310 | 219 | AST_APP_OPTION_ARG('S', CONFFLAG_DURATION_STOP, OPT_ARG_DURATION_STOP), |
michael@310 | 220 | AST_APP_OPTION_ARG('L', CONFFLAG_DURATION_LIMIT, OPT_ARG_DURATION_LIMIT), |
michael@310 | 221 | + AST_APP_OPTION_ARG('n', CONFFLAG_USERNAME, OPT_ARG_USERNAME), |
michael@310 | 222 | END_OPTIONS ); |
michael@310 | 223 | |
michael@311 | 224 | static const char * const app = "MeetMe"; |
michael@405 | 225 | @@ -2453,6 +2456,12 @@ |
michael@311 | 226 | ast_test_flag64(confflags, CONFFLAG_INTROUSERNOREVIEW))) { |
michael@310 | 227 | char destdir[PATH_MAX]; |
michael@310 | 228 | |
michael@311 | 229 | + if (!ast_test_flag64(confflags, CONFFLAG_USERNAME) |
michael@310 | 230 | + && !ast_strlen_zero(optargs[OPT_ARG_USERNAME]) |
michael@310 | 231 | + && ast_fileexists(optargs[OPT_ARG_USERNAME], NULL, NULL)) |
michael@310 | 232 | + snprintf(destdir, sizeof(destdir), "%s", optargs[OPT_ARG_USERNAME]); |
michael@310 | 233 | + else { |
michael@202 | 234 | + |
michael@310 | 235 | snprintf(destdir, sizeof(destdir), "%s/meetme", ast_config_AST_SPOOL_DIR); |
michael@310 | 236 | |
michael@310 | 237 | if (ast_mkdir(destdir, 0777) != 0) { |
michael@405 | 238 | @@ -2469,6 +2478,7 @@ |
michael@310 | 239 | res = ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL); |
michael@310 | 240 | if (res == -1) |
michael@310 | 241 | goto outrun; |
michael@310 | 242 | + } |
michael@310 | 243 | } |
michael@310 | 244 | |
michael@310 | 245 | ast_mutex_lock(&conf->playlock); |
michael@311 | 246 | Index: apps/app_voicemail.c |
michael@311 | 247 | diff -Nau apps/app_voicemail.c.orig apps/app_voicemail.c |
michael@405 | 248 | --- apps/app_voicemail.c.orig 2012-01-25 23:21:30.000000000 +0100 |
michael@405 | 249 | +++ apps/app_voicemail.c 2012-03-18 17:47:07.888451260 +0100 |
michael@405 | 250 | @@ -376,6 +376,7 @@ |
michael@311 | 251 | static char imapport[8]; |
michael@311 | 252 | static char imapflags[128]; |
michael@311 | 253 | static char imapfolder[64]; |
michael@311 | 254 | +static int imapsubfold = 0; |
michael@311 | 255 | static char imapparentfolder[64] = "\0"; |
michael@311 | 256 | static char greetingfolder[64]; |
michael@311 | 257 | static char authuser[32]; |
michael@405 | 258 | @@ -2524,7 +2525,7 @@ |
michael@310 | 259 | } |
michael@310 | 260 | |
michael@311 | 261 | /* Build up server information */ |
michael@311 | 262 | - ast_build_string(&t, &left, "{%s:%s/imap", imapserver, imapport); |
michael@311 | 263 | + ast_build_string(&t, &left, "{%s:%s", imapserver, imapport); |
michael@310 | 264 | |
michael@311 | 265 | /* Add authentication user if present */ |
michael@311 | 266 | if (!ast_strlen_zero(authuser)) |
michael@405 | 267 | @@ -6186,6 +6187,7 @@ |
michael@311 | 268 | /* simple. huh? */ |
michael@311 | 269 | char sequence[10]; |
michael@311 | 270 | char mailbox[256]; |
michael@311 | 271 | + char folder[256]; |
michael@311 | 272 | int res; |
michael@311 | 273 | |
michael@311 | 274 | /* get the real IMAP message number for this message */ |
michael@405 | 275 | @@ -6201,10 +6203,24 @@ |
michael@311 | 276 | mail_setflag(vms->mailstream, sequence, "\\Unseen"); |
michael@311 | 277 | mail_clearflag(vms->mailstream, sequence, "\\Seen"); |
michael@311 | 278 | } |
michael@311 | 279 | - if (!strcasecmp(mbox(vmu, NEW_FOLDER), vms->curbox) && (box == NEW_FOLDER || box == OLD_FOLDER)) { |
michael@311 | 280 | - ast_mutex_unlock(&vms->lock); |
michael@311 | 281 | + |
michael@311 | 282 | + if ((!strcasecmp(mbox(vmu, NEW_FOLDER), vms->curbox) || \ |
michael@311 | 283 | + !strcasecmp(mbox(vmu, OLD_FOLDER), vms->curbox)) && \ |
michael@311 | 284 | + (box == NEW_FOLDER || box == OLD_FOLDER)) { /* Don't copy data, */ |
michael@311 | 285 | + ast_mutex_unlock(&vms->lock); /* just change Seen flag */ |
michael@311 | 286 | return 0; |
michael@311 | 287 | + } else if (box != NEW_FOLDER && box != OLD_FOLDER) { /* Do copy data */ |
michael@311 | 288 | + if (imapsubfold == 1) /* using INBOX or subfolder */ |
michael@311 | 289 | + snprintf(folder, sizeof(folder), "%s%c%s", imapfolder, delimiter, mbox(vmu, box)); |
michael@311 | 290 | + else |
michael@311 | 291 | + strncpy(folder, mbox(vmu, box), sizeof(folder)); |
michael@311 | 292 | + int res = !mail_copy(vms->mailstream,sequence,folder); |
michael@311 | 293 | + ast_mutex_unlock(&vms->lock); |
michael@311 | 294 | + return res; |
michael@311 | 295 | + } else { /* Copy data to INBOX delegating new/old status to Seen flag */ |
michael@311 | 296 | + int res = !mail_copy(vms->mailstream,sequence,imapfolder); |
michael@311 | 297 | } |
michael@311 | 298 | + |
michael@311 | 299 | /* Create the folder if it don't exist */ |
michael@311 | 300 | imap_mailbox_name(mailbox, sizeof(mailbox), vms, box, 1); /* Get the full mailbox name */ |
michael@311 | 301 | ast_debug(5, "Checking if folder exists: %s\n", mailbox); |
michael@405 | 302 | @@ -10478,6 +10494,10 @@ |
michael@311 | 303 | #ifndef IMAP_STORAGE |
michael@311 | 304 | } else if (!cmd) { |
michael@311 | 305 | vms.deleted[vms.curmsg] = 1; |
michael@311 | 306 | +#else |
michael@311 | 307 | + } else if (!cmd && (folder_int(vms.curbox) > 1 || box > 1)) { |
michael@311 | 308 | + vms.deleted[vms.curmsg] = 1; /* Enforce deletion after */ |
michael@311 | 309 | + deleted = 1; /* successful copy op */ |
michael@311 | 310 | #endif |
michael@311 | 311 | } else { |
michael@311 | 312 | vms.deleted[vms.curmsg] = 0; |
michael@405 | 313 | @@ -11996,6 +12016,15 @@ |
michael@311 | 314 | } else { |
michael@311 | 315 | ast_copy_string(imapfolder, "INBOX", sizeof(imapfolder)); |
michael@311 | 316 | } |
michael@311 | 317 | + /* IMAP saved (sub)folder location policy */ |
michael@311 | 318 | + if ((val = ast_variable_retrieve(cfg, "general", "imapsubfold"))) { |
michael@311 | 319 | + if (ast_false(val)) |
michael@311 | 320 | + imapsubfold = 0; |
michael@311 | 321 | + else |
michael@311 | 322 | + imapsubfold = 1; |
michael@311 | 323 | + } else { |
michael@311 | 324 | + imapsubfold = 0; |
michael@311 | 325 | + } |
michael@311 | 326 | if ((val = ast_variable_retrieve(cfg, "general", "imapparentfolder"))) { |
michael@311 | 327 | ast_copy_string(imapparentfolder, val, sizeof(imapparentfolder)); |
michael@311 | 328 | } |
michael@362 | 329 | Index: cdr/cdr_radius.c |
michael@362 | 330 | diff -Nau cdr/cdr_radius.c.orig cdr/cdr_radius.c |
michael@362 | 331 | --- cdr/cdr_radius.c.orig 2011-07-14 22:13:06.000000000 +0200 |
michael@405 | 332 | +++ cdr/cdr_radius.c 2012-03-18 17:47:07.888451260 +0100 |
michael@362 | 333 | @@ -106,10 +106,18 @@ |
michael@362 | 334 | if (!rc_avpair_add(rh, tosend, PW_AST_SRC, &cdr->src, strlen(cdr->src), VENDOR_CODE)) |
michael@362 | 335 | return -1; |
michael@362 | 336 | |
michael@362 | 337 | + /* RADIUS standard identifier patch */ |
michael@362 | 338 | + if (!rc_avpair_add(rh, tosend, PW_CALLING_STATION_ID, &cdr->src, strlen(cdr->src), 0)) |
michael@362 | 339 | + return -1; |
michael@362 | 340 | + |
michael@362 | 341 | /* Destination */ |
michael@362 | 342 | if (!rc_avpair_add(rh, tosend, PW_AST_DST, &cdr->dst, strlen(cdr->dst), VENDOR_CODE)) |
michael@362 | 343 | return -1; |
michael@362 | 344 | |
michael@362 | 345 | + /* RADIUS standard identifier patch */ |
michael@362 | 346 | + if (!rc_avpair_add(rh, tosend, PW_CALLED_STATION_ID, &cdr->dst, strlen(cdr->dst), 0)) |
michael@362 | 347 | + return -1; |
michael@362 | 348 | + |
michael@362 | 349 | /* Destination context */ |
michael@362 | 350 | if (!rc_avpair_add(rh, tosend, PW_AST_DST_CTX, &cdr->dcontext, strlen(cdr->dcontext), VENDOR_CODE)) |
michael@362 | 351 | return -1; |
michael@362 | 352 | @@ -164,6 +172,10 @@ |
michael@362 | 353 | if (!rc_avpair_add(rh, tosend, PW_AST_BILL_SEC, &cdr->billsec, 0, VENDOR_CODE)) |
michael@362 | 354 | return -1; |
michael@362 | 355 | |
michael@362 | 356 | + /* RADIUS standard identifier patch */ |
michael@362 | 357 | + if (!rc_avpair_add(rh, tosend, PW_ACCT_SESSION_TIME, &cdr->billsec, 0, 0)) |
michael@362 | 358 | + return -1; |
michael@362 | 359 | + |
michael@362 | 360 | /* Disposition */ |
michael@362 | 361 | tmp = ast_cdr_disp2str(cdr->disposition); |
michael@362 | 362 | if (!rc_avpair_add(rh, tosend, PW_AST_DISPOSITION, tmp, strlen(tmp), VENDOR_CODE)) |
michael@362 | 363 | @@ -187,10 +199,14 @@ |
michael@362 | 364 | } |
michael@362 | 365 | |
michael@362 | 366 | /* Setting Acct-Session-Id & User-Name attributes for proper generation |
michael@362 | 367 | - of Acct-Unique-Session-Id on server side */ |
michael@362 | 368 | - /* Channel */ |
michael@362 | 369 | - if (!rc_avpair_add(rh, tosend, PW_USER_NAME, &cdr->channel, strlen(cdr->channel), 0)) |
michael@362 | 370 | - return -1; |
michael@362 | 371 | + of Acct-Unique-Session-Id on server side Channel */ |
michael@362 | 372 | + { |
michael@362 | 373 | + char szChanuser[PATH_MAX] = {0}; |
michael@362 | 374 | + strncpy(szChanuser, &cdr->channel, PATH_MAX-1); |
michael@362 | 375 | + *(strrchr(szChanuser, '-')) = 0; |
michael@362 | 376 | + if (!rc_avpair_add(rh, tosend, PW_USER_NAME, szChanuser, strlen(cdr->channel), 0)) |
michael@362 | 377 | + return -1; |
michael@362 | 378 | + } |
michael@362 | 379 | |
michael@362 | 380 | /* Unique ID */ |
michael@362 | 381 | if (!rc_avpair_add(rh, tosend, PW_ACCT_SESSION_ID, &cdr->uniqueid, strlen(cdr->uniqueid), 0)) |
michael@414 | 382 | Index: chan_capi-1.1.5.20120324/chan_capi20.h |
michael@414 | 383 | diff -Nau chan_capi-1.1.5.20120324/chan_capi20.h.orig chan_capi-1.1.5.20120324/chan_capi20.h |
michael@414 | 384 | --- chan_capi-1.1.5.20120324/chan_capi20.h.orig 2005-09-20 20:33:40.000000000 +0200 |
michael@414 | 385 | +++ chan_capi-1.1.5.20120324/chan_capi20.h 2012-03-18 17:47:07.888451260 +0100 |
michael@311 | 386 | @@ -4,10 +4,13 @@ |
michael@311 | 387 | * first. Else the checks below will fail. |
michael@311 | 388 | */ |
michael@311 | 389 | |
michael@311 | 390 | +#include <stddef.h> |
michael@311 | 391 | #include <capi20.h> |
michael@310 | 392 | |
michael@310 | 393 | #undef CAPI_OS_HINT |
michael@310 | 394 | |
michael@310 | 395 | +#ifndef USE_OWN_LIBCAPI |
michael@310 | 396 | + |
michael@310 | 397 | #if (defined(__FreeBSD__) || defined(__OpenBSD__) || \ |
michael@310 | 398 | defined(__NetBSD__) || defined(__APPLE__)) |
michael@310 | 399 | |
michael@311 | 400 | @@ -29,6 +32,8 @@ |
michael@310 | 401 | #include <capiutils.h> |
michael@310 | 402 | #endif /* BSD */ |
michael@310 | 403 | |
michael@202 | 404 | +#endif |
michael@202 | 405 | + |
michael@310 | 406 | #ifndef HEADER_CID |
michael@310 | 407 | #define HEADER_CID(x) ((x)->adr.adrNCCI) |
michael@310 | 408 | #endif |
michael@414 | 409 | Index: chan_capi-1.1.5.20120324/chan_capi_utils.c |
michael@414 | 410 | diff -Nau chan_capi-1.1.5.20120324/chan_capi_utils.c.orig chan_capi-1.1.5.20120324/chan_capi_utils.c |
michael@414 | 411 | --- chan_capi-1.1.5.20120324/chan_capi_utils.c.orig 2011-08-07 16:31:05.000000000 +0200 |
michael@414 | 412 | +++ chan_capi-1.1.5.20120324/chan_capi_utils.c 2012-03-18 17:47:07.888451260 +0100 |
michael@414 | 413 | @@ -1160,6 +1160,9 @@ |
michael@310 | 414 | { |
michael@310 | 415 | MESSAGE_EXCHANGE_ERROR error; |
michael@310 | 416 | int waitcount = 50; |
michael@310 | 417 | +#ifndef CAPI_MANUFACTURER_LEN |
michael@310 | 418 | +#define CAPI_MANUFACTURER_LEN 64 |
michael@310 | 419 | +#endif |
michael@310 | 420 | unsigned char manbuf[CAPI_MANUFACTURER_LEN]; |
michael@310 | 421 | _cmsg CMSG; |
michael@310 | 422 | |
michael@414 | 423 | Index: chan_capi-1.1.5.20120324/libcapi20/capi20.c |
michael@414 | 424 | diff -Nau chan_capi-1.1.5.20120324/libcapi20/capi20.c.orig chan_capi-1.1.5.20120324/libcapi20/capi20.c |
michael@414 | 425 | --- chan_capi-1.1.5.20120324/libcapi20/capi20.c.orig 2010-02-17 20:10:53.000000000 +0100 |
michael@414 | 426 | +++ chan_capi-1.1.5.20120324/libcapi20/capi20.c 2012-03-18 17:47:07.888451260 +0100 |
michael@310 | 427 | @@ -19,8 +19,10 @@ |
michael@310 | 428 | #include <stdio.h> |
michael@310 | 429 | #include <ctype.h> |
michael@310 | 430 | #include <assert.h> |
michael@310 | 431 | +#ifdef __linux__ |
michael@310 | 432 | #define _LINUX_LIST_H |
michael@310 | 433 | #include <linux/capi.h> |
michael@310 | 434 | +#endif |
michael@310 | 435 | |
michael@310 | 436 | #include <sys/socket.h> |
michael@310 | 437 | #include <netinet/in.h> |
michael@310 | 438 | @@ -48,17 +50,23 @@ |
michael@310 | 439 | |
michael@310 | 440 | #define SEND_BUFSIZ (128+2048) |
michael@310 | 441 | |
michael@202 | 442 | +#if 0 |
michael@310 | 443 | static char capidevname[] = "/dev/capi20"; |
michael@310 | 444 | static char capidevnamenew[] = "/dev/isdn/capi20"; |
michael@310 | 445 | +#endif |
michael@310 | 446 | |
michael@310 | 447 | static int capi_fd = -1; |
michael@310 | 448 | +#if 0 |
michael@310 | 449 | static capi_ioctl_struct ioctl_data; |
michael@310 | 450 | +#endif |
michael@310 | 451 | |
michael@310 | 452 | static int remote_capi; |
michael@310 | 453 | +#if 0 |
michael@310 | 454 | static char *globalconfigfilename = "/etc/capi20.conf"; |
michael@310 | 455 | static char *userconfigfilename = ".capi20rc"; |
michael@310 | 456 | static unsigned short int port; |
michael@310 | 457 | static char hostname[1024]; |
michael@310 | 458 | +#endif |
michael@310 | 459 | static int tracelevel; |
michael@310 | 460 | static char *tracefile; |
michael@310 | 461 | |
michael@310 | 462 | @@ -77,17 +85,21 @@ |
michael@310 | 463 | #define RCAPI_AUTH_USER_REQ CAPICMD(0xff, 0x00) |
michael@310 | 464 | #define RCAPI_AUTH_USER_CONF CAPICMD(0xff, 0x01) |
michael@310 | 465 | |
michael@310 | 466 | +#if 0 |
michael@310 | 467 | static char *skip_whitespace(char *s) |
michael@310 | 468 | { |
michael@310 | 469 | while (*s && isspace(*s)) s++; |
michael@310 | 470 | return s; |
michael@310 | 471 | } |
michael@310 | 472 | +#endif |
michael@310 | 473 | |
michael@310 | 474 | +#if 0 |
michael@310 | 475 | static char *skip_nonwhitespace(char *s) |
michael@310 | 476 | { |
michael@310 | 477 | while (*s && !isspace(*s)) s++; |
michael@310 | 478 | return s; |
michael@310 | 479 | } |
michael@310 | 480 | +#endif |
michael@310 | 481 | |
michael@310 | 482 | static unsigned char get_byte(unsigned char **p) |
michael@310 | 483 | { |
michael@310 | 484 | @@ -95,10 +107,12 @@ |
michael@310 | 485 | return((unsigned char)*(*p - 1)); |
michael@310 | 486 | } |
michael@310 | 487 | |
michael@310 | 488 | +#if 0 |
michael@310 | 489 | static unsigned short get_word(unsigned char **p) |
michael@310 | 490 | { |
michael@310 | 491 | return(get_byte(p) | (get_byte(p) << 8)); |
michael@310 | 492 | } |
michael@310 | 493 | +#endif |
michael@310 | 494 | |
michael@310 | 495 | static unsigned short get_netword(unsigned char **p) |
michael@310 | 496 | { |
michael@310 | 497 | @@ -144,6 +158,7 @@ |
michael@310 | 498 | * read config file |
michael@310 | 499 | */ |
michael@310 | 500 | |
michael@310 | 501 | +#if 0 |
michael@310 | 502 | static int read_config(void) |
michael@310 | 503 | { |
michael@310 | 504 | FILE *fp = NULL; |
michael@310 | 505 | @@ -197,11 +212,13 @@ |
michael@310 | 506 | fclose(fp); |
michael@310 | 507 | return(1); |
michael@310 | 508 | } |
michael@310 | 509 | +#endif |
michael@310 | 510 | |
michael@310 | 511 | /* |
michael@310 | 512 | * socket function |
michael@310 | 513 | */ |
michael@310 | 514 | |
michael@310 | 515 | +#if 0 |
michael@310 | 516 | static int open_socket(void) |
michael@310 | 517 | { |
michael@310 | 518 | int fd; |
michael@310 | 519 | @@ -225,6 +242,7 @@ |
michael@310 | 520 | close(fd); |
michael@310 | 521 | return(-1); |
michael@310 | 522 | } |
michael@310 | 523 | +#endif |
michael@310 | 524 | |
michael@310 | 525 | static int socket_read(int fd, unsigned char *buf, int l) |
michael@310 | 526 | { |
michael@310 | 527 | @@ -328,6 +346,8 @@ |
michael@310 | 528 | if (likely(capi_fd >= 0)) |
michael@310 | 529 | return CapiNoError; |
michael@310 | 530 | |
michael@310 | 531 | +#if 0 |
michael@310 | 532 | + |
michael@310 | 533 | /*----- open managment link -----*/ |
michael@310 | 534 | if (read_config() && (remote_capi)) { |
michael@310 | 535 | capi_fd = open_socket(); |
michael@310 | 536 | @@ -347,6 +367,8 @@ |
michael@310 | 537 | if (ioctl(capi_fd, CAPI_INSTALLED, 0) == 0) |
michael@310 | 538 | return CapiNoError; |
michael@310 | 539 | |
michael@202 | 540 | +#endif |
michael@202 | 541 | + |
michael@310 | 542 | return CapiRegNotInstalled; |
michael@310 | 543 | } |
michael@310 | 544 | |
michael@310 | 545 | @@ -421,6 +443,7 @@ |
michael@310 | 546 | unsigned char *bufferstart; |
michael@310 | 547 | }; |
michael@310 | 548 | |
michael@310 | 549 | +#if 0 |
michael@310 | 550 | static struct applinfo *alloc_buffers( |
michael@310 | 551 | unsigned MaxB3Connection, |
michael@310 | 552 | unsigned MaxB3Blks, |
michael@310 | 553 | @@ -459,6 +482,7 @@ |
michael@310 | 554 | ap->lastfree->next = 0; |
michael@310 | 555 | return ap; |
michael@310 | 556 | } |
michael@202 | 557 | +#endif |
michael@310 | 558 | |
michael@310 | 559 | static void free_buffers(struct applinfo *ap) |
michael@310 | 560 | { |
michael@310 | 561 | @@ -576,14 +600,17 @@ |
michael@310 | 562 | unsigned MaxSizeB3, |
michael@310 | 563 | unsigned *ApplID) |
michael@310 | 564 | { |
michael@310 | 565 | +#if 0 |
michael@310 | 566 | int applid = 0; |
michael@310 | 567 | char buf[PATH_MAX]; |
michael@310 | 568 | int i, fd = -1; |
michael@310 | 569 | |
michael@310 | 570 | *ApplID = 0; |
michael@310 | 571 | +#endif |
michael@310 | 572 | |
michael@310 | 573 | if (capi20_isinstalled() != CapiNoError) |
michael@310 | 574 | return CapiRegNotInstalled; |
michael@310 | 575 | +#if 0 |
michael@310 | 576 | if ((!remote_capi) || ((remote_capi) && ((fd = open_socket()) < 0))) { |
michael@310 | 577 | if ((fd = open(capidevname, O_RDWR|O_NONBLOCK, 0666)) < 0 && |
michael@310 | 578 | (errno == ENOENT)) { |
michael@310 | 579 | @@ -621,6 +648,8 @@ |
michael@310 | 580 | close(fd); |
michael@310 | 581 | return(errcode); |
michael@310 | 582 | } |
michael@310 | 583 | + } |
michael@310 | 584 | +#if 0 |
michael@310 | 585 | } else if ((applid = ioctl(fd, CAPI_REGISTER, &ioctl_data)) < 0) { |
michael@310 | 586 | if (errno == EIO) { |
michael@310 | 587 | if (ioctl(fd, CAPI_GET_ERRCODE, &ioctl_data) < 0) { |
michael@310 | 588 | @@ -666,6 +695,7 @@ |
michael@310 | 589 | applid = alloc_applid(fd); |
michael@310 | 590 | } // end old driver compatibility |
michael@310 | 591 | } |
michael@310 | 592 | +#endif |
michael@310 | 593 | if (remember_applid(applid, fd) < 0) { |
michael@310 | 594 | close(fd); |
michael@310 | 595 | return CapiRegOSResourceErr; |
michael@310 | 596 | @@ -676,6 +706,7 @@ |
michael@310 | 597 | return CapiRegOSResourceErr; |
michael@310 | 598 | } |
michael@310 | 599 | *ApplID = applid; |
michael@310 | 600 | +#endif |
michael@310 | 601 | return CapiNoError; |
michael@310 | 602 | } |
michael@310 | 603 | |
michael@310 | 604 | @@ -784,11 +815,15 @@ |
michael@310 | 605 | ret = CapiIllAppNr; |
michael@310 | 606 | break; |
michael@310 | 607 | case EIO: |
michael@310 | 608 | +#if 0 |
michael@310 | 609 | if (ioctl(fd, CAPI_GET_ERRCODE, &ioctl_data) < 0) { |
michael@310 | 610 | +#endif |
michael@310 | 611 | ret = CapiMsgOSResourceErr; |
michael@310 | 612 | +#if 0 |
michael@310 | 613 | } else { |
michael@310 | 614 | ret = (unsigned)ioctl_data.errcode; |
michael@310 | 615 | } |
michael@310 | 616 | +#endif |
michael@310 | 617 | break; |
michael@310 | 618 | default: |
michael@310 | 619 | ret = CapiMsgOSResourceErr; |
michael@310 | 620 | @@ -842,7 +877,7 @@ |
michael@310 | 621 | rcvbuf[15] = (data >> 24) & 0xff; |
michael@310 | 622 | } else { |
michael@310 | 623 | u_int64_t data; |
michael@310 | 624 | - ulong radr = (ulong)rcvbuf; |
michael@310 | 625 | + unsigned long radr = (unsigned long)rcvbuf; |
michael@310 | 626 | if (CAPIMSG_LEN(rcvbuf) < 30) { |
michael@310 | 627 | /* |
michael@310 | 628 | * grr, 64bit arch, but no data64 included, |
michael@310 | 629 | @@ -899,6 +934,9 @@ |
michael@310 | 630 | { |
michael@310 | 631 | if (capi20_isinstalled() != CapiNoError) |
michael@310 | 632 | return 0; |
michael@310 | 633 | +#ifndef CAPI_MANUFACTURER_LEN |
michael@310 | 634 | +#define CAPI_MANUFACTURER_LEN 64 |
michael@310 | 635 | +#endif |
michael@310 | 636 | |
michael@310 | 637 | if (remote_capi) { |
michael@310 | 638 | unsigned char buf[100]; |
michael@310 | 639 | @@ -911,15 +949,19 @@ |
michael@310 | 640 | return Buf; |
michael@310 | 641 | } |
michael@310 | 642 | |
michael@310 | 643 | +#if 0 |
michael@310 | 644 | ioctl_data.contr = Ctrl; |
michael@310 | 645 | |
michael@310 | 646 | if (ioctl(capi_fd, CAPI_GET_MANUFACTURER, &ioctl_data) < 0) |
michael@310 | 647 | +#endif |
michael@310 | 648 | return 0; |
michael@310 | 649 | |
michael@310 | 650 | +#if 0 |
michael@310 | 651 | memcpy(Buf, ioctl_data.manufacturer, CAPI_MANUFACTURER_LEN); |
michael@310 | 652 | Buf[CAPI_MANUFACTURER_LEN-1] = 0; |
michael@310 | 653 | |
michael@310 | 654 | return Buf; |
michael@310 | 655 | +#endif |
michael@310 | 656 | } |
michael@310 | 657 | |
michael@310 | 658 | unsigned char * |
michael@310 | 659 | @@ -934,16 +976,20 @@ |
michael@310 | 660 | set_rcapicmd_header(&p, 14, RCAPI_GET_VERSION_REQ, Ctrl); |
michael@310 | 661 | if(!(remote_command(capi_fd, buf, 14, RCAPI_GET_VERSION_CONF))) |
michael@310 | 662 | return 0; |
michael@310 | 663 | - memcpy(Buf, buf + 1, sizeof(capi_version)); |
michael@310 | 664 | + memcpy(Buf, buf + 1, 128 /* sizeof(capi_version) */); |
michael@310 | 665 | return Buf; |
michael@310 | 666 | } |
michael@310 | 667 | |
michael@310 | 668 | +#if 0 |
michael@310 | 669 | ioctl_data.contr = Ctrl; |
michael@310 | 670 | if (ioctl(capi_fd, CAPI_GET_VERSION, &ioctl_data) < 0) { |
michael@310 | 671 | +#endif |
michael@310 | 672 | return 0; |
michael@310 | 673 | +#if 0 |
michael@310 | 674 | } |
michael@310 | 675 | memcpy(Buf, &ioctl_data.version, sizeof(capi_version)); |
michael@310 | 676 | return Buf; |
michael@310 | 677 | +#endif |
michael@310 | 678 | } |
michael@310 | 679 | |
michael@310 | 680 | unsigned char * |
michael@310 | 681 | @@ -952,6 +998,10 @@ |
michael@310 | 682 | if (capi20_isinstalled() != CapiNoError) |
michael@310 | 683 | return 0; |
michael@310 | 684 | |
michael@310 | 685 | +#ifndef CAPI_SERIAL_LEN |
michael@310 | 686 | +#define CAPI_SERIAL_LEN 8 |
michael@202 | 687 | +#endif |
michael@202 | 688 | + |
michael@310 | 689 | if (remote_capi) { |
michael@310 | 690 | unsigned char buf[100]; |
michael@310 | 691 | unsigned char *p = buf; |
michael@310 | 692 | @@ -963,15 +1013,19 @@ |
michael@310 | 693 | return Buf; |
michael@310 | 694 | } |
michael@310 | 695 | |
michael@310 | 696 | +#if 0 |
michael@310 | 697 | ioctl_data.contr = Ctrl; |
michael@310 | 698 | |
michael@310 | 699 | if (ioctl(capi_fd, CAPI_GET_SERIAL, &ioctl_data) < 0) |
michael@202 | 700 | +#endif |
michael@310 | 701 | return 0; |
michael@310 | 702 | |
michael@202 | 703 | +#if 0 |
michael@310 | 704 | memcpy(Buf, &ioctl_data.serial, CAPI_SERIAL_LEN); |
michael@310 | 705 | Buf[CAPI_SERIAL_LEN-1] = 0; |
michael@310 | 706 | |
michael@310 | 707 | return Buf; |
michael@202 | 708 | +#endif |
michael@202 | 709 | } |
michael@202 | 710 | |
michael@310 | 711 | unsigned |
michael@311 | 712 | @@ -1018,6 +1072,7 @@ |
michael@310 | 713 | sizeof(ioctl_data.profile.ncontroller)); |
michael@202 | 714 | } |
michael@310 | 715 | return CapiNoError; |
michael@310 | 716 | +#endif |
michael@310 | 717 | } |
michael@310 | 718 | /* |
michael@310 | 719 | * functions added to the CAPI2.0 spec |
michael@414 | 720 | Index: chan_capi-1.1.5.20120324/libcapi20/convert.c |
michael@414 | 721 | diff -Nau chan_capi-1.1.5.20120324/libcapi20/convert.c.orig chan_capi-1.1.5.20120324/libcapi20/convert.c |
michael@414 | 722 | --- chan_capi-1.1.5.20120324/libcapi20/convert.c.orig 2010-09-14 21:54:25.000000000 +0200 |
michael@414 | 723 | +++ chan_capi-1.1.5.20120324/libcapi20/convert.c 2012-03-18 17:47:07.888451260 +0100 |
michael@310 | 724 | @@ -11,7 +11,14 @@ |
michael@310 | 725 | #include <stddef.h> |
michael@310 | 726 | #include <time.h> |
michael@310 | 727 | #include <ctype.h> |
michael@310 | 728 | +#ifdef __FreeBSD__ |
michael@310 | 729 | +#include <sys/endian.h> |
michael@310 | 730 | +#define bswap_16 bswap16 |
michael@310 | 731 | +#define bswap_32 bswap32 |
michael@310 | 732 | +#define bswap_64 bswap64 |
michael@310 | 733 | +#else |
michael@310 | 734 | #include <byteswap.h> |
michael@310 | 735 | +#endif |
michael@310 | 736 | |
michael@310 | 737 | #include "capi20.h" |
michael@310 | 738 | |
michael@414 | 739 | Index: chan_capi-1.1.5.20120324/Makefile |
michael@414 | 740 | diff -Nau chan_capi-1.1.5.20120324/Makefile.orig chan_capi-1.1.5.20120324/Makefile |
michael@414 | 741 | --- chan_capi-1.1.5.20120324/Makefile.orig 2011-02-04 18:41:46.000000000 +0100 |
michael@414 | 742 | +++ chan_capi-1.1.5.20120324/Makefile 2012-03-18 17:47:07.888451260 +0100 |
michael@362 | 743 | @@ -114,6 +114,9 @@ |
michael@311 | 744 | CFLAGS+=-O2 |
michael@311 | 745 | CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi) |
michael@311 | 746 | CFLAGS+=$(shell if uname -m | grep -q "ppc\|arm\|s390"; then echo "-fsigned-char"; fi) |
michael@311 | 747 | +ifeq (${USE_OWN_LIBCAPI},yes) |
michael@311 | 748 | +CFLAGS+=-DUSE_OWN_LIBCAPI |
michael@311 | 749 | +endif |
michael@311 | 750 | ifeq (${DIVA_STREAMING},1) |
michael@311 | 751 | CFLAGS += -DDIVA_STREAMING=1 |
michael@311 | 752 | endif |
michael@311 | 753 | Index: channels/chan_sip.c |
michael@311 | 754 | diff -Nau channels/chan_sip.c.orig channels/chan_sip.c |
michael@405 | 755 | --- channels/chan_sip.c.orig 2012-02-28 18:53:34.000000000 +0100 |
michael@405 | 756 | +++ channels/chan_sip.c 2012-03-18 17:47:07.898462166 +0100 |
michael@405 | 757 | @@ -12034,7 +12034,16 @@ |
michael@311 | 758 | } else { |
michael@311 | 759 | if (sipmethod == SIP_NOTIFY && !ast_strlen_zero(p->theirtag)) { |
michael@311 | 760 | /* If this is a NOTIFY, use the From: tag in the subscribe (RFC 3265) */ |
michael@311 | 761 | - snprintf(to, sizeof(to), "<%s%s>;tag=%s", (strncasecmp(p->uri, "sip:", 4) ? "sip:" : ""), p->uri, p->theirtag); |
michael@311 | 762 | + if (strncasecmp(p->uri, "sip:", strlen("sip:"))) |
michael@311 | 763 | + if (strncasecmp(p->uri, "sips:", strlen("sips:"))) |
michael@311 | 764 | + if (p->socket.type == SIP_TRANSPORT_TLS) |
michael@311 | 765 | + snprintf(to, sizeof(to), "<%s%s>;tag=%s", "sips:", p->uri, p->theirtag); |
michael@311 | 766 | + else |
michael@311 | 767 | + snprintf(to, sizeof(to), "<%s%s>;tag=%s", "sips:", p->uri, p->theirtag); |
michael@311 | 768 | + else /* if (strncasecmp(p->uri, "sips:"... */ |
michael@311 | 769 | + snprintf(to, sizeof(to), "<%s%s>;tag=%s", "", p->uri, p->theirtag); |
michael@311 | 770 | + else /* if (strncasecmp(p->uri, "sip:"... */ |
michael@311 | 771 | + snprintf(to, sizeof(to), "<%s%s>;tag=%s", "", p->uri, p->theirtag); |
michael@311 | 772 | } else if (p->options && p->options->vxml_url) { |
michael@311 | 773 | /* If there is a VXML URL append it to the SIP URL */ |
michael@311 | 774 | snprintf(to, sizeof(to), "<%s>;%s", p->uri, p->options->vxml_url); |
michael@310 | 775 | Index: channels/console_video.h |
michael@311 | 776 | diff -Nau channels/console_video.h.orig channels/console_video.h |
michael@310 | 777 | --- channels/console_video.h.orig 2008-06-30 17:45:15.000000000 +0200 |
michael@405 | 778 | +++ channels/console_video.h 2012-03-18 17:47:07.898462166 +0100 |
michael@310 | 779 | @@ -28,10 +28,7 @@ |
michael@310 | 780 | "console {device}" |
michael@310 | 781 | #else |
michael@310 | 782 | |
michael@310 | 783 | -#include <ffmpeg/avcodec.h> |
michael@310 | 784 | -#ifndef OLD_FFMPEG |
michael@310 | 785 | -#include <ffmpeg/swscale.h> /* requires a recent ffmpeg */ |
michael@310 | 786 | -#endif |
michael@310 | 787 | +#include <libavcoded/avcodec.h> |
michael@310 | 788 | |
michael@310 | 789 | #define CONSOLE_VIDEO_CMDS \ |
michael@310 | 790 | "console {videodevice|videocodec" \ |
michael@310 | 791 | Index: configure |
michael@311 | 792 | diff -Nau configure.orig configure |
michael@405 | 793 | --- configure.orig 2012-01-14 17:40:17.000000000 +0100 |
michael@405 | 794 | +++ configure 2012-03-18 17:47:32.518450837 +0100 |
michael@405 | 795 | @@ -4716,11 +4716,6 @@ |
michael@311 | 796 | esac |
michael@310 | 797 | |
michael@310 | 798 | case "${host_os}" in |
michael@310 | 799 | - freebsd*) |
michael@347 | 800 | - ac_default_prefix=/usr/local |
michael@310 | 801 | - CPPFLAGS=-I/usr/local/include |
michael@310 | 802 | - LDFLAGS=-L/usr/local/lib |
michael@310 | 803 | - ;; |
michael@310 | 804 | openbsd*) |
michael@347 | 805 | ac_default_prefix=/usr/local |
michael@310 | 806 | if test ${prefix} = '/usr/local' || test ${prefix} = 'NONE'; then |
michael@405 | 807 | @@ -18904,8 +18899,8 @@ |
michael@311 | 808 | if test -f "${IMAP_TK_DIR}/c-client/LDFLAGS"; then |
michael@311 | 809 | imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS` |
michael@311 | 810 | fi |
michael@311 | 811 | - imap_libs="${IMAP_TK_DIR}/c-client/c-client.a" |
michael@311 | 812 | - imap_include="-I${IMAP_TK_DIR}/c-client" |
michael@311 | 813 | + imap_libs="-limap -lssl -lcrypto -lcrypt" |
michael@311 | 814 | + imap_include="-DUSE_SYSTEM_IMAP -I${IMAP_TK_DIR}/include/imap" |
michael@311 | 815 | CPPFLAGS="${CPPFLAGS} ${imap_include}" |
michael@311 | 816 | LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}` |
michael@405 | 817 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
michael@405 | 818 | @@ -26681,7 +26676,7 @@ |
michael@311 | 819 | pbxlibdir="-L${SQLITE_DIR}" |
michael@311 | 820 | fi |
michael@311 | 821 | fi |
michael@311 | 822 | - pbxfuncname="sqlite_exec" |
michael@311 | 823 | + pbxfuncname="sqlite3_exec" |
michael@311 | 824 | if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers |
michael@311 | 825 | AST_SQLITE_FOUND=yes |
michael@311 | 826 | else |
michael@311 | 827 | Index: formats/format_pcm.c |
michael@311 | 828 | diff -Nau formats/format_pcm.c.orig formats/format_pcm.c |
michael@362 | 829 | --- formats/format_pcm.c.orig 2011-07-14 22:13:06.000000000 +0200 |
michael@405 | 830 | +++ formats/format_pcm.c 2012-03-18 17:47:07.898462166 +0100 |
michael@362 | 831 | @@ -354,6 +354,7 @@ |
michael@311 | 832 | ast_log(LOG_WARNING, "Unable to write header\n"); |
michael@311 | 833 | return -1; |
michael@311 | 834 | } |
michael@311 | 835 | + fflush(f); /* issues.asterisk.org bug 0016610 */ |
michael@311 | 836 | return 0; |
michael@311 | 837 | } |
michael@311 | 838 | |
michael@311 | 839 | Index: formats/format_wav.c |
michael@311 | 840 | diff -Nau formats/format_wav.c.orig formats/format_wav.c |
michael@405 | 841 | --- formats/format_wav.c.orig 2011-11-09 16:25:33.000000000 +0100 |
michael@405 | 842 | +++ formats/format_wav.c 2012-03-18 17:47:07.898462166 +0100 |
michael@362 | 843 | @@ -308,6 +308,7 @@ |
michael@311 | 844 | ast_log(LOG_WARNING, "Unable to write header\n"); |
michael@311 | 845 | return -1; |
michael@311 | 846 | } |
michael@311 | 847 | + fflush(f); /* issues.asterisk.org bug 0016610 */ |
michael@311 | 848 | return 0; |
michael@311 | 849 | } |
michael@311 | 850 | |
michael@311 | 851 | Index: formats/format_wav_gsm.c |
michael@311 | 852 | diff -Nau formats/format_wav_gsm.c.orig formats/format_wav_gsm.c |
michael@362 | 853 | --- formats/format_wav_gsm.c.orig 2011-07-14 22:13:06.000000000 +0200 |
michael@405 | 854 | +++ formats/format_wav_gsm.c 2012-03-18 17:47:07.898462166 +0100 |
michael@362 | 855 | @@ -366,6 +366,7 @@ |
michael@311 | 856 | ast_log(LOG_WARNING, "Unable to write header\n"); |
michael@311 | 857 | return -1; |
michael@311 | 858 | } |
michael@311 | 859 | + fflush(f); /* issues.asterisk.org bug 0016610 */ |
michael@311 | 860 | return 0; |
michael@311 | 861 | } |
michael@311 | 862 | |
michael@311 | 863 | Index: main/db1-ast/hash/hash.h |
michael@311 | 864 | diff -Nau main/db1-ast/hash/hash.h.orig main/db1-ast/hash/hash.h |
michael@311 | 865 | --- main/db1-ast/hash/hash.h.orig 2006-08-21 04:11:39.000000000 +0200 |
michael@405 | 866 | +++ main/db1-ast/hash/hash.h 2012-03-18 17:47:07.898462166 +0100 |
michael@311 | 867 | @@ -36,6 +36,8 @@ |
michael@311 | 868 | * @(#)hash.h 8.3 (Berkeley) 5/31/94 |
michael@311 | 869 | */ |
michael@311 | 870 | |
michael@311 | 871 | +#include <stdint.h> |
michael@311 | 872 | + |
michael@311 | 873 | /* Operations */ |
michael@311 | 874 | typedef enum { |
michael@311 | 875 | HASH_GET, HASH_PUT, HASH_PUTNEW, HASH_DELETE, HASH_FIRST, HASH_NEXT |
michael@311 | 876 | Index: main/db1-ast/hash/ndbm.c |
michael@311 | 877 | diff -Nau main/db1-ast/hash/ndbm.c.orig main/db1-ast/hash/ndbm.c |
michael@311 | 878 | --- main/db1-ast/hash/ndbm.c.orig 2006-08-21 04:11:39.000000000 +0200 |
michael@405 | 879 | +++ main/db1-ast/hash/ndbm.c 2012-03-18 17:47:07.898462166 +0100 |
michael@311 | 880 | @@ -49,7 +49,8 @@ |
michael@311 | 881 | #include <string.h> |
michael@311 | 882 | #include <stdlib.h> |
michael@311 | 883 | |
michael@311 | 884 | -#include <ndbm.h> |
michael@311 | 885 | +#include "../include/ndbm.h" |
michael@311 | 886 | +#include "../include/db.h" |
michael@311 | 887 | #include "hash.h" |
michael@311 | 888 | |
michael@311 | 889 | /* |
michael@311 | 890 | Index: main/features.c |
michael@311 | 891 | diff -Nau main/features.c.orig main/features.c |
michael@405 | 892 | --- main/features.c.orig 2012-01-23 21:30:21.000000000 +0100 |
michael@405 | 893 | +++ main/features.c 2012-03-18 17:47:07.898462166 +0100 |
michael@405 | 894 | @@ -2067,6 +2067,10 @@ |
michael@311 | 895 | snprintf(args, len, "%s,%s,m", S_OR(touch_format, "wav"), touch_filename); |
michael@311 | 896 | } |
michael@311 | 897 | |
michael@311 | 898 | + for(x = 0; x < strlen(touch_filename); x++) { |
michael@311 | 899 | + if (args[x] == '/') |
michael@311 | 900 | + args[x] = '-'; |
michael@311 | 901 | + } |
michael@311 | 902 | for(x = 0; x < strlen(args); x++) { |
michael@311 | 903 | if (args[x] == '/') |
michael@311 | 904 | args[x] = '-'; |
michael@405 | 905 | @@ -2183,6 +2187,10 @@ |
michael@311 | 906 | snprintf(args, len, "%s.%s,b", touch_filename, S_OR(touch_format, "wav")); |
michael@311 | 907 | } |
michael@311 | 908 | |
michael@311 | 909 | + for( x = 0; x < strlen(touch_filename); x++) { |
michael@311 | 910 | + if (args[x] == '/') |
michael@311 | 911 | + args[x] = '-'; |
michael@311 | 912 | + } |
michael@311 | 913 | for( x = 0; x < strlen(args); x++) { |
michael@311 | 914 | if (args[x] == '/') |
michael@311 | 915 | args[x] = '-'; |
michael@311 | 916 | Index: main/file.c |
michael@311 | 917 | diff -Nau main/file.c.orig main/file.c |
michael@405 | 918 | --- main/file.c.orig 2012-01-05 23:06:46.000000000 +0100 |
michael@405 | 919 | +++ main/file.c 2012-03-18 17:47:07.898462166 +0100 |
michael@362 | 920 | @@ -256,7 +256,7 @@ |
michael@311 | 921 | char *fn = NULL; |
michael@311 | 922 | |
michael@311 | 923 | if (!strcmp(ext, "wav49")) |
michael@311 | 924 | - ext = "WAV"; |
michael@311 | 925 | + ext = "wav"; |
michael@311 | 926 | |
michael@311 | 927 | if (filename[0] == '/') { |
michael@311 | 928 | if (asprintf(&fn, "%s.%s", filename, ext) < 0) { |
michael@310 | 929 | Index: main/Makefile |
michael@311 | 930 | diff -Nau main/Makefile.orig main/Makefile |
michael@405 | 931 | --- main/Makefile.orig 2011-09-19 22:27:03.000000000 +0200 |
michael@405 | 932 | +++ main/Makefile 2012-03-18 17:47:07.898462166 +0100 |
michael@311 | 933 | @@ -69,10 +69,7 @@ |
michael@310 | 934 | endif |
michael@310 | 935 | |
michael@310 | 936 | ifeq ($(OSARCH),FreeBSD) |
michael@310 | 937 | - # -V is understood by BSD Make, not by GNU make. |
michael@310 | 938 | - BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) |
michael@310 | 939 | - AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi) |
michael@310 | 940 | - AST_LIBS+=-lcrypto |
michael@310 | 941 | + AST_LIBS+=-lpthread -lcrypto |
michael@310 | 942 | endif |
michael@310 | 943 | |
michael@310 | 944 | ifneq ($(findstring $(OSARCH), mingw32 cygwin ),) |
michael@310 | 945 | Index: main/tcptls.c |
michael@311 | 946 | diff -Nau main/tcptls.c.orig main/tcptls.c |
michael@405 | 947 | --- main/tcptls.c.orig 2011-11-30 22:41:31.000000000 +0100 |
michael@405 | 948 | +++ main/tcptls.c 2012-03-18 17:47:07.898462166 +0100 |
michael@405 | 949 | @@ -372,6 +372,7 @@ |
michael@310 | 950 | if (!ast_strlen_zero(cfg->cafile) || !ast_strlen_zero(cfg->capath)) { |
michael@310 | 951 | if (SSL_CTX_load_verify_locations(cfg->ssl_ctx, S_OR(cfg->cafile, NULL), S_OR(cfg->capath,NULL)) == 0) |
michael@310 | 952 | ast_verb(0, "SSL CA file(%s)/path(%s) error\n", cfg->cafile, cfg->capath); |
michael@310 | 953 | + SSL_CTX_set_client_CA_list(cfg->ssl_ctx, S_OR(cfg->cafile, NULL)); |
michael@202 | 954 | } |
michael@202 | 955 | |
michael@310 | 956 | ast_verb(0, "SSL certificate ok\n"); |
michael@311 | 957 | Index: main/udptl.c |
michael@311 | 958 | diff -Nau main/udptl.c.orig main/udptl.c |
michael@405 | 959 | --- main/udptl.c.orig 2011-10-06 19:49:38.000000000 +0200 |
michael@405 | 960 | +++ main/udptl.c 2012-03-18 17:47:07.898462166 +0100 |
michael@311 | 961 | @@ -98,6 +98,18 @@ |
michael@311 | 962 | |
michael@311 | 963 | #define UDPTL_BUF_MASK 15 |
michael@311 | 964 | |
michael@311 | 965 | +/*! Copied from chan_oss.c, corrects link errors: |
michael@311 | 966 | +udptl.o: In function `calculate_local_max_datagram': |
michael@311 | 967 | +main/udptl.c:740: undefined reference to `MIN' |
michael@311 | 968 | +udptl.o: In function `calculate_far_max_ifp': |
michael@311 | 969 | +main/udptl.c:770: undefined reference to `MAX' */ |
michael@311 | 970 | +#ifndef MIN |
michael@311 | 971 | +#define MIN(a,b) ((a) < (b) ? (a) : (b)) |
michael@311 | 972 | +#endif |
michael@311 | 973 | +#ifndef MAX |
michael@311 | 974 | +#define MAX(a,b) ((a) > (b) ? (a) : (b)) |
michael@311 | 975 | +#endif |
michael@311 | 976 | + |
michael@311 | 977 | typedef struct { |
michael@311 | 978 | int buf_len; |
michael@311 | 979 | uint8_t buf[LOCAL_FAX_MAX_DATAGRAM]; |
michael@311 | 980 | Index: Makefile |
michael@311 | 981 | diff -Nau Makefile.orig Makefile |
michael@405 | 982 | --- Makefile.orig 2011-10-05 00:54:15.000000000 +0200 |
michael@405 | 983 | +++ Makefile 2012-03-18 17:47:07.898462166 +0100 |
michael@311 | 984 | @@ -230,15 +230,6 @@ |
michael@311 | 985 | _ASTCFLAGS+=-fsigned-char |
michael@311 | 986 | endif |
michael@311 | 987 | |
michael@311 | 988 | -ifeq ($(OSARCH),FreeBSD) |
michael@311 | 989 | - ifeq ($(PROC),i386) |
michael@311 | 990 | - _ASTCFLAGS+=-march=i686 |
michael@311 | 991 | - endif |
michael@311 | 992 | - # -V is understood by BSD Make, not by GNU make. |
michael@311 | 993 | - BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) |
michael@311 | 994 | - _ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi) |
michael@311 | 995 | -endif |
michael@311 | 996 | - |
michael@311 | 997 | ifeq ($(OSARCH),NetBSD) |
michael@311 | 998 | _ASTCFLAGS+=-pthread -I/usr/pkg/include |
michael@311 | 999 | endif |