Skip to content

Instantly share code, notes, and snippets.

View ipoddubny's full-sized avatar

Ivan Poddubny ipoddubny

  • ipnordic
  • Denmark
View GitHub Profile
@ipoddubny
ipoddubny / extensions.conf
Created July 31, 2018 14:20
Asterisk loopback switch usage example
; CompanyID is a channel variable always present when calling someFunction,s,1
[someFunction]
exten => s,1,WaitExten(10)
exten => _X,1,... ; standard handling of 1,2,3,4,5 - common for any company ID
; ...
eswitch => Loopback/${EXTEN}@someFunction_custom_${CompanyID}
[someFunction_custom_1]
@ipoddubny
ipoddubny / ari-hello-world.js
Created October 6, 2017 16:13
ari-hello-world
const client = require('ari-client');
const url = "http://localhost:8088";
const [username, password] = ["test", "test"];
async function main()
{
try {
const ari = await client.connect(url, username, password);
@ipoddubny
ipoddubny / pjsip_wizard.conf
Created July 5, 2017 09:35
Asterisk Multifon.ru PJSIP wizard setup
[multifon]
type=wizard
sends_auth=yes
sends_registrations=yes
transport=transport-udp
remote_hosts=sbc.megafon.ru
outbound_auth/username=7926xxxxxxx
outbound_auth/password=xxxxxxxxxxxxxxxx
registration/contact_user=7926xxxxxxx
server_uri_pattern=sip:multifon.ru
@ipoddubny
ipoddubny / docker.gogs.service
Created July 9, 2016 08:11
systemd docker container unit (Gogs)
# /etc/systemd/system/docker.gogs.service
[Unit]
Description=Gogs container
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker run --name=gogs -p 10022:22 -p 127.0.0.1:10080:3000 -v /var/gogs:/data gogs/gogs
ExecStop=/usr/bin/docker stop -t 2 gogs
@ipoddubny
ipoddubny / coverage.js
Created June 1, 2016 14:12
Asterisk code coverage (for patched Asterisk)
'use strict';
const fs = require('fs');
const _ = require('lodash');
if (process.argv.length !== 3) {
console.log(`Usage: node ${process.argv[1]} FILENAME`);
process.exit(1);
}
@ipoddubny
ipoddubny / chan_sip.diff
Created May 31, 2016 19:54
Asterisk: filling SIP_HEADERS hash in incoming calls so that headers are available from the dialplan
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index f648454..d6be92b 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -19266,6 +19266,33 @@ static int set_message_vars_from_req(struct ast_msg *msg, struct sip_request *re
return res;
}
+static void fill_sip_headers_hash(struct ast_channel *channel, struct sip_request *req)
+{
@ipoddubny
ipoddubny / irontec.repo
Last active February 20, 2019 08:41
ansible sngrep playbook
[irontec]
name=Irontec RPMs repository
baseurl=http://packages.irontec.com/centos/$releasever/$basearch/
@ipoddubny
ipoddubny / yandex-tts-agiserver.js
Created May 22, 2016 17:41
Yandex text-to-speech FastAGI server for Asterisk
/*
* System requirements:
* - lame
* - sox
*
* Usage:
* exten => ...,AGI(agi://localhost:3000/?text=${URIENCODE(Hello, world)})
*/
'use strict';
@ipoddubny
ipoddubny / lock.sh
Last active August 29, 2015 14:26 — forked from csivanich/lock.sh
i3 Blurred Lock Screen
#!/bin/bash
# i3lock blurred screen inspired by /u/patopop007 and the blog post
# http://plankenau.com/blog/post-10/gaussianlock
# Timings are on an Intel i7-2630QM @ 2.00GHz
# Dependencies:
# imagemagick
# i3lock
/**
* Build for production:
* $ NODE_ENV=production webpack
*
* Build for staging or development mode
* $ webpack
*
* Run app server in dev mode and use Hot Module Replacement
* $ NODE_ENV=webpack nodemon --watch ./app index.js
*