This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // show the fowarding value | |
| //echo shell_exec("asterisk -x \" database show CF/$_GET[exten] \" "); | |
| //update the fowarding value | |
| //echo shell_exec("asterisk -x \" database put CF $_GET[exten] 13052311212 \" "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $timeout=10; | |
| $host="127.0.0.1"; | |
| $port=5038; | |
| $src = preg_replace('/\s+/', '', $argv[1]); | |
| $dst = preg_replace('/\s+/', '', $argv[2]); | |
| $cid = preg_replace('/\s+/', '', $argv[3]); | |
| $context1="from-internal"; | |
| $context2="from-internal"; | |
| $socket = fsockopen("$host",$port,$errno, $errstr, $timeout); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.handler = function(context, event, callback) { | |
| const axios = require('axios'); | |
| const Moment1 = require('moment-timezone'); | |
| const MomentRange = require('moment-range'); | |
| const moment = MomentRange.extendMoment(Moment1); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ////// email function | |
| //Initialize SendGrid Mail Client | |
| const sgMail = require('@sendgrid/mail'); | |
| // Define Handler function required for all Twilio Functions | |
| exports.handler = function(context, event, callback) { | |
| let twiml = new Twilio.twiml.VoiceResponse(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "description": "A New Flow", | |
| "states": [ | |
| { | |
| "name": "Trigger", | |
| "type": "trigger", | |
| "transitions": [ | |
| { | |
| "event": "incomingMessage" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Testa CODE to read webhook values | |
| <?php | |
| header("content-type: text/xml"); | |
| echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; | |
| foreach($_REQUEST as $key=>$value){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [callcentric] | |
| type=peer | |
| disallow=all | |
| allow=ulaw | |
| allow=alaw | |
| insecure=port,invite | |
| directmedia=no | |
| context=trunkinbound | |
| qualify=yes | |
| dtmfmode=rfc2833 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.handler = function(context, event, callback) { | |
| let twiml = new Twilio.twiml.VoiceResponse(); | |
| // getting time With timezone: | |
| // In Functions/Configure, add NPM name: moment-timezone, version: 0.5.14 | |
| // Timezone function reference: https://momentjs.com/timezone/ | |
| //https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/ | |
| let moment = require('moment-timezone'); | |
| // | |
| // timezone needed for Daylight Saving Time adjustment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.handler = function(context, event, callback) { | |
| let twiml = new Twilio.twiml.VoiceResponse(); | |
| const command = event.Digits; | |
| console.log( ` dtmf entered : ${event.Digits}`); | |
| if ( `${event.Digits}` != 'undefined') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| removing particular character from a variable ( remove " ) | |
| echo '"18458254937"' | tr -d '"' | |
| https://unix.stackexchange.com/questions/104881/remove-particular-characters-from-a-variable-using-bash |