#define get_volfactor(x) x ? ((x > 0) ? (1 << x) : ((1 << abs(x)) * -1)) : 0
#define minmax(x,y) x ? (x > y) ? y : ((x < (y * -1)) ? (y * -1) : x) : 0
-AST_MUTEX_DEFINE_STATIC(modlock);
-
static char *tdesc = "Native Channel Monitoring Module";
static char *app = "MuxMon";
static char *synopsis = "Record A Call Natively";
{
char *op, *chan_name = NULL, *args = NULL;
struct ast_channel *chan;
- int count = 0;
if (argc > 2) {
op = argv[1];
#define get_volfactor(x) x ? ((x > 0) ? (1 << x) : ((1 << abs(x)) * -1)) : 0
#define minmax(x,y) x ? (x > y) ? y : ((x < (y * -1)) ? (y * -1) : x) : 0
-AST_MUTEX_DEFINE_STATIC(modlock);
-
static char *tdesc = "Native Channel Monitoring Module";
static char *app = "MuxMon";
static char *synopsis = "Record A Call Natively";
{
char *op, *chan_name = NULL, *args = NULL;
struct ast_channel *chan;
- int count = 0;
if (argc > 2) {
op = argv[1];
struct ast_filestream *ast_writefile(const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode)
{
int fd, myflags = 0;
- FILE *bfile;
+ /* compiler claims this variable can be used before initialization... */
+ FILE *bfile = NULL;
struct ast_format *f;
struct ast_filestream *fs = NULL;
char *fn, *orig_fn = NULL;
}
}
- if (option_cache_record_files && fd >= 0) {
+ if (option_cache_record_files && (fd > -1)) {
char *c;
fclose(bfile);
size = strlen(fn) + strlen(record_cache_dir) + 2;
buf = alloca(size);
- memset(buf, 0, size);
- snprintf(buf, size, "%s/%s", record_cache_dir, fn);
+ strcpy(buf, record_cache_dir);
+ strcat(buf, "/");
+ strcat(buf, fn);
free(fn);
fn = buf;
fd = open(fn, flags | myflags, mode);
}
}
}
- if (fd >= 0) {
+ if (fd > -1) {
errno = 0;
-
if ((fs = f->rewrite(bfile, comment))) {
fs->trans = NULL;
fs->fmt = f;