Skip to content

Instantly share code, notes, and snippets.

View leedm777's full-sized avatar

David M. Lee leedm777

View GitHub Profile
@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 / 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');
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
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).
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 @@
@leedm777
leedm777 / cdrtool-application-suptypes.patch
Last active January 4, 2016 06:59
Patch adding application subtypes for CDRTool
Wed Feb 12 12:33:04 CST 2014 David M. Lee <dlee@digium.com>
* application-suptypes
This patch adds the concept of 'subtypes' for applications.
When a CDR is recorded, it's Sip-Application-Type may contain a subtype
(for example, audio.incoming).
When the rating engine looks for a matching billing rate, it will match
on the full application.subtype. This allows billing rates to be more
specific, for example recording different rates for incoming traffic
Index: aconfigure
===================================================================
--- aconfigure (revision 4699)
+++ aconfigure (working copy)
@@ -650,6 +650,8 @@
ac_pa_cflags
ac_external_pa
ac_pjmedia_snd
+ac_pjmedia_resample
+ac_external_srtp
@leedm777
leedm777 / wscat.py
Created October 15, 2013 16:42
Simple command line WebSocket client.
#!/usr/bin/env python
#
# Simple command line WebSocket client.
#
import argparse
import json
import os
import socket
@leedm777
leedm777 / communities.yaml
Last active December 25, 2015 06:49
Global list of diverse communities. See https://github.com/leedm777/diversity
# Global listing of available communities
version: 1
communities:
asterisk:
summary: "Broader community of Asterisk applications"
source: /opt/repos/ast-diversity
maintainers: [ dlee@digium.com, asteriskteam@digium.com ]
submissions: pull-request
Index: main/sorcery.c
===================================================================
--- main/sorcery.c (revision 395971)
+++ main/sorcery.c (working copy)
@@ -585,7 +585,7 @@
object_type->type.name = object_type->name;
object_type->type.type = ACO_ITEM;
- object_type->type.category = "";
+ object_type->type.category = ".?";