Skip to content

Instantly share code, notes, and snippets.

View lg-presence.php
#!/usr/bin/env php
<?php
/***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** *****
*
* Script: lg-presence.php
*
* FreePBX script to work with device presence states
*
* Latest version: https://gist.github.com/lgaetz/6b528901e6746391369b79b371bdd71f
@lgaetz
lgaetz / smsdialplan.txt
Last active Feb 25, 2021
Dialplan to send SMS using Voip Innovations APIDAZE
View smsdialplan.txt
[send-sms-apidaze]
; latest version https://gist.github.com/lgaetz/57ffc5bbdd154081894138e983c1f4be
;
; In the APIDAZE API portal create a Dev App of type SMS and associate a DID with that APP
; get the secret and key for your app, and set them as variables
; Created by lgaetz, GNU/GPL3+
;
; Create a Custom Destination with Return enabled and with the following target:
; send-sms-apidaze,s,1(${CALLERID(number)},What are you doing Dave?)
;
View lgaetz-trunk-monitor.php
#!/usr/bin/php -q
<?php
/*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
*
* Latest Version: https://gist.github.com/lgaetz/ce6ac96ca6de0e60177213ede50e7955
*
* Description:
*
* Script lgaetz-trunk-monitor.php is used in conjunction with the "Monitor Trunk Failures" field in FreePBX
@lgaetz
lgaetz / dring config
Last active May 9, 2020
FreePBX manual config for POTS dring
View dring config
FreePBX basic config for Asterisk/DAHDI to enable Distinctive Ring Detection for incoming calls on POTS lines with
multiple DIDs. Once usedistinctiveringdetection has been enabled, you can get the dring values from the Asterisk
console/full log when you make an inbound call
compiled from various sources by lgaetz c. 2009
license: GPL2
[root@asterisk]# cat /etc/asterisk/chan_dahdi_channels_custom.conf
usedistinctiveringdetection=yes
View lgaetz-pay-it-fwd.php
#!/usr/bin/php -q
<?php
if (!isset($argv[2])){
echo "
***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** *****
*
* Script: lgaetz-pay-it-fwd.php
* sets,unsets,toggles and lists Unconditional Call Fwd setting for provided extension
*
* Latest version: https://gist.github.com/lgaetz/64212eceab5e2c8381b586ba14df4fcf
View lgaetz-hinterland.php
#!/usr/bin/php -q
<?php
/**** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
* lgaetz-hinterland.php
* PHP script to monitor devstate change of FreePBX extensions in real time
*
* latest version: https://gist.github.com/lgaetz/64ad83952a2a629204222e48fc01bb51
*
* Usage: download the script to the PBX, make it executable and run it
View SIP First Responder
[send-sip-response-code]
; Context to send a specific SIP response code and terminate the channel
; Create Custom Destination in FreePBX with a dial string of the format
; send-sip-response-code,404,1
; substitute the appropriate response code in place of the 404
; Reference: https://wiki.asterisk.org/wiki/display/AST/Hangup+Cause+Mappings
;
; latest version: https://gist.github.com/lgaetz/480582a1827cc98db1ee539c249f074b
;
; License GPL/2
@lgaetz
lgaetz / ariendpoints.php
Created Oct 8, 2019 — forked from jfinstrom/ariendpoints.php
Dump endpoints with ARI and FreePBX
View ariendpoints.php
#!/usr/bin/env php
<?php
if((@include '/etc/freepbx.conf') === false){
echo "Failed to include configuration\r\n";
return;
}
$ariuser = \FreePBX::Config()->get('FPBX_ARI_USER');
$aripass = \FreePBX::Config()->get('FPBX_ARI_PASSWORD');
$ari = new Pest('http://localhost:8088/ari');
$ari->setupAuth($ariuser,$aripass);
View outbound call notification
[outbound-call-notification]
; Use with FreePBX Custom Trunk, with a dial string set to:
; local/$OUTNUM$@outbound-call-notification
; Structure outbound routes to use this trunk ahead of conventional trunks or without any other trunks.
; Email notice will be generated on all outbound calls. Use for restricted
; routes, calls to high tariff destinations, etc.
;
; latest version: https://gist.github.com/lgaetz/eae01c3fe9209608abb2bd0410cb294c
;
; license: GNU/GPL2
@lgaetz
lgaetz / el_cid.conf
Last active Jul 1, 2019
lgaetz-el_cid
View el_cid.conf
; FreePBX user dialplan for setting the outgoing Caller ID dynamically on a per-call basis to match
; the NANP area code of the destination number
;
; Latest version:
; https://gist.github.com/lgaetz/2b3d67a30f86a827121b004ec2f3024a
;
; Usage:
; Content below goes in /etc/asterisk/extensions_custom.conf
;