Skip to content

Instantly share code, notes, and snippets.

View damienstanton's full-sized avatar

Damien Stanton damienstanton

View GitHub Profile
@damienstanton
damienstanton / output2.conf
Created January 5, 2015 13:51
queue_state-queue_join-queue_leave
freepbx-a*CLI> queue show 670029
670029 has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 60s
Members:
SIP/93651@hqcm02 (Local/93651@from-queue/n from Local/93651@from-queue/n) (ringinuse disabled) (dynamic) (paused) (Not in use) has taken no calls yet
SIP/93533@hqcm02 (Local/93533@from-queue/n from Local/93533@from-queue/n) (ringinuse disabled) (dynamic) (paused) (Not in use) has taken no calls yet
No Callers
-- Called 25@queuemetrics/n
-- Executing [25@queuemetrics:1] Answer("Local/25@queuemetrics-00000066;2", "") in new stack
-- Local/25@queuemetrics-00000066;1 answered
#!/usr/bin/env php
<?php
$restrict_mods = array('backup' => true, 'core' => true);
$bootstrap_settings['cdrdb'] = true;
$bootstrap_settings['freepbx_auth'] = false;
if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) {
include_once('/etc/asterisk/freepbx.conf');
}
//ensure the backup modules is avalible before continuing
@damienstanton
damienstanton / monad.scala
Last active August 29, 2015 14:12
Learning Monads
// General monadic pattern
trait Monad[A] {
def map[B](f: A => B): Monad[B]
def flatMap[B](f: A => Monad[B]): Monad[B]
}
// Option Monad
sealed trait Option[A] {
def map[B](f: A => B): Option[B]
def flatMap[B](f: A => Option[B]): Option[B]
./extensions_additional.conf:exten => recq,n,Set(MONITOR_FILENAME=${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME})
./extensions_additional.conf:exten => recq,n,MixMonitor(${MONITOR_FILENAME}.${MON_FMT},${MONITOR_OPTIONS},${MIXMON_POST})
../spool/transfers/extensions_additional.conf:exten => 400,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})
../spool/transfers/extensions_additional.conf:exten => 401,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})
../spool/transfers/extensions_additional.conf:exten => 5000,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})
../spool/transfers/extensions_additional.conf:exten => 5001,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})
../spool/transfers/extensions_additional.conf:exten => 5002,n,Set(MONITOR_FILENAME=/var/spool/asteri
ari = require("ari-client")
util = require("util")
ari.connect("http://10.11.220.37", "asterisk", "Br!dg3", clientLoaded)
clientLoaded = (err, client) ->
if err
throw err
# -------------
@damienstanton
damienstanton / ide.sh
Last active August 29, 2015 14:13
Personal IDE Notes
# Pathogen
https://github.com/tpope/vim-pathogen.git
# Vim Plugins
https://github.com/klen/python-mode.git
https://github.com/derekwyatt/vim-scala.git
https://github.com/jiangmiao/auto-pairs.git
https://github.com/kchmck/vim-coffee-script.git
https://github.com/scrooloose/nerdtree.git
https://github.com/bling/vim-airline.git
https://github.com/altercation/vim-colors-solarized.git
@damienstanton
damienstanton / panda.html
Created January 28, 2015 14:37
slack integration test
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery.getJSON demo</title>
<style>
img {
height: 100px;
float: left;
}
</style>
www/html/admin/assets/timeconditions/js/timeconditions.js: var msgInvalidTimeGroup = "You have not selected a time group to associate with this timecondition. It will go to the un-matching destination until you update it with a valid group";
www/html/admin/assets/timeconditions/js/timeconditions.js: return confirm(msgInvalidTimeGroup);
www/html/admin/modules/core/functions.inc.php: if (function_exists('timeconditions_timegroups_get_times') && $route['time_group_id'] !== null) {
www/html/admin/modules/core/functions.inc.php: $times = timeconditions_timegroups_get_times($route['time_group_id'],true);
www/html/admin/modules/core/functions.inc.php:function core_timegroups_usage($group_id) {
www/html/admin/modules/core/page.routing.php:<?php if (function_exists('timeconditions_timegroups_drawgroupselect')) { ?>
www/html/admin/modules/core/page.routing.php: <td><?php echo timeconditions_timegroups_drawgroupselect('time_group_id', $time_group_id, true, '', _('---Permanent Route---')); ?></td>
www/html/admin
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-64.el6_5.2)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
[New Thread 12732]
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-64.el6_5.2)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
[New Thread 1815]