Skip to content

Instantly share code, notes, and snippets.

View leedm777's full-sized avatar

David M. Lee leedm777

View GitHub Profile
Wed Feb 12 13:44:23 CST 2014 David M. Lee <dlee@digium.com>
* sip-application-type
Pass along the application field from the call_control module to the
prepaid rating engine.
diff -rN -u old-callcontrol/callcontrol/rating.py new-callcontrol/callcontrol/rating.py
--- old-callcontrol/callcontrol/rating.py 2014-02-12 13:47:09.000000000 -0600
+++ new-callcontrol/callcontrol/rating.py 2014-02-12 13:47:09.000000000 -0600
@@ -288,7 +288,8 @@
commit 3e47feac838d9c4498d03681a80a9f3f292fc4be
Author: David M. Lee <dlee@digium.com>
Date: Mon Feb 10 15:22:11 2014 -0600
call_control: Passthrough sip_application
Current patches being submitted to CDRTool and the call_control daemon
allow for SIP application type to be specified. This allows audio or
video services to be rated differently, or even different ratings for
application subtypes (audio.inbound vs. audio.outbound).
Index: configure.ac
===================================================================
--- configure.ac (revision 428631)
+++ configure.ac (working copy)
@@ -657,8 +657,26 @@
AC_FUNC_STRTOD
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob htonll ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap ntohll newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv utime vasprintf getpeereid sysctl swapctl])
+AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecm
@leedm777
leedm777 / asterisk-ws-slam.js
Created February 18, 2015 22:06
Slam asterisk with large frames over the websocket
/*
* - must be run on a different machine than the one that runs Asterisk
* - npm instal ws
* - change <asterisk-host> to the IP/hostname of the Asterisk box
* - node asterisk-ws-slam.js
*/
var WebSocket = require('ws');
var ws = new WebSocket('ws://<asterisk-host>:8088/ws', { protocol: 'echo' });
var str = new Array(16384 - 10).join('x');
@leedm777
leedm777 / http-cls-ugly.js
Created March 17, 2015 21:04
Really ugly code to test whether a namespace is maintained in http callbacks
var http = require('http');
var cls = require('continuation-local-storage');
var ns = cls.createNamespace('test');
// Really ugly code to test whether a namespace is maintained in http callbacks
function testURL(url) {
ns.run(function () {
var request = require('http');
ns.set('url', url);
@leedm777
leedm777 / git-krenim.sh
Last active August 29, 2015 14:20
Erases a file from the history of the current branch
#!/bin/sh
#
# Removes a file from git history of the current branch
#
PROGNAME=$(basename $0)
REMOVE=$1
@leedm777
leedm777 / -
Last active September 1, 2015 21:41
commit 793757a680ed1c817319e6b6271ae22326e5a653
Author: David M. Lee <dlee@respoke.io>
Date: Tue Sep 1 16:31:00 2015 -0500
TURN decoders
Adds decoders for DTLS, RTP and TFTP to further decode the protocols
under it. Patch from creslin@digium.com.
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
commit 4619cb09a91249b20c207e67587165ce99349883
Author: David M. Lee <dlee@respoke.io>
Date: Tue Sep 1 16:31:00 2015 -0500
TURN decoders
Adds decoders for DTLS, RTP and TFTP to further decode the protocols
under it. Patch from creslin@digium.com.
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
/** Cute little function to take a random sample of a sequence. */
def randomSample(s:Seq[_]) = s filter { _ => util.Random.nextBoolean }
@leedm777
leedm777 / mcpp-fix-stpcpy.patch
Created November 8, 2010 21:57
Homebrew patch. Fixes MCPP compilation on Mac.
stpcpy is a #define on Mac OS X. Trying to define it as an extern is invalid.
diff -ur mcpp-2.7.2-orig/src/internal.H mcpp-2.7.2/src/internal.H
--- mcpp-2.7.2-orig/src/internal.H 2008-08-27 08:01:16.000000000 -0500
+++ mcpp-2.7.2/src/internal.H 2010-11-08 15:53:38.000000000 -0600
@@ -557,6 +557,6 @@
#endif
#endif
-#if HOST_HAVE_STPCPY