Skip to content

Instantly share code, notes, and snippets.

View marrold's full-sized avatar

Matthew Harrold marrold

View GitHub Profile
@marrold
marrold / ringback.sh
Created February 26, 2024 23:18
Asterisk Ringback Script
#!/usr/bin/env bash
# ringback.sh CHANNEL CALLERD WAITTIME MAXRETRIES RETRYTIME CONTEXT EXTENSION PRIORITY DELAY SETVAR
# bash ringback.sh "PJSIP/0232618@cuprox" "\"Ring Back\" <17070>" "30" "1" "30" "echo-test" "s" "1" "10" "FILE=Fax.tiff"
CHANNEL=${1}
CALLERID=${2}
WAITTIME=${3}
MAXRETRIES=${4}
RETRYTIME=${5}
@marrold
marrold / emf_sched_to_pdf
Last active February 18, 2024 22:40
Converts the emf schedule to a PDF for faxing
# API documentation - https://developer.emfcamp.org/schedule
from fpdf import FPDF
# Sample data
data = {
"stage-a": [
{
"title": "Exploring Quantum Computing",
"speaker": "Alice Johnson",
Mar 11 19:26:43.136: ISDN Se0/1/0:15 EVENT: process_pri_call: call id 0x8008, number 1000, Guid 03E763438024, speed 0, call type VOICE, redial No, CSM call No, pdata Yes
Mar 11 19:26:43.144: ISDN Se1/0:15 EVENT: process_rxstate: ces/callid 1/0x7 calltype 2 CALL_INCOMING
Mar 11 19:26:43.144: ISDN Se1/0:15 EVENT: call_incoming: call_id 0x0007, Guid = 047636128008
Mar 11 19:26:43.148: ISDN Se1/0:15 EVENT: UserIdle: callid 0x7 received ACCEPT_CALL (0x13)
Mar 11 19:26:43.148: CSM: MODEM_REPORT from 1/0:0, call_id=0x7, event=0x1, cause=0x0, dchan_idb=0x7144AAD0
Mar 11 19:26:43.148: CSM: called_number '1000' modem_pool 703DE104 deny_call FALSE
Mar 11 19:26:43.148: CSM: Next free modem = 2/0; statbits = 80010020
Mar 11 19:26:43.148: Modem 2/0 CSM: modem is allocated, modems free=5
Mar 11 19:26:43.148: Modem 2/0 CSM: Incoming call from 1001 to 1000, id 0x7
Mar 11 19:26:43.148: Modem 2/0 CSM: (CSM_PROC_IDLE)<--ISDN_CALL
@marrold
marrold / ESPHome_Inbird IBS-TH1
Last active December 17, 2021 21:57
ESPHome Inbird IBS-TH1 configuration
esphome:
name: esphome-boiler
platform: ESP32
board: esp32dev
# Enable logging
logger:
# Enable Home Assistant API
api:
@marrold
marrold / Pretty_menu_for_cisco
Created December 15, 2021 21:26
Pretty menus for Cisco
!
! The following config allows you to create a basic menu system on a Cisco
! device. It can then be ran as an autocommand to allow users to select an
! option to connect to an external service or run another command.
!
! Build the menu.
!
menu main line-mode
menu main clear-screen
menu main single-space
@marrold
marrold / 3845_Dial-Up_NAS_T1_15.3
Last active January 18, 2024 16:05
Cisco 3845 Dial-Up Network Access Server Configuration - T1 on IOS 15.3
! Configure the E1/T1 cards to use T1
!
card type t1 0 1
card type t1 1
!
!
! Set the default ISDN switch type
!
isdn switch-type primary-ni
!
@marrold
marrold / 3845_Dial-Up_NAS_E1_15.3
Last active December 9, 2021 10:30
Cisco 3845 Dial-Up Network Access Server Configuration - E1 on IOS 15.3
! Configure the E1/T1 cards to use E1
!
card type e1 0 1
card type e1 1
!
!
! Set the default ISDN switch type
!
isdn switch-type primary-net5
!
Action: Login
Username: USER
Secret: PASSWORD
ActionID: 0
Asterisk Call Manager/5.0.3
Response: Success
ActionID: 0
Message: Authentication accepted
import time
from settings import login, connection
from asterisk.ami import AMIClient,AutoReconnect
def ami_disconnected(client, response):
print(f"The AMI has disconnected: {response}")
def event_notification(source, event):
print(f"Event: {event}")
#!/usr/bin/env bash
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common gnupg2
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce