This file contains 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
version: '3.9' | |
services: | |
# MySQL Service | |
mysql-container: | |
image: mysql:8.0.30 | |
container_name: mysql | |
restart: always |
This file contains 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 | |
// Initialize a cURL session | |
$ch = curl_init(); | |
// Create a query string from the array of parameters | |
$params = array( | |
"username" => "sms", | |
"password" => "1982", | |
"phonenumber" => "18097143489", | |
"message" => "122", |
This file contains 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
::::::::::::::BOT CODE ::::::::::::::::::::::: | |
import openai | |
import os | |
# Get the OpenAI API key from an environment variable | |
openai.api_key = os.getenv("OPENAI_API_KEY") | |
class Chatbot: | |
def __init__(self): | |
self.messages = [] |
This file contains 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 | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'https://api.openai.com/v1/chat/completions'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, [ | |
'Authorization: Bearer sk-dLwvCvDVK', | |
'Content-Type: application/json', | |
]); |
This file contains 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 code---- | |
php /home/ambiorix/insert_device.php 2222 | |
<?php | |
$link = mysqli_connect("localhost", "root", "mypass", "asterisk"); | |
/* check connection */ | |
if (mysqli_connect_errno()) { | |
printf("Connect failed: %s\n", mysqli_connect_error()); | |
exit(); |
This file contains 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
;;;custom notification;;;; | |
[playing-audio] | |
exten=>_x.,1,Noop( ----- Playing message on channel ${CHANNEL} -----------------) | |
same=>n,Set(__chan=${CHANNEL}) | |
same=>n,Set(__inboundid=${EXTEN}) | |
same=>n,Set(__time-play=20) | |
same=>n,Dial(Local/1923@spy-exten) | |
This file contains 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) { | |
var to_num =event.From; | |
var did =event.To; | |
// Here's an example of setting up some TWiML to respond to with this function | |
const TwilioClient = context.getTwilioClient(); | |
TwilioClient.studio.v1.flows('FWac0dsssssss4') | |
.executions | |
.create({to: 'did', from: 'to_num',parameters: { | |
phone: to_num | |
}}) |
This file contains 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
[survey_1] | |
exten=>_X.,1,Answer() | |
same=>n,Set(path=/var/www/html/recording_temp/) | |
same=>n,playback(welcome) | |
same=>n(rec_last),playback(vm-rec-name) | |
same=>n,Record(${path}${UNIQUEID:}_name.wav,,,ky) | |
same=>n,Set(name=${path}${UNIQUEID}_name.wav) | |
same=>n,Playback(auth-thankyou) | |
same=>n(rec_last),playback(vm-rec-name) |
This file contains 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 | |
$server_check_version = '1.0.4'; | |
$start_time = microtime(TRUE); | |
$operating_system = PHP_OS_FAMILY; | |
if ($operating_system === 'Windows') { | |
// Win CPU | |
$wmi = new COM('WinMgmts:\\\\.'); |
This file contains 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 to = event.To; | |
const nums = [to,+1,+2,+3]; | |
let n1 =nums[0]; | |
let n2= nums[1]; | |
let n3= nums[2]; | |
let n4 =nums[3]; | |
const number_tzone = {n1:"America/New_York",n2:"America/Miami"}; |
NewerOlder