Skip to content

Instantly share code, notes, and snippets.

View brownian's full-sized avatar

Dmytro O. Redchuk brownian

View GitHub Profile
@ctaloi
ctaloi / gist:5861727
Last active November 14, 2016 18:05
Asterisk - Pass SIP Diversion if exists on the way in
exten => s,1,Set(TG_FULLNAME=${ARG2})
exten => s,n,Set(TRUNK=${CUT(TG_FULLNAME,/,2)})
exten => s,n,Set(ORIG_ANI=${CALLERID(rdnis)})
exten => s,n,Set(SIP_DOMAIN=${SIPDOMAIN})
exten => s,n,Set(ROUTE_STRIP=${ARG1})
exten => s,n,Set(DIALED=${DIALED_NUMBER:${ROUTE_STRIP}}
exten => s,n,GotoIf($[${LEN(${ORIG_ANI})} > 0]?100:101)
exten => s,100,SIPAddHeader(Diversion: <sip:${CALLERID(rdnis)}@${SIP_DOMAIN}>\;Reason=unconditional)
exten => s,101,Dial(SIP/${DIALED}@${TRUNK},,tT)
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory