Skip to content

Instantly share code, notes, and snippets.

View leedm777's full-sized avatar

David M. Lee leedm777

View GitHub Profile
Index: include/asterisk/http_websocket.h
===================================================================
--- include/asterisk/http_websocket.h (revision 393739)
+++ include/asterisk/http_websocket.h (working copy)
@@ -22,6 +22,8 @@
#include "asterisk/http.h"
#include "asterisk/optional_api.h"
+#include <errno.h>
+
Index: main/manager_bridging.c
===================================================================
--- main/manager_bridging.c (revision 391667)
+++ main/manager_bridging.c (working copy)
@@ -108,6 +108,11 @@
</manager>
***/
+/*! \brief The \ref stasis subscription returned by the forwarding of the channel topic
+ * to the manager topic
@leedm777
leedm777 / swagger-type-variance.md
Last active December 13, 2021 08:19
Type variance in Swagger models

This document describes how to extend Swagger data models to allow the types of fields to vary.

Given that Swagger models need to map cleanly to a statically typed object model, a subclassing approach seems like it would be a good fit.

Inheritance

Inheritance allows a model (the derived type) to inherit all of the

@leedm777
leedm777 / hello-rest.py
Created May 30, 2013 20:18
Hello, RESTful Asterisk API
#!/usr/bin/env python
#
# Hello, REST API!
#
# Requires requests and websocket-client (which may be installed via pip)
#
# You need something in the dialplan to send a channel to the app.
#
# exten => 7000,1,Stasis(hello)
This is an attempt to fix some linking problems compiling Digium's fork of PJSIP on OS X.
diff --git a/build/rules.mak b/build/rules.mak
index dc74f52..d5006c7 100644
--- a/build/rules.mak
+++ b/build/rules.mak
@@ -14,6 +14,8 @@ SONAME = $($(APP)_SONAME)
ifeq ($(SHLIB_SUFFIX),so)
SHLIB_OPT := -shared -Wl,-soname,$(SONAME)
@leedm777
leedm777 / my-configure.sh
Created March 21, 2013 17:33
My wrapper for Asterisk's configure script
#!/bin/bash
TOPDIR=.
if test $1 && test -d $1; then
TOPDIR=$1
shift
fi
TOPDIR=$(cd ${TOPDIR} && pwd)
@leedm777
leedm777 / app_hello.c
Created October 22, 2012 11:53
Asterisk's simplest application
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2012, Digium, Inc.
*
* David M. Lee, II <[email protected]>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
@leedm777
leedm777 / res_hello.c
Created October 19, 2012 18:07
Asterisk's simplest module
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2012, Digium, Inc.
*
* David M. Lee, II <[email protected]>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
@leedm777
leedm777 / imafunction.scala
Created September 13, 2012 19:36
Object can be functions in Scala
scala> object ImaFunction {
| def apply() { println("I am a function") }
| }
defined module ImaFunction
scala> case class Sois(name: String) {
| def apply() { printf("%s is also a function", name) }
| }
defined class Sois
@leedm777
leedm777 / callback-insanity.js
Created August 2, 2012 02:01
Insanity of callbacks
getSomething(function(thing) {
doSomethingWithIt(thing, function(somethingElse) {
evenSomethingElse(somethingElse, function(inTooDeep) {
// result A
})
})
doSomethingElseWithIt(thing, function(somethingElse) {
// result B
})
whenBothAreDone(thing, A, B) // magic!