[AsteriskBrasil] Blacklist de saída

Telesurf Multimidia tele-surf em hotmail.com
Quinta Janeiro 9 09:55:50 BRST 2014


Olha se isto te server

[from-outgoing]exten => 555,1,NoOp(*** COLOQUE AQUI SEU DIALPLAN ***)exten => 555,n,Macro(blacklist-mysql,${EXTEN})exten => 555,n,Macro(checkblacklist,${EXTEN})exten => 555,n,Dial(SIP/telesurf/35298767,20,Tt)exten => 555,n,Hangup()
[macro-blacklist-mysql]exten => s,1,NoOp(*** Consulta Blacklist ***)exten => s,n,MYSQL(Connect connid localhost root mister funcoes)exten => s,n,MYSQL(Query resultid ${connid} SELECT\ evento\ FROM\ brlt\ WHERE\ numero=${ARG1})exten => s,n,MYSQL(Fetch fetchid ${resultid} RESULT)exten => s,n,MYSQL(Clear ${resultid})exten => s,n,MYSQL(Disconnect ${connid})exten => s,n,NoOp(${RESULT})exten => s,n,GotoIf($["${RESULT}" = "bloqueado"]?DESLIGA)exten => s,n,returnexten => s,n(DESLIGA),Hangup()

[macro-checkblacklist]; This Macro will check the blacklist table to see if the callerid of the; caller exist and blockenabled =1 (TRUE). If the callerid is listed, then; tell the caller they have been blacklisted and politely HangUp();; ${ARG1} = CallerID of incoming call;exten => s,1,MYSQL(Connect connid ${realdb_host} ${realdb_user} ${realdb_pass} ${realdb_db})exten => s,2,MYSQL(Query resultid ${connid} SELECT\ callerid\ from\ blacklist\ where\ callerid=${ARG1} and blockenabled = 1)exten => s,3,MYSQL(Fetch fetchid ${resultid} blacklistid)exten => s,4,MYSQL(Clear ${resultid})exten => s,5,MYSQL(Disconnect ${connid})exten => s,6,GoToIf($["${blacklistid}" = ""]?7:fail,1)exten => s,7,NoOp(${blacklistid}); If the callerid is listed in the database, then send to blacklistednumber; context;exten => fail,1,NoOp(${blacklistid})exten => fail,2,GoTo(blacklistednumber,s,1)
[blacklistednumber]; This is where a call will land if the macro-checkblacklist decides that; the number should not be allowed to dial the company.exten => s,1,Wait(2)exten => s,2,Playback(pbx-invalid)exten => s,3,Zapateller()exten => s,4,HangUp()

Date: Thu, 9 Jan 2014 09:23:06 -0200
From: sanderdabio em globo.com
To: asteriskbrasil em listas.asteriskbrasil.org
Subject: Re: [AsteriskBrasil] Blacklist de saída

Foi mal, esqueci de colocar uma outra opção, você pode criar algo mais sofisticado, tal como chamar um AGI e fazer uma consulta ao banco ou usar a consulta no próprio contexto... Vai depender do seu conhecimento e criatividade, mas o exemplo acima é o mais simples.


Att,


Em 9 de janeiro de 2014 09:19, Alex Sander <sanderdabio em globo.com> escreveu:

Acho que talvez você possa fazer assim:

exten = 12345678,1,Hangup()


Att,


Em 8 de janeiro de 2014 19:58, Santhiago Alves <santhiago2005 em gmail.com> escreveu:


Pessoal,
Alguém já trabalhou com blacklist para saída de ligações ?


Sds.Santhiago Alves

_______________________________________________

KHOMP: completa linha de placas externas FXO, FXS, GSM e E1

Media Gateways de 1 a 64 E1s para SIP com R2, ISDN e SS7

Intercomunicadores para acesso remoto via rede IP e telefones IP

Conheça todo o portfólio em www.Khomp.com

_______________________________________________

Para remover seu email desta lista, basta enviar um email em branco para asteriskbrasil-unsubscribe em listas.asteriskbrasil.org







_______________________________________________
KHOMP: completa linha de placas externas FXO, FXS, GSM e E1
Media Gateways de 1 a 64 E1s para SIP com R2, ISDN e SS7
Intercomunicadores para acesso remoto via rede IP e telefones IP
Conhe�a todo o portf�lio em www.Khomp.com
_______________________________________________
Para remover seu email desta lista, basta enviar um email em branco para asteriskbrasil-unsubscribe em listas.asteriskbrasil.org 		 	   		  
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: http://listas.asteriskbrasil.org/pipermail/asteriskbrasil/attachments/20140109/f5e9c3e7/attachment-0001.htm 


Mais detalhes sobre a lista de discussão AsteriskBrasil