Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
making stuff

James Finstrom jfinstrom

💭
making stuff
View GitHub Profile
View index.php
<?php
$options = include(__DIR__.'/options.php');
?>
<html lang="en">
<head>
<title>Select PHP Example</title>
</head>
<body>
<select id="example" name="example">
@jfinstrom
jfinstrom / ari-gen.js
Created May 22, 2020
Concept of ARI connection with generators.....
View ari-gen.js
const ari = require("ari-client");
const freepbx = new require("freepbx");
const co = require("co");
co(function*() {
var freepbxC = yield freepbx.connect();
var ariC = yield ari.connect(
"http://localhost:8088/ari",
freepbxC.config.configs.FPBX_ARI_USER,
freepbxC.config.configs.FPBX_ARI_PASSWORD
@jfinstrom
jfinstrom / ari.yaml
Last active May 19, 2020
ARI Open API 3
View ari.yaml
openapi: 3.0.1
info:
title: Asterisk ARI
version: 6.0.0
servers:
- url: http://localhost:8088/ari
tags:
- name: applications
description: Stasis application resources
- name: asterisk
@jfinstrom
jfinstrom / ari.yaml
Created May 19, 2020
ARI Swagger v2
View ari.yaml
basePath: /ari
definitions:
containers:
description: Container
binary:
description: Binary
Application:
description: Details of a Stasis application
properties:
bridge_ids:
View clearlybanner
/***
* ###### ## ######## ### ######## ## ## ## #### ########
* ## ## ## ## ## ## ## ## ## ## ## ## ## ##
* ## ## ## ## ## ## ## ## #### ## ## ##
* ## ## ###### ## ## ######## ## ## ## ########
* ## ## ## ######### ## ## ## ## ## ##
* ## ## ## ## ## ## ## ## ## ## ## ##
* ###### ######## ######## ## ## ## ## ######## ## #### ##
*/
View sangoma-freepbx.repo
## TO USE
## Place these contents in /etc/yum.repos.d/sangoma-freepbx.repo
## run: echo 7 > /etc/yum/vars/customver
# This is the standard Sangoma Yum Repository
[sng-base]
name=Sangoma-$customver - Base
mirrorlist=http://mirrorlist.sangoma.net/?release=$customver&arch=$basearch&repo=os&dist=$dist&staging=$staging
#baseurl=http://package1.sangoma.net/os/$customver/os/x86_64/
@jfinstrom
jfinstrom / freepbx.php
Created Apr 30, 2020
freepbxstub intelephense
View freepbx.php
<?php
define('FPBX_LOG_FATAL', FATAL);
define('FPBX_LOG_CRITICAL', CRITICAL);
define('FPBX_LOG_SECURITY', SECURITY);
define('FPBX_LOG_SIGNATURE_UNSIGNED', SIGNATURE_UNSIGNED);
define('FPBX_LOG_UPDATE', UPDATE);
define('FPBX_LOG_ERROR', ERROR);
define('FPBX_LOG_WARNING', WARNING);
define('FPBX_LOG_NOTICE', NOTICE);
define('FPBX_LOG_INFO', INFO);
@jfinstrom
jfinstrom / README.MD
Last active Apr 21, 2020
FreePBX Functions and Methods
View README.MD

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 Aug 24, 2020
ipban.org with freepbx firewall **(Untested)**
View ipbanimport.php
#!/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', '');
View asterisk.conf
[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
You can’t perform that action at this time.