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
[general] | |
interval=15 ; Number of seconds between trying to connect to devices | |
;------------------------------ JITTER BUFFER CONFIGURATION -------------------------- | |
;jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a | |
; Dongle channel. Defaults to "no". An enabled jitterbuffer will | |
; be used only if the sending side can create and the receiving | |
; side can not accept jitter. The Dongle channel can't accept jitter, | |
; thus an enabled jitterbuffer on the receive Dongle side will 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
//AL FINAL de /etc/asterisk/extensions_custom.conf | |
// Reemplaza <Tu TELEFONO> por Tu telefono | |
// Reemplaza <Tu correo> por Tu correo | |
[from-trunk-dongle] | |
exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})}) | |
exten => sms,n,System(echo "To: <Tu correo>\nSubject: Incoming SMS from ${CALLERID(num)}\n\n${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME} - ${CALLERID(num)}: " > /tmp/sms.txt) | |
exten => sms,n,Set(FILE(/tmp/sms.txt,,,a)=${BASE64_DECODE(${SMS_BASE64})}) | |
exten => sms,n,System(sendmail -t < /tmp/sms.txt) | |
exten => sms,n,DongleSendSMS(dongle0,<Tu TELEFONO>,${BASE64_DECODE(${SMS_BASE64})} - De ${CALLERID(num)}) | |
exten => sms,n,Hangup() |
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 | |
function xml2array($contents, $get_attributes=1, $priority = 'tag') { | |
if(!$contents) return array(); | |
if(!function_exists('xml_parser_create')) { | |
//print "'xml_parser_create()' function not found!"; | |
return array(); | |
} |
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
<? | |
$domains = array('home.pl', 'w3c.org'); | |
function creation_date($domain) { | |
$lines = explode("n", `whois $domain`); | |
foreach($lines as $line) { | |
if(strpos(strtolower($line), 'created') !== false) { | |
return $line; | |
} | |
} |
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
<? | |
function downloadFile($file){ | |
$file_name = $file; | |
$mime = 'application/force-download'; | |
header('Pragma: public'); // required | |
header('Expires: 0'); // no cache | |
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); | |
header('Cache-Control: private',false); | |
header('Content-Type: '.$mime); | |
header('Content-Disposition: attachment; filename="'.basename($file_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
<? | |
function distance($lat1, $lon1, $lat2, $lon2, $unit) { | |
$theta = $lon1 - $lon2; | |
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); | |
$dist = acos($dist); | |
$dist = rad2deg($dist); | |
$miles = $dist * 60 * 1.1515; | |
$unit = strtoupper($unit); |
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 | |
// Define la ruta y nombre del archivo que se almacenara el cache | |
$cachefile = 'cached-files/'.date('M-d-Y').'.php'; | |
// define el tiempo que queremos esperar el archivo en segundos.Yo puse el mio en 5 horas. | |
$cachetime = 18000; | |
// Revisa si el cache sigue fresco (activo). En el caso de que si lo incluye y sale | |
if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) { | |
include($cachefile); | |
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
Estos son un conjunto de pequeños scripts para ayudar a entender cosas de programación |
NewerOlder