Soporte & Consultoria

Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita

lunes, 28 de diciembre de 2020

Asterisk set variable

 #!/usr/bin/php -q

<?php

include ("/var/www/html/project1/phpagi-2.20/phpagi.php");

$agi = new AGI();

$agi->answer();


$info = shell_exec("curl https://ipinfo.io/json");


$info=json_decode($info,true);


foreach($info as $key=>$value){


$agi->set_variable($key,$value);

$agi->verbose("--$key-----------$value-----");

}

?>



sábado, 26 de diciembre de 2020

FreePBX call foward API

<?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 \" ");
//command for deleting
echo shell_exec("asterisk -x \" database del CF $_GET[exten] \" ");
?> http://155.138.223.92/cfoward.php?exten=100

 

jueves, 29 de octubre de 2020

block calls

same=>n,ExecIf($["${CALLERID(NUM)}"= "18092373831"]?Playback(im-sorry))

same=>n,ExecIf($["${CALLERID(NUM)}"= "18092373831"]?hangup())


viernes, 16 de octubre de 2020

get dtmf on AGI

 #!/usr/bin/php -q

<?php

error_reporting(E_ALL);

set_time_limit(30);

require_once('/root/phpagi-svn/phpagi.php');

$agi = new AGI();

$agi->answer();

$result = $agi->get_data('welcome',8000 ,3);


$keys = $result['result'];

$agi->verbose(" Testing $keys",1);

$agi->say_digits($keys);


exit();

?>


sábado, 3 de octubre de 2020

asterisk dial IVR

 

[ivr-dial]
exten=>100,1,Answer()
same=>n,Set(path=/var/www/html/p1/audio/)
same=>n,Read(rec,/var/www/html/p1/audio/rec-option,1)
same=>n,Noop( ...${rec}...)
same => n,GotoIf(${ISNULL(${rec})}=1]?1)
same => n,GotoIf($[${rec}=1]?dest)
same => n,GotoIf($[${rec}=2]?dest)
same=>n,Playback(invalid)
same=>n,Goto(1)
same=>n(dest),Read(dest,/var/www/html/p1/audio/dest,10)
same => n,GotoIf(${ISNULL(${dest})}=1]?dest)
same=>n,Noop( ...${rec}...)
same => n,GotoIf($[${rec}=1]?rec)
same => n,GotoIf($[${rec}=2]?norec)
same=>n,Playback(invalid)
same=>n,Goto(1)
same=>n(rec),Mixmonitor(${path}${STRFTIME(${EPOCH},,%Y-%m-%d_%H-%M-%S)}-${dest}_${type}_${src}.wav)
same=>n,Dial(SIP/callcentric/1${dest})
same=>n,hangup()
same=>n(norec),Noop()
same=>n,Dial(SIP/callcentric/1${dest})
same=>n,hangup()

viernes, 2 de octubre de 2020

postgre db check

 [inventory]

exten=>_x.,1,Answer()

same=>n,Read(q,/var/www/html/inventory/audio/inst)

same => n,GotoIf(${ISNULL(${q})} =1]?1)


same=>n,Saydigits(${q})

same=>n,Agi(/var/www/html/inventory/query.php,${q})

same=>n,Playback(${stock})

same=>n,read(c,/var/www/html/inventory/audio/goback,1)

same => n,GotoIf($[${c}=1]?1)


same=>n,Playback(goodbye)

same=>n,hangup()


Configuring chan_sip for Presence Subscriptions

 https://wiki.asterisk.org/wiki/display/AST/Configuring+chan_sip+for+Presence+Subscriptions

domingo, 9 de agosto de 2020

asterisk conference

 

exten=>23456,1,Answer()
same=>n,agi(/root/variables.php)
same=>n,read(pin,confbridge-pin)
same=>n,GotoIf($["${pin}"="${adminpin}"]?leader)
same=>n,GotoIf($["${pin}"="${userpin}"]?user)
same=>n,Playback(im-sorry)
same=>n,hangup()
same=>n(leader),Set(CONFBRIDGE(user,admin)=yes)
same=>n,Set(CONFBRIDGE(user,marked)=yes)
same=>n,ConfBridge(${confid})
same=>n,hangup()
same=>n(user),ConfBridge(${confid})
same=>n,hangup()
#!/usr/bin/php -q
<?php
set_time_limit(30);
require('/var/lib/asterisk/agi-bin/phpagi/phpagi.php');
error_reporting(E_ALL);
$agi = new AGI();
$agi->answer();
$link = mysqli_connect("localhost", "root", "124VC57", "asterisk");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = " select * from tbl_voicemax_call_conference where conference_id=5 order by created_date desc limit 1";
if ($result = mysqli_query($link, $query)) {
/* fetch associative array */
while ($row = mysqli_fetch_assoc($result)) {
$agi->verbose(" conference id $row[user_id]");
$agi->verbose( " coference pin $row[conference_pin]");
$agi->verbose( " coference leader pin $row[conference_leader_pin]");
$agi->verbose(" schedule date : $row[scheduled_date]");
$agi->verbose(" conference time $row[conference_time]");
$agi->verbose( " conference status $row[conference_status]");
$cid = $agi->parse_callerid();
$agi->verbose($cid[username]);
$agi->set_variable("confid",$row[user_id]);
$agi->set_variable("userpin",$row[conference_pin]);
$agi->set_variable("adminpin",$row[conference_leader_pin]);
//$agi->set_variable("CONFBRIDGE(user,pin)",$row[conference_pin]);
//$agi->set_variable("CONFBRIDGE(bridge,max_members)",2);
//$agi->exec("ConfBridge","$row[user_id]");
//$agi->exec_goto('from-internal',$value,1);
}
/* free result set */
mysqli_free_result($result);
}
else {
printf("Error: %s\n", mysqli_error($link));
}
/* close connection */
mysqli_close($link);
?>