Skip to content

Instantly share code, notes, and snippets.

View joshelson's full-sized avatar

Joshua Elson joshelson

View GitHub Profile
#!KAMAILIO
# Copyright (c) 2007-2010 by 4PSA, Inc
# All rights reserved
# This file is used to define the interaction between Kamailio and VoipNow
# DO NOT MAKE ANY CHANGES TO THIS FILE!
# ------------------------------------------ global configuration parameters -----------------------
debug=-1 # debug level (cmd line: -dddddddddd)
### Keybase proof
I hereby claim:
* I am joshelson on github.
* I am joshelson (https://keybase.io/joshelson) on keybase.
* I have a public key ASDNxvao3JDENSLrWmnNaaR5EgYp-tnH-5oJVBSZVDJceAo
To claim this, I am signing this object:
@joshelson
joshelson / pbx_spool.c.patch
Created November 28, 2016 04:50
Patch for OUTGOING_RETRY in Asterisk
--- pbx_spool.orig.c 2016-11-09 03:21:38.017426604 +0300
+++ pbx_spool.patched.c 2016-11-11 03:45:55.484474036 +0300
@@ -298,6 +298,23 @@
ast_log(LOG_WARNING, "At least one of app or extension must be specified, along with tech and dest in file %s\n", o->fn);
return -1;
}
+ char* r;
+ if (asprintf(&r, "%d", o->retries + 1) >= 0) {
+ var = ast_variable_new("OUTGOING_RETRY", r, o->fn);
+ if (var) {
@joshelson
joshelson / logger.js
Last active August 29, 2017 07:51 — forked from rtgibbons/logger.js
Logger Library with winston
var app = require(process.cwd() + '/app');
var winston = require('winston');
var _ = require('lodash');
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'green',
warn: 'yellow',
@joshelson
joshelson / logger.js
Last active May 24, 2016 02:00 — forked from prantlf/logger.js
Logger Library with winston - Fixed for additional log arguments
var app = require(process.cwd() + '/app');
var winston = require('winston');
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'green',
warn: 'yellow',
crit: 'red',
@joshelson
joshelson / percona-xtrabackup.sh
Last active September 1, 2015 03:23 — forked from jaygooby/percona-xtrabackup.sh
Call via crontab on whatever schedule suits you; keep n full mysql Percona xtrabackups of your mysql database, with binary logs applied. Also does a full mysqldump that can then have the binary logs applied to restore to a point-in-time backup via the binlogs. Copy all of this (backup, mysqldump, binlogs) to S3.
#!/bin/bash
#
# Carries out a full mysqldump, calls percona-xtrabackup and then
# copies the sql dump, the percona backup and your mysql bin logs
# to S3 using s3cmd http://s3tools.org/s3cmd
#
# TODO: extract out the S3 backup stuff to make it optional, and so
# other s3 programs can replace the s3cmd call.
# TODO: the if [ $? == 0 ] alert blocks should be a function
# TODO: make the if [ $? == 0 ] if [ $? != 0 ] more consistent - test