Skip to content

Instantly share code, notes, and snippets.

View leedm777's full-sized avatar

David M. Lee leedm777

View GitHub Profile
@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)
@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

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
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/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 = ".?";
@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
@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
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 / 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
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 @@