function check_for_voicemail_box($exten, $silent = false, $self = true, $context = 'default')
{
    global $agi;
    $cmd = $agi->exec("MailboxExists", $exten . "@" . $context);
    $vmexists = agi_get_variable("VMBOXEXISTSSTATUS");
    if ($vmexists == "SUCCESS") {
        return True;
    } else {
        if (!$silent) {
            if ($self == True) {
                play_sound("custom/vm-you-no-box");
            } else {
                play_sound("custom/vm-no-box");
            }
        }
    }
    return False;
}
Exemplo n.º 2
0
#!/usr/bin/php -q
<?php 
require_once "/var/lib/asterisk/agi-bin/phpagi.php";
require_once "/var/lib/asterisk/agi-bin/chandu_custom.php";
$agi = new AGI();
function agi_get_variable($variable)
{
    global $agi;
    $tmp = $agi->get_variable($variable);
    return $tmp[data];
}
$UE_CARDNO = agi_get_variable("UE_CARDNO");
//$UE_PIN = agi_get_variable("UE_PIN");
$UE_AUTHENTICATED = agi_get_variable("TZ_AUTHENTICATED");
if ($UE_AUTHENTICATED) {
    $CT_UE_CARDNO = $newPassword = agi_get_variable("TaazaNEWPIN");
    $query_result = mssql_query("update dbo.[xxx Enterprises Limited\$MSR Card Link Setup] set Password='******' where [Card Number]='{$CT_UE_CARDNO}' ;", $db_conn) or die("some error");
} else {
    // NOT authenticated .. you should not have reached here
}
Exemplo n.º 3
0
#!/usr/bin/php -q
<?php 
require_once "/var/lib/asterisk/agi-bin/phpagi.php";
require_once "/var/lib/asterisk/agi-bin/chandu_custom.php";
/*
$agi->set_variable("_LoggedIn",$auth);
$agi->verbose("Missing list");
exit(1);
*/
$agi = new AGI();
function agi_get_variable($variable)
{
    global $agi;
    $tmp = $agi->get_variable($variable);
    return $tmp[data];
}
$THISFAXFILENAME = "/recvd_faxes/" . agi_get_variable("THISFAXFILENAME") . ".pdf";
$FAX_FROM = agi_get_variable("CallerIDString");
$email = new sendaMail();
$email->messageTo("*****@*****.**");
$email->subject("You should be reeceiving new fax in a minute");
$email->body("You have received a new fax from : {$FAX_FROM} , FileName: {$THISFAXFILENAME} ");
$email->send();
// email this_faxfilename
$email = new sendaMail();
$email->messageTo("*****@*****.**");
$email->subject("New Fax from {$FAX_FROM}");
$email->body("You have received a new fax from : {$FAX_FROM} ");
$email->AddAttachment($THISFAXFILENAME);
// Optional
$email->send();
Exemplo n.º 4
0
#!/usr/bin/php -q
<?php 
require_once "/var/lib/asterisk/agi-bin/phpagi.php";
require_once "/var/lib/asterisk/agi-bin/chandu_custom.php";
$agi = new AGI();
function agi_get_variable($variable)
{
    global $agi;
    $tmp = $agi->get_variable($variable);
    return $tmp[data];
}
$UE_CARDNO = agi_get_variable("TaazaUserId");
//$UE_PIN = agi_get_variable("TaazaPIN");
$UE_AUTHENTICATED = agi_get_variable("TZ_AUTHENTICATED");
if ($UE_AUTHENTICATED == 'true') {
    $CT_UE_CARDNO = CT_CARDNUMBER($UE_CARDNO);
    $query_result = mssql_query("select Sum([Transaction Points]) from dbo.[xxx Enterprises Limited\$Loyalty Points Transactions] where [Card No_]='{$CT_UE_CARDNO}' ;", $db_conn) or die("some error");
    $result = array();
    while ($row = mssql_fetch_array($query_result)) {
        $result[] = $row;
    }
    if (count($result == 1)) {
        $rewardPoints = $result[0]['computed'];
        $agi->set_variable("TZ_REWARDPOINTS", $rewardPoints);
    } else {
    }
} else {
    // NOT authenticated .. you should not have reached here
}