Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
making stuff

James Finstrom jfinstrom

💭
making stuff
View GitHub Profile
@jfinstrom
jfinstrom / pwupdate.php
Created Jan 19, 2022
Update all sip passwords
View pwupdate.php
#!/usr/bin/env php
<?php
/**
Copyright (C) 2022 James Finstrom <github@g3p0.xyz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@jfinstrom
jfinstrom / genHtpasswd.php
Created Jun 4, 2021
Generate a htpasswd file from FreePBX userman group.
View genHtpasswd.php
#!/usr/bin/env php
<?php
// (c) 2021 James Finstrom
// This code is licensed under MIT license
include '/etc/freepbx.conf';
$gid = 1;
$freepbx = FreePBX::Create();
$group = $freepbx
@jfinstrom
jfinstrom / freepbx.vscode-snippits
Created May 26, 2021
Snippits for FreePBX in vscode
View freepbx.vscode-snippits
{
// (c)2021 James Finstrom
// License: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
"FreePBX Text Input":{
"scope": "php,html",
"prefix": "f-texti",
"body": [
"<!--${1:LABEL}-->",
"<div class=\"element-container\">",
@jfinstrom
jfinstrom / costOfFree.md
Last active May 26, 2021
The cost of free.
View costOfFree.md

Open Source Software

The cost of free.

Who am I?

I am a Sr. Software engineer and a former core developer for the FreePBX project. I have been involved in open source software as a user and developer since 2005. I have been in computers since I was a child with my introduction to computers on a IBM XT.

Disclaimers

@jfinstrom
jfinstrom / Restore.php
Created Dec 14, 2020
Digium Phones Restore
View Restore.php
<?php
namespace FreePBX\modules\Digium_phones;
use FreePBX\modules\Backup as Base;
class Restore Extends Base\RestoreBase{
public function runRestore(){
$configs = $this->getConfigs();
$this->importTables($configs['tables']);
}
public function processLegacy($pdo, $data, $tables, $unknownTables){
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
/***
* ###### ## ######## ### ######## ## ## ## #### ########
* ## ## ## ## ## ## ## ## ## ## ## ## ## ##
* ## ## ## ## ## ## ## ## #### ## ## ##
* ## ## ###### ## ## ######## ## ## ## ########
* ## ## ## ######### ## ## ## ## ## ##
* ## ## ## ## ## ## ## ## ## ## ## ##
* ###### ######## ######## ## ## ## ## ######## ## #### ##
*/