Skip to content

Instantly share code, notes, and snippets.

{
"basics": {
"name": "Caleb Frey",
"email": "calefrey@gmail.com",
"image": "https://1.gravatar.com/avatar/6e63c951fa0696996528c66dd8c1de6fed64e13588d20c85224caeaea973241d?size=512",
"summary": "Automation Engineer and Power Platform Developer",
"location": {
"city": "Philadelphia",
"region": "PA",
"countryCode": "USA"
#! /usr/bin/python3
# This is a script I wrote to fix a *very* specific problem I have with the Grandstream GXW-4104 adapter and my PBX server, 3CX.
# Occasionally, the granstream will stop accepting calls from the PBX, although it will still accept calls from the PSTN.
# This seems to happen when the adapter loses connection to the PBX, and is resolved by rebooting the adapter.
# This is an easy enough fix, but especially after hours, it takes a while to notice that this issue has occurred.
# It's only realized when noticing that it's been suspiciously quiet in terms of after-hours calls, resuling in missed emergencies.
# This script is meant to run on some local server, in my case an UNRAID server, run as a cron job every (in my case) 5 minutes.
# Using a reverse engineered 3CX API, it checks the status of the trunk, and if it's not registered, it restarts the adapter.
# The API calls were determined using Postman's proxying feature to capture the activity when navigating the adapter and 3cx web UIs.

Keybase proof

I hereby claim:

  • I am calefrey on github.
  • I am calebfrey (https://keybase.io/calebfrey) on keybase.
  • I have a public key ASDJ8GPkc6O-P95c4isBnuWtSXRT-Y3VMtgFxBllVIZ3vgo

To claim this, I am signing this object:

@calefrey
calefrey / winsetup.ps1
Last active October 8, 2021 07:21
Windows Setup
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
iwr -useb get.scoop.sh | iex
scoop install git sudo
scoop bucket add extras
scoop bucket add spotify https://github.com/TheRandomLabs/Scoop-Spotify.git
scoop install firefox pwsh python grep vscode synctrayzor
scoop install spotify-latest discord
iwr -useb get.scoop.sh | iex;
scoop install aria2 git python;
scoop bucket add extras;
scoop install vscode;
code --install-extension ms-python.python;