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
tcpdump -nq -s 0 -i eth0 -w /tmp/sip`date +%Y%m%d%H%M%S`.pcap port 5060 or udp portrange 10000-20000 | |
tcpdump -nq -s 0 -i eth0 -w /tmp/sip`date +%Y%m%d%H%M%S`.pcap port 5060 |
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/python | |
# -*- coding: utf-8 -*- | |
#description :Importar arquivo CNL Anatel para bd MySQL | |
#author :Rafael Saraiva | |
#email :rafaelsnsa@gmail.com | |
#date :20170428 | |
#version :1.0 | |
#usage :python cnl.py | |
#python_version :2.7.3 |
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 from-sip { | |
_1XX => { | |
Dial(SIP/${EXTEN}); | |
}; | |
*48 => { | |
Answer(); | |
timezone = "America/Sao_Paulo"; | |
begin: | |
opt = 0; |
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
#!/bin/sh | |
# enable_snmp_version.sh | |
file="/etc/snmp/snmpd.conf" | |
#echo "view systemview included .1" >> $file | |
echo "exec serial /sbin/version -s" >> $file | |
echo "exec firmware /sbin/version -f" >> $file | |
echo "exec board /sbin/version -b" >> $file | |
cp -r /etc/snmp /mnt/config/ |
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
#!/bin/bash | |
## Nome : ipbx.sh | |
## Descrição : Instala Asterisk, pacotes e bibliotecas necessárias | |
## Autor : Rafael Saraiva (Porto Alegre/ RS - Brazil) | |
## E-mail : rafaelsnsa@gmail.com | |
## Versão : 1.0 | |
## OS : CentOS release 6.7 (Final) | |
## Nota : Revise o script antes de executar, utilize-o por sua própria conta e risco, não me responsabilizo por eventuais implicações no seu sistema. | |
ASTERISK="http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz" |
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
exten => _X.,1,Proceeding() | |
same => n,NoOp(${MFCR2_CATEGORY}) | |
same => n,GotoIf($["${MFCR2_CATEGORY}" = "Collect Call"]?block:allow) | |
same => n(allow),Dial(SIP/${EXTEN},30,T) | |
same => n(block),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
exten => _X.,1,Proceeding() | |
same => n,GotoIf($["${CHANNEL(reversecharge)}" = "-1"]?allow:block) | |
same => n(allow),Dial(SIP/${EXTEN},30,tT) | |
same => n(block),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
[pbx] | |
exten => _X.,1,Read(minhasenha,digitesuasenha,4) | |
same => n,Set(SENHA=1234) | |
same => n,GotoIf($[${MINHASENHA}=${SENHA}]?autorizado:negado) | |
same => n(autorizado),Goto(menu1,,1) | |
same => n(negado),Playback(senhaincorretatentenovamente) | |
same => n,Goto(pbx,,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
[pbx] | |
exten => 200,1,GotoIf($[${CALLERID(num)}=100]?sim:nao) ;Teste lógico; | |
same => n(sim),Playback(ola) ;Rótulo "sim"; | |
same => n(nao),HangUp ;Rótulo "nao"; |
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
[macro-dial] | |
exten => s,1,Set(PROTOCOLO=${ARG1}) | |
same => n,Set(DESTINO=${ARG2}) | |
same => n,Set(CONTEXTO=${ARG3}) | |
same => n,Set(_TRANSFER_CONTEXT=${CONTEXTO}) ;A declaração desta variável é necessária pelo fato de que não estamos mais no contexto do usuário SIP que originou a chamada, logo, precisamos definir, em caso da transferência da ligação, para qual contexto ela deve ser encaminhada; | |
same => n,Proceeding | |
same => n,Dial(${PROTOCOLO}/${DESTINO},30,t) | |
same => n,Goto(${DIALSTATUS},1) | |
exten => _${DIALSTATUS},1,Busy(3) |
NewerOlder