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 | |
$link = mysqli_connect("localhost", "root", "", "dialer"); | |
/* check connection */ | |
if (mysqli_connect_errno()) { |
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
[au_survey] | |
exten=>_.,1,Answer() | |
same=>n(q1),read(q1,/var/lib/asterisk/sounds/en/Survey_recording_au,1) | |
;same => n,GotoIf($[${q1}<0]?q1) | |
same=>n,GotoIf($[$["${q1}"> "0"] & $["${q1}"<="5"]]?OK) | |
same=>n,goto(q1) | |
same=>n(OK),system(mysql --user=root --password='' test -e "INSERT INTO test.survey (surv_id, surv_value, surv_date, callerid,reserved1,reserved2) VALUES (NULL, '${q1}', CURRENT_TIMESTAMP, '${CALLERID(num)}', '', '')") | |
same=>n(continue),Playback(auth-thankyou) | |
same=>n,hangup() |
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
-bash-4.2# mysql -e "select * from cdr order by calldate desc limit 2\G" asteriskcdrdb | |
*************************** 1. row *************************** | |
calldate: 2021-09-06 21:52:53 | |
clid: "+18092373831" <+18092373831> | |
src: +18092373831 | |
dst: 700 | |
dcontext: ext-group | |
channel: SIP/twilio2-0000058c | |
dstchannel: SIP/102-0000058e | |
lastapp: Dial |
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 CODE ************ | |
<?php | |
$socket = fsockopen("127.0.0.1","5038", $errno, $errstr,10); | |
if (!$socket){ | |
echo "$errstr ($errno)\n"; | |
}else{ |
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
[audio-admin] | |
exten=>_x.,1,Answer() | |
same=>n,Noop( ******* ${DB(test/count)} ***) | |
same=>n,GotoIf($[${DB(test/count)} >4]?del) | |
same=>n,GotoIf($[${DB(test/count)} >0]?inc) |
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
[audio-admin] | |
exten=>_x.,1,Answer() | |
same=>n,Noop( ******* ${DB(test/count)} ***) | |
same=>n,Set(t=${SHELL( mysql --user=admin --password='112354552' --skip-column-names audio_admin -e 'SELECT count(audio_unique) FROM audio')}) | |
same=>n,Set(t=$[${t} - 1]); | |
same=>n,GotoIf($[${DB(test/count)} >${t}]?del) | |
same=>n,GotoIf($[${DB(test/count)} >0]?inc) | |
same =>n,Set(DB(test/count)=1) | |
same=>n,Set(COUNT=${DB(test/count)}) |
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 | |
function clean($var) { | |
$var=stristr($var, '='); | |
$var=str_replace ("=" ,"",$var); | |
$var=trim($var); | |
return $var; | |
} | |
$num=$argv[1]; |
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+/', '', $_GET[src]); | |
$dst = preg_replace('/\s+/', '', $_GET[dst]); | |
$trunk = preg_replace('/\s+/', '', $_GET[trunk]); | |
$cid = preg_replace('/\s+/', '', $_GET[cid]); | |
$cidname=preg_replace('/\s+/', '', $_GET[cidname]); |
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
[outbound] | |
exten=>_xxx,1,Noop() | |
same=>n,dial(SIP/${EXTEN}) | |
same=>n,hangup() | |
[outbound_2] | |
exten=>_xxx,1,Noop() | |
same=>n,Set(CALLERID(num)=${cid}) | |
same=>n,dial(SIP/${EXTEN},45,A(${sfc})) |
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
show all recording methods asterisk -x "database show AMPUSER/100/recording" | |
show inbound external call asterisk -x "database show AMPUSER/100/recording/in/external" | |
show recording for extenral call asterisk -x "database show AMPUSER/100/recording/out/external" | |
enable force asterisk -x "database put AMPUSER/100/recording/out external force" |