Skip to content

Instantly share code, notes, and snippets.

View lgaetz's full-sized avatar

Lorne Gaetz lgaetz

  • Nova Scotia, Canada
View GitHub Profile
<?php
/*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
* Developer Notes:
*
* Version History:
* 2022-06-13 Initial commit #FREEPBX-23555
* 2022-07-14 Update to version 16, add multi language support, refactor code, tested = only message error (Javier Pastor Aka VSC55)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***/
namespace FreePBX\modules\Superfecta\sources;
<?php
/*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
* Developer Notes:
*
*
* herold.at Terms of Service:
* As summarized in the post here on 2014-06-27
* https://github.com/POSSA/Caller-ID-Superfecta/issues/131#issuecomment-47354154
* herold.at TOS do not explicitly prohibit automated lookups
@lgaetz
lgaetz / get_shaken.php
Last active May 27, 2022 12:43
FreePBX AGI script to get a Stir/Shaken Signature via API and apply it to an outgoing call
#!/usr/bin/php
<?php
/*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
*
* Script: get_shaken.php
*
* Latest version: https://gist.github.com/lgaetz/af5849b8984f6ec7aa12a29a01a7e38b
*
* Usage: Asterisk AGI file to get a Stir/Shaken signature from Sansay NSS service
; FreePBX custom dialplan that creates a prefix dial code that
; will keep an asterisk channel open for 3600 seconds to monitor
; the device state of the target local extension and call back once
; the target extension is idle
; License GNU GPL3
;
; Latest version: https://gist.github.com/lgaetz/b65d7ec29d2e2cba46909051dfcb39cf
;
; History
@lgaetz
lgaetz / santiago
Last active February 24, 2022 16:01
Bash script to display log lines with unixtime to human readable date
#! /bin/bash
# Display logs files with lines that begin with a 10 digit unixtime to human readable date
# save in /usr/sbin/ and make it executable
#
# Latest version: https://gist.github.com/lgaetz/b06c58aa349bc84348b12fc5d908da11
#
# Usage:
# cat /etc/asterisk/firewall.log | santiago
# santiago /var/log/asterisk/queue_log
@lgaetz
lgaetz / sms2twitter.php
Last active February 24, 2022 16:16
POC for using SMS webhook in FreePBX to send to if this then that ifttt.com
<?php
/*****************************************************
* Rough proof of concept of a web script
* to accept SMS webhook from FreePBX on an
* inbound SMS and post it to twitter using an https://ifttt.com/ webhook
*
* License: GNU GPL3+
*
* History : 2022-01-13 first commit
<?php
/**** **** **** **** **** **** **** **** **** **** **** **** **** ****
*
* License: GNU GPL/2+
*
* /var/www/html/admin/modules/superfecta/sources/source-Trunk_Provided.module
*
* History: 2012-09-18 update by lgaetz
* 2021-12-20 update by tm1000
; Purpose
; FreePBX custom in-call feautre code framework that allows a caller to initiate an action that will be performed on hangup by
; pressing #9 during a call. Sets up feature code that adds a hangup handler to the channel, and the hangup handler can be used
; to record to the CDR userfield or perform some other action Possible uses are for flagging calls with audio issues.
;
; Latest version: https://gist.github.com/lgaetz/feaedc65a2f255bb4027e2b52efa8947
;
; License GNU GPL3+
; Latest version: https://gist.github.com/lgaetz/066c655867b4e679da21dbd1567b29bd
;
; Crude proof of concept of 2FA for a FreePBX extension
; Clients can register to the PBX, but are unable to dial until they successfully
; enter a random PIN sent via email.
; Once the PIN passes, the client IP is whitelisted and user can dial without
; restriction until the IP changes
;
; License: GNU GPL3+
;
@lgaetz
lgaetz / lgaetz-voicemail.php
Last active August 3, 2021 22:06
php script to use freepbx methods to get/set voicemail params
<?php
/***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** *****
*
* Script: lgaetz-voicemial.php
*
* FreePBX script to work with device presence states
*
* Latest version: https://gist.github.com/lgaetz/2f0a19e79f968f9aa832dd7ec74d57dd
*