2014년 3월 27일 목요일

asterisk codecs.conf for use speex codec

os : centos 6.5
asterisk : 11.6.1
requirements : speex-1.2rc1 installed & asterisk remake

*Table 4:* Quality versus bit-rate
Mode Bit-rate (bps) mflops Quality/description
0 250 N/A No transmission (DTX)
1 2,150 6 Vocoder (mostly for comfort noise)
2 5,950 9 Very noticeable artifacts/noise, good intelligibility
3 8,000 10 Artifacts/noise sometimes noticeable
4 11,000 14 Artifacts usually noticeable only with headphones
5 15,000 11 Need good headphones to tell the difference
6 18,200 17.5 Hard to tell the difference even with good headphones
7 24,600 14.5 Completely transparent for voice, good quality music
8 3,950 10.5 Very noticeable artifacts/noise, good intelligibility

vi /etc/asterisk/codecs.conf

[speex]
;0-10
quality => 4
;0-10
complexity => 4
; true / false
enhancement => true
; true / false
vad => false
; true / false
vbr => false
; 0 = off, otherwise, target bitrate in bps
abr => 8000
;0-10
vbr_quality => 5
; true / false
dtx => false

CLI>reload

origin : http://lists.digium.com/pipermail/asterisk-users/2005-January/073992.html

two nic's port forwarding in iptables

os : centos 6.5
iptables : 1.4.7

forward dest port : 9090
forward dest ip : 192.168.0.100
my machine lan : eth0 : 192.168.0.200
my machine wan : eth1 : 100.100.100.100


[ my machine work ]

vi /etc/sysctl.conf
net.ipv4.ip_forward = 1

sysctl -p /etc/sysctl.conf

cat /proc/sys/net/ipv4/ip_forward

5222, 9090, 8766

iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 9090 -j DNAT --to 192.168.0.100:9090
iptables -A FORWARD -p tcp -d 192.168.0.100 --dport 9090 -j ACCEPT

iptables -t nat -A POSTROUTING -j MASQUERADE -o eth0

/etc/init.d/iptables save

[ forword rule delete ]

iptables -L FORWARD --line-numbers

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
1    ACCEPT     tcp  --  anywhere             192.168.0.100       tcp dpt:xmpp-client
2    ACCEPT     tcp  --  anywhere             192.168.0.100       tcp dpt:websm

iptables -D FORWARD 2

## iptables all delete
iptables -F

2014년 3월 25일 화요일

kamailio logging config in centos

vi /etc/rsyslog.conf
- edit & add
local0.* -/var/log/kamailio/kamailio.log

vi /etc/logrotate.d/kamailio
- new
/var/log/kamailio/kamailio.log {
    missingok
    size=50M
    create 0644 root root
    postrotate
  /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

reboot

/usr/local/sbin/kamctl start
/usr/local/sbin/kamailio -ddddddddddddddd -D 2

2014년 3월 24일 월요일

odbc use with asterisk

asterisk build 하기전에 아래 요소들이 필요 하다
없으면 'odbc' but the engine is not available 요딴 에러가 발생 한다

yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel

2014년 3월 18일 화요일

ngrep capture

ngrep -d eth1 -itq -W byline
ngrep -W byline -d eth0 port 5060
ngrep -W byline -d eth0 port 5060 -O capture_file
ngrep -W byline -d eth0 INVITE

mysql ui tool for mac

http://www.sequelpro.com/

2014년 3월 7일 금요일

linux 에서 추가 설치했던 lan driver 삭제

머, 정확히는 잘 모르겠지만,
기존에 쓰던 via-rhine lan card 가 장착된 pc
여기서 realtek lan card 를 하나 더 장착, 8139too 로 올라온다
근데 이넘이 드라이버는 다 올라온거 같은데, rx 쪽이 전부 error 로 떨어진다
shutdown 하고, realtek 빼고, 다른 realtek 장착

lsmod | grep 8139 하니, 8139too, 8139cp 요렇게 2개 보인다

ifconfig 하면 기존 via card 만 보인다

그래서 기존 꺼 삭제 rmmod -f 8139too

[root@localhost network-scripts]# lspci | grep -i Ethernet
00:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78)

이제 2개가 보이는데, ifconfig 하면 eth1은 없고, eth2 가 생겼다

vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x1106:0x3065 (via-rhine)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:16:ec:05:b9:fe", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:c0:26:73:a4:03", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:ee:b1:02:bf:3b", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

rm /etc/udev/rules.d/70-persistent-net.rules

reboot 후 다시 정리되서 eth0, eth1 이 보이고, 설정데로 ping 도 응답하기 시작 했다

아래의 부팅 후 dmesg

[root@localhost ~]# dmesg | grep eth
eth0: RealTek RTL8139 at 0xf820c000, 00:ee:b1:02:bf:3b, IRQ 16
udev: renamed network interface eth0 to eth1
eth0: VIA Rhine II at 0xf6011000, 00:16:ec:05:b9:fe, IRQ 23.
eth0: MII PHY found at address 1, status 0x786d advertising 05e1 Link 45e1.
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
eth1: link up, 100Mbps, full-duplex, lpa 0x45E1
eth0: no IPv6 routers present
eth1: no IPv6 routers present




2014년 3월 4일 화요일

Check linux distributions

[root@localhost ~]# find /etc/*-release | xargs cat
CentOS release 6.3 (Final)
CentOS release 6.3 (Final)
CentOS release 6.3 (Final)
[root@localhost ~]#