Skip to content

Instantly share code, notes, and snippets.

View jfinstrom's full-sized avatar
💭
making stuff

James Finstrom jfinstrom

💭
making stuff
View GitHub Profile
@jfinstrom
jfinstrom / README.MD
Last active August 2, 2021 20:32
FreePBX Functions and Methods

FreePBX Development tip.

It is almost always prefered to use internal functions and methods when interacting with FreePBX. This is made dificult when you don't know what those functions are. Reading the code can be tedious at times. Here is a flow to help you figure out internals.

Standard disclaimer and shameless plug.

This is provided as information only. This is a personal thing and is not supported by my employer. FreePBX is a trademark of Sangoma who also does not endorse or support this doc. While this is not an official project my employment does allow me to feed my family while giving back. Feel free to check out https://clearlyip.com . Buying from them feeds and shelters me and my offspring :)

Finding Methods for a module:

@jfinstrom
jfinstrom / ipbanimport.php
Last active August 24, 2020 21:17
ipban.org with freepbx firewall **(Untested)**
#!/usr/bin/env php
<?php
$restrict_mods = array('firewall' => true);
$bootstrap_settings['freepbx_auth'] = false;
include '/etc/freepbx.conf';
$freepbx = FreePBX::Create();
$firewall = $freepbx->Firewall;
define('API_KEY', '');
[options]
runuser = asterisk ; The user to run as. The default is root.
rungroup = asterisk ; The group to run as. The default is root
[directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
@jfinstrom
jfinstrom / arithing.js
Last active May 20, 2020 23:12
ari thing
/*
* Copyright © 2019 James Finstrom <code@g3p0.xyz>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*
* npm install ari-client
* npm install request
* Asterisk Dialplan
* Copied From: https://wiki.asterisk.org/wiki/display/AST/Getting+Started+with+ARI
@jfinstrom
jfinstrom / configuration.h
Created April 13, 2019 16:07
th3d configurations
/**
* ************** How to use this firmware - READ THIS, yes actually read this. *********************************
*
* Uncomment means removing the 2 // in front of #define.
*
* FLASHING NOTES:
* ALL slicers (Simplify3D, Cura, Slic3r, etc) or anything else that connects to the COM port must be CLOSED for the firmware to be flash.
* If anything is connected to the COM port when flashing it will fail, typically "access denied" is listed in the error section of the Arduino IDE.
* You MUST use the Included Arduino IDE to flash the firmware if on Windows and if you are on a Mac or Linux follow the guide in our knowledgebase to setup your IDE to work with the firmware.
*
@jfinstrom
jfinstrom / godwin ethics
Created October 25, 2018 18:03
Sqlite ethics but replacing god/christ with godwin....
First of all, love the Lord Godwin with your whole heart, your whole soul, and your whole strength.
Then, love your neighbor as yourself.
Do not murder.
Do not commit adultery.
Do not steal.
Do not covet.
Do not bear false witness.
Honor all.
Do not do to another what you would not have done to yourself.
@jfinstrom
jfinstrom / CHANGELOG.md
Created October 23, 2018 03:24
core changelog example
<?php
namespace FreePBX\modules\Mymodule;
use FreePBX\Inputinterface;
use FreePBX\Outputinterface;
use BMO;
class InstallBase{
public $input = null;
public $output = null;
@jfinstrom
jfinstrom / sign.sh
Last active September 30, 2018 20:15 — forked from snay2/sign.sh
Bash shell script to automate PGP key signing
while [ 1 ]; do
echo ">> Enter an email address:"
read EMAIL
gpg --keyserver pgp.mit.edu --search-keys $EMAIL
FINGERPRINT=`gpg --fingerprint $EMAIL`
[[ $FINGERPRINT =~ 2048[DR]/([0-9A-F]{8}) ]];
KEY_ID=${BASH_REMATCH[1]}
gpg --sign-key $EMAIL
echo ">> Going to sign key $KEY_ID"
gpg --armor --export $KEY_ID > $KEY_ID.asc

Keybase proof

I hereby claim:

  • I am jfinstrom on github.
  • I am jfinstrom (https://keybase.io/jfinstrom) on keybase.
  • I have a public key ASBFx1fnod-68cL5UCkH36MWRn3I5IxecgfPQUGZ9R5JqAo

To claim this, I am signing this object: