Skip to content

Instantly share code, notes, and snippets.

View rgfpy's full-sized avatar

Robert Galeano rgfpy

View GitHub Profile
@anpel
anpel / originate_call.php
Last active December 12, 2022 17:54
Originate a call from Asterisk using PHP and Asterisk Manager Interface
/**
* Once this scipt is executed it will connect to the local port you have assigned to
* Asterisk (default: 5038) and send an authentication request. If successfull, it will
* send a second request to originate your call.
*
* The internal SIP line $internalPhoneline will be dialed, and when picked up the
* $target phone will be dialed using your outbound calls context ($context).
*
* Of course, you can modify the commands sent to the asterisk manager interface to suit your needs.
* you can find more about the available options at:
@milo
milo / github-webhook-handler.php
Last active July 26, 2023 15:29
GitHub Webhook Handler
<?php
/**
* GitHub webhook handler template.
*
* @see https://docs.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
@mkdizajn
mkdizajn / php encode_decode helper function.php
Last active April 17, 2017 22:21
php encode/decode helper function
<?php
header('Content-Type: text/html; charset=utf-8');
/**
* [helper fn for en/de (crypt) strings]
* @var string
*/
$mod = ( isset( $_GET['mod'] ) ? $_GET['mod'] : '' );
$val = ( isset( $_GET['val'] ) ? $_GET['val'] : '' );