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
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just | |
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime | |
" you can find below. If you wish to change any of those settings, you should | |
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten | |
" everytime an upgrade of the vim packages is performed. It is recommended to | |
" make changes after sourcing debian.vim since it alters the value of the | |
" 'compatible' option. | |
" This line should not be removed as it ensures that various options are | |
" properly set to work with the Vim-related packages available in Debian. |
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
CREATE DATABASE asterisk; | |
\c asterisk | |
CREATE TABLE extensions ( | |
id serial, | |
context character varying(20) default '' NOT NULL, | |
exten character varying(20) default '' NOT NULL, | |
priority smallint default 0 NOT NULL, | |
app character varying(20) default '' NOT NULL, |
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
[verifica-login] | |
exten => _X.,1,Answer() | |
exten => _X.,2,Wait(1) | |
exten => _X.,3,Playback(digite-login) | |
exten => _X.,4,Read(Login,,4,,,) | |
exten => _X.,5,Playback(digite-senha) | |
exten => _X.,6,Read(Senha,,4,,,) | |
exten => _X.,7,AGI(login.agi,${Login},${Senha}) | |
exten => _X.,8,GotoIf( $[ "${MENSAGEM}" == "failure" ]?desliga:continua) | |
exten => _X.,9(desliga),Playback(senha-errada) |
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
CREATE TABLE login_ast ( | |
login_id SERIAL, | |
nome varchar(30) NOT NULL, | |
login integer NOT NULL, | |
senha integer NOT NULL, | |
contexto varchar(30) NOT NULL, | |
CONSTRAINT login_ast_pk PRIMARY KEY (nome, login, senha, contexto), | |
CONSTRAINT login_ast_idx UNIQUE (login) | |
); |
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
#!/usr/bin/php5 -q | |
<?php | |
require_once('/var/lib/asterisk/agi-bin/phpagi/phpagi.php'); | |
set_time_limit(10); | |
$agi = new AGI(); | |
$login = $argv[1]; | |
$senha = $argv[2]; |
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
context verifica-login { | |
_X. => { | |
Answer(); | |
Wait(1); | |
Playback(digite-login); | |
Read(login,,4,,,); | |
Set(pass=${DB(Senha/${login})}); | |
Authenticate(${pass},d); | |
Set(CDR(userfield)=${login}); | |
goto ${login},${EXTEN},1; |
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
[verifica-login] | |
exten => _X.,1,Answer() | |
exten => _X.,2,Wait(1) | |
exten => _X.,3,Playback(digite-login) | |
exten => _X.,4,Read(login,,4,,,) | |
exten => _X.,5,Set(pass=${DB(Senha/${login})}) | |
exten => _X.,6,Authenticate(${pass},d) | |
exten => _X.,7,Set(CDR(userfield)=${login}) | |
exten => _X.,8,Goto(${login},${EXTEN},1) | |
exten => _X.,9,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
context saida-de-ligacoes { | |
_X. => { | |
Answer(); | |
Wait(1); | |
Set(Pass=${DB(Senha/${CALLERID(num)})}); | |
Authenticate(${Pass},d); | |
Set(CDR(userfield)=${Pass}); | |
Dial(...); | |
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
[saida-de-ligacoes] | |
exten => _X.,1,Answer() | |
exten => _X.,2,Wait(1) | |
exten => _X.,3,Set(Pass=${DB(Senha/${CALLERID(num)})}) | |
exten => _X.,4,Authenticate(${Pass},d) | |
exten => _X.,5,Set(CDR(userfield)=${Pass}) | |
exten => _X.,6,Dial(...) | |
exten => _X.,7,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
context desvios { | |
includes { | |
desvio-imediato; | |
desvio-ocupado; | |
desvio-timeout; | |
} | |
} | |
context desvio-imediato { | |
*50 => { |
NewerOlder