Skip to content

Instantly share code, notes, and snippets.

View dwilkie's full-sized avatar

David Wilkie dwilkie

View GitHub Profile
@dwilkie
dwilkie / cgrates.md
Last active September 17, 2025 08:48
CGRateS commands

Useful CGrateS commands

Run ngrep on the cgrates container with JSON formatting

docker compose exec -it billing-engine sh -c \
'ngrep -d any -W byline port 2021 or 2013 or 2014 or 2080 or 2060 or 2012 | \
while read line; do
  echo "$line" | jq . 2>/dev/null || echo "$line"
done'
@dwilkie
dwilkie / README.md
Last active February 28, 2025 09:10
Lao EWS Test Message

Lao EWS Test Message

@dwilkie
dwilkie / .gitignore
Last active May 21, 2024 17:17
Bulk Download all Invoices from Wave
*.csv
*.pdf
.DS_Store
<Response>
<Say voice="Polly.Aditi">Hello</Say>
</Response>
@dwilkie
dwilkie / record.xml
Created April 3, 2024 15:25
TwiML record
<Response>
<Say voice="Polly.Russell">Hi Jen please leave a message after the beep</Say>
<Record action="https://somleng-recordings.free.beeceptor.com"/>
</Response>
@dwilkie
dwilkie / rayo.md
Created January 30, 2024 07:16
Rayo Commands

Rayo Commands

Start FreeSWITCH Console

$ fs_cli -p secret

Get Rayo Status

@dwilkie
dwilkie / tcpdump.sh
Last active October 15, 2025 09:32
Docker tcpdump
sudo docker run -it --rm --net container:59da80a76475 nicolaka/netshoot # Replace 59da80a76475 with the running container ID
tcpdump -Xvv -i eth0 -s0 -w capture.pcap
curl --upload-file capture.pcap https://uppy.sh/somleng.pcap
curl -F "[email protected]" https://0x0.st
curl --upload-file capture.pcap https://sgfile.io
@dwilkie
dwilkie / import_stories.rb
Last active January 14, 2022 11:45
Import UNICEF IF Workplan into Pivotal Tracker
## import_stories.rb
# Imports stories from the UNICEF Workplan into Pivotal Tracker from CSV file.
### CSV file format
# Export the UNICEF worklplan as CSV.
### Usage
@dwilkie
dwilkie / import_contacts.rb
Last active December 9, 2021 08:51
Import contacts into SCFM
## import_contacts.rb
# Imports contacts into SCFM from CSV file.
### CSV file format
# CSV File must have a `phone_number` or `telephone_number` column
# which contains the phone number of the contact. The phone number
# must be in international E.164 format. All other additional columns
# are added to the contact's metadata with the key being the column header
@dwilkie
dwilkie / unicef_metrics.rb
Last active November 2, 2021 08:34
UNICEF Metrics
start_time = Time.new(2020, 10, 1).beginning_of_day
end_time = Time.new(2020, 12, 31).end_of_day
completed_calls = PhoneCall.completed.where(created_at: start_time..end_time).joins(:call_data_record)
number_of_unpaid_users = User.count # SCFM only for now
number_of_calls = completed_calls.count
number_of_minutes = completed_calls.sum("call_data_records.bill_sec") / 60
number_of_users = (completed_calls.pluck(:to) + completed_calls.pluck(:from)).uniq.count