hitagi-entrada/teste-arquivoremoto.php

21 lines
651 B
PHP
Raw Normal View History

2024-12-20 16:08:25 +00:00
<?php
require __DIR__ . '/vendor/autoload.php';
use Hitlabs\Hitagi\ArquivoRemoto;
$calldata = "Channel: Local/6999@padrao" . "\n";
$calldata .= "Context: padrao\n";
$calldata .= "Extension: 06999\n";
$filename = time() . '-' . rand(100, 999) . '.call';
$argssend = array();
// $argssend['filedir'] = '/var/spool/asterisk/outgoing';
$argssend['filedir'] = '/var/www/html/apagar';
$argssend['filename'] = $filename;
$argssend['filebase64'] = base64_encode($calldata);
$arquivoremoto = new ArquivoRemoto();
$arquivoremoto->ip = '177.107.205.248';
print_r($arquivoremoto, true);
$response = $arquivoremoto->salvar($argssend);
print_r($response, true);