Soporte & Consultoria

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

miércoles, 23 de septiembre de 2015

executing an script before a queue call on freepbx

[from-internal-custom]

exten=>_14802708457,1,Noop( Call from ${CALLERID(num)})

same=>n,System(curl http://datatoolbox.net/leads/ -G -d"publisher_user_name=admin&publisher_password=1234&publisher_id=17&lead_type=Medical%20Alert&home_phone=${CALLERID(num)}")
same=>n,Goto(from-trunk,${EXTEN},1)
;same=>n,Goto(ext-queues,9991,1)

lunes, 14 de septiembre de 2015

Fixing the blank modify user on vicidial

1) cd /usr/src/astguiclient/trunk

2) svn up

3) Going into mysql and executing the upgrade sql file:
a) mysql
b) use asterisk
c) \. /usr/src/astguiclient/trunk/extras/upgrade_2.12.sql
d) quit

http://www.vicidial.org/VICIDIALforum/viewtopic.php?f=4&t=34824&sid=a0c6d9246c219b60131ac2001f742533

domingo, 6 de septiembre de 2015

Renato system

[inbound]
exten=>s,1,Goto(inbound,_x.,1)
exten=>_x.,1,Set(__FECHA=${STRFTIME(${EPOCH},,%Y-%m-%d_%H-%M-%S)}_${CALLERID(num)})
exten=>_x.,2,MixMonitor(/var/www/html/recordings/${FECHA}.wav)
exten=>_x.,3,Answer()
same=>n,Playback(/var/www/html/sounds/intro)
;same=>n,Set(TIMEOUT(absolute)=200)
same=>n,Set(__msg=${STRFTIME(${EPOCH},,%Y-%m-%d_%H-%M-%S)}_${CALLERID(num)})
same=>n,Record(/var/www/html/recordings/${msg}.wav,,60)
same=>n,Wait(1)
same=>n,Playback(/var/www/html/sounds/name)
same=>n,Set(__name=${STRFTIME(${EPOCH},,%Y-%m-%d_%H-%M-%S)}_${CALLERID(num)})
same=>n,Record(/var/www/html/recordings/${name}.wav,,60)
same=>n,Wait(1)
same=>n,Playback(/var/www/html/sounds/redirect)
same=>n,System(/usr/bin/sox /var/www/html/recordings/${name}.wav /var/www/html/recordings/${msg}.wav /var/www/html/recordings/${name:-5}.wav)
same=>n,Dial(Local/0@overflow)
;same=>n,confbridge(${UNIQUEID})
;same=>n,Dial(SIP/109)
;same=>n,Dial(Local/1924@spy-exten,30,G(recording^0^1))
;same=>n,playback(goodbye)
;exten=>h,1,System(/usr/bin/mpack -s "Asterisk Dominicana ${FECHA}" /var/lib/asterisk/sounds/${FECHA}.wav ambiorixg12@hotmail.com,ambiorixg12@gmail.com)
;exten=>h,1,System(/usr/bin/mpack -s "Asterisk Dominicana ${FECHA}" /var/www/${FECHA}.wav ambiorixg12@hotmail.com,ambiorixg12@gmail.com)



[overflow]
exten=>0,1,Dial(SIP/2656671/+5511963244661,15,A(/var/www/html/recordings/${name:-5}))
same => n,GotoIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)

same=>n(unavail),Playback(ss-noservice)
same=>n,Hangup()

same=>n(busy),Playback(ss-noservice)
same=>n,Hangup()
exten=>h,1,System(/bin/echo Listen to the http://31.220.22.105/recordings/${name:-5}.wav | mail -s  Missed call from  ${CALLERID(num)}  atendimento@avitis.com.br,ambiorixg12@gmail.com)


;exten=>0,1,Dial(SIP/2656671/+5511963244661,,A(/var/www/html/recordings/${msg}))
;exten=>0,1,Dial(SIP/100,,A(/var/www/html/recordings/${name:-5}))


jueves, 3 de septiembre de 2015

FOP2 admin login script


/var/www/html/fop2/admin/index.php


agregamos la linea  
require_once("login.php");



###################Login Script called login.php############
###
<?php


  $dbhost='localhost';
        $dbuser='root';
        $dbpass=71345;
        $dbname='asterisk';

        $db = mysql_connect($dbhost, $dbuser, $dbpass) or die("Couldn't connect to the database.");

        mysql_select_db($dbname) or die("Couldn't select the database");



    //--------------- AUTHENTICATION MODULE --------------------------

        function displayLogin() {
                header("WWW-Authenticate: Basic realm=\"Ambiorix\"");
                header("HTTP/1.0 401 Unauthorized");
                echo "<h2>Authentication Failure</h2>";
                echo "The username and password provided did not work. Please reload this page and try again.";
                exit;
        }



        if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) {
                // If username or password hasn't been set, display the login request.
                displayLogin();
        } else {
                // Escape both the password and username string to prevent users from inserting bogus data.
                $PHP_AUTH_USER = addslashes($_SERVER['PHP_AUTH_USER']);
                //$PHP_AUTH_PW = md5($PHP_AUTH_PW);
                $PHP_AUTH_PW = $_SERVER['PHP_AUTH_PW'];

                // Check username and password against the database.
                $result = mysql_query("SELECT count(id) FROM fop2users WHERE secret='$PHP_AUTH_PW' AND exten='$PHP_AUTH_USER' ") or exit();

                $num = mysql_result($result, 0);

                if (!$num) {
                        // If there were no matching users, show the login
                        displayLogin();
                }
        }

?>