Quantcast
Channel: なんでもDIY
Viewing all 1419 articles
Browse latest View live

アドレスV50G 発進時に微妙に息継ぎがある

$
0
0

エンジンコンディショナーをプラグ穴に噴射、1時間放置

変化なし

シートを外しスロットルボディにエンジンコンディショナーで洗浄

変化なし

バッテリー交換

プラグ交換

変化なし

ベルト交換

car speed 分離式! 強化イグニッションコイルに交換 すこし加工取り付け

変化なし

 

プラグの焼け具合を見ると白っぽい

燃料が足りない?

エアフィルタを灯油で洗浄後、エンジンオイルを塗る

プラグを取り、エンジンコンディショナーを噴射、一晩放置

ガソリンが少なかったので満タン

以上で直った

考察

エンジンコンディショナー1時間放置ではだめ

一晩放置が必要だったかも

このような症状が出た時はまず一晩放置処理で様子を見る

これで直らなかったら次の段階に進む


asterisk ppp0 iptables

$
0
0

iptables -A INPUT -i ppp0 -p udp -m udp –dport 5060 -j ACCEPT

iptables -A INPUT -i ppp0 -p udp -m udp –dport 10000:20000 -j ACCEPT

#内部から通信を始めた場合のパケットは許可
iptables -A INPUT -i ppp0 -m state –state ESTABLISHED,RELATED -j ACCEPT

#自ホストからの通信は問答無用で全部通してやる
iptables -A INPUT -i lo -j ACCEPT

 

ping(icmp)許可
iptables -A INPUT -p icmp --icmp-type any -j ACCEPT

 

iptables -A INPUT -p udp -m udp –dport 5060 -j ACCEPT
iptables -A INPUT -p udp -m udp –dport 10000:20000 -j ACCEPT

#内部から通信を始めた場合のパケットは許可
iptables -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT

#ssh許可
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#http許可
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

iptables -A INPUT -j REJECT –reject-with icmp-host-prohibited

iptablesのルールを保存する

iptables-save > /etc/iptables.conf

 

起動時に適用する

vi /etc/rc.local

#追記

# Load iptables rules from this file

iptables-restore < /etc/iptables.conf

raspbx compile Asterisk install

$
0
0
apt-get remove asterisk11 asterisk13
apt-get install build-essential libsqlite3-dev libxml2-dev libncurses5-dev libncursesw5-dev libmysqlclient-dev libiksemel-dev libssl-dev libnewt-dev libusb-dev libeditline-dev libedit-dev curl libcurl4-gnutls-dev libjansson-dev
cd /usr/src/
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar -xvzf asterisk-13-current.tar.gz
cd asterisk-*
./configure
make menuconfig

make make install

元に戻すには

apt-get install asterisk13

raspbx asterisk11をasterisk13 upgrade

$
0
0
raspbx-upgrade
apt-get update
amportal stop
apt-get purge asterisk11
apt-get install asterisk13
amportal start

raspbx Interval Too Brief error

$
0
0

vi /etc/asterisk/sip_general_additional.conf

追記

maxexpirey=3600
defaultexpirey=3600

x86 asterisk14 codec_g729

$
0
0
# apt-get update && apt-get upgrade
# apt-get install build-essential
# apt-get install dh-autoreconf

# cd /usr/local/src
# wget http://download-mirror.savannah.gnu.org/releases/linphone/plugins/sources/bcg729-1.0.0.tar.gz
# tar xzf bcg729-1.0.0.tar.gz
# cd bcg729-1.0.0
# ./configure --libdir=/lib
# make
# make install

# cd /usr/local/src
# wget http://asterisk.hosting.lv/src/asterisk-g72x-1.4.tar.bz2
# tar -jxvf asterisk-g72x-1.4.tar.bz2
# cd asterisk-g72x-1.4
# ./autogen.sh 
# ./configure --with-asterisk140 --with-bcg729 --with-asterisk-includes=/usr/include
# make
# make install
# reboot

参考サイト https://techfoxweb.wordpress.com/2017/02/23/g729-raspbx-in-raspberry-pi-3/

chan_sip.c:23797 handle_response_peerpoke: Peer ‘301’ is now Lagged. (2283ms / 2000ms)

$
0
0

chan_sip.c:23797 handle_response_peerpoke: Peer ‘301’ is now Lagged. (2283ms / 2000ms)

vi /etc/asterisk/sip_additional.conf

……

#qualify=yes

qualify=2000

…..

dongle モデムとして認識させる

$
0
0

モデムとして認識されない

lsusb  認識されているか?
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 04ca:3007 Lite-On Technology Corp. 
Bus 001 Device 004: ID 0930:6544 Toshiba Corp. Kingston DataTraveler 2.0 Stick (2GB)
Bus 001 Device 005: ID 12d1:1446 Huawei Technologies Co., Ltd. E1552/E1800/E173 (HSPA modem)
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb -v -s 001:005   詳細表示
ここで出てきた、ベンダーIDとプロダクトIDをメモします

idVendor 0x12d1 Huawei Technologies Co., Ltd.

idProduct 0x1446 E1552/E1800/E173 (HSPA modem)

 

USBの認識状態を変更してくれる、usb_modeswitchをインストールします

apt-get install usb-modeswitch

 

vi  /etc/usb_modeswitch.d/12d1\:1446

##################################################
 # Huawei, newer modems

DefaultVendor= 0x12d1
 DefaultProduct=0x1446

TargetVendor=  0x12d1
 TargetProductList="1001,1406,140b,140c,141b,14ac"

CheckSuccess=20

MessageContent="55534243123456780000000000000011060000000000000000000000000000"

 

 usb_modeswitch -c /etc/usb_modeswitch.d/12d1\:1446

確認

ls /dev/tty*

 

vi /etc/rc.local

 usb_modeswitch -c /etc/usb_modeswitch.d/12d1\:1446

astrerisk13 dongle compile

$
0
0

https://github.com/wdoekes/asterisk-chan-dongle

cd /usr/src

wget https://github.com/wdoekes/asterisk-chan-dongle/archive/master.zip

apt-get install unzip

unzip master.zip

cd  asterisk-chan-dongle-master

./bootstrap

./configure --with-astversion=13.15
make
make install

 

確認

/usr/lib/asterisk/modules/chan_dongle.so

 

設定ファイルのコピー

cd etc

cp dongle.conf /etc/asterisk

 

asterisk compile sip 5160

$
0
0

asterisk をソースからインストールすると

sip のポートが 5160になっている

変更する必要がある 5060 に変更する

pjsip は 5060になっているので 5160 に変更する

HT-503 ひかり電話 設定

$
0
0

Impedance-based: 600R-600orms

Caller ID Scheme: japan

Caller ID Transport Type:  Relay via SIP FROM
Country-based  japan
PSTN Disconnect Tone:  f1=425@-17,c=200/200
Stage Method (1/2):   1

raspbx asterisk 構築後の最低限の設定

$
0
0
apt-get install fake-hwclock

apt-get install dnsmasq
cd /etc
mv resolv.conf resolv.conf.dnsmasq

vi /etc/dnsmasq.conf
# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
resolv-file=/etc/resolv.conf.dnsmasq

vi /etc/resolv.conf
nameserver 127.0.0.1

/etc/init.d/dnsmasq restart

raspbxの場合

raspi-config

locale timezone 変更

passwd root

adduser ckenko25


ログファイルを空にする

$
0
0
cp /dev/null /var/log/asteriek/full

dongle 着信させる

$
0
0

vi /etc/asterisk/extensions_custom.conf

[hgw-custom]
exten => s,1,Set(DESTNUM=${SIP_HEADER(To)})
exten => s,n,NoOp(${DESTNUM})
exten => s,n,Set(DESTNUM=${DESTNUM:1:10})
exten => s,n,Goto(from-trunk,${DESTNUM},1)

[from-trunk-dongle]
exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,Set(FILE(/var/log/asterisk/sms.txt,,,a)=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} – ${DONGLENAME} – ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,System(echo >> /var/log/asterisk/sms.txt)
exten => sms,n,Hangup()
exten => _.,1,Set(CALLERID(name)=${CALLERID(num)})
exten => _.,n,Goto(from-trunk,${EXTEN},1)

[hgw-custom]
exten => s,1,Set(DESTNUM=${SIP_HEADER(To)})
exten => s,n,NoOp(${DESTNUM})
exten => s,n,Set(DESTNUM=${DESTNUM:1:10})
exten => s,n,Goto(from-trunk,${DESTNUM},1)

[from-trunk-dongle]
exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,Set(FILE(/var/log/asterisk/sms.txt,,,a)=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} – ${DONGLENAME} – ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,System(echo >> /var/log/asterisk/sms.txt)
exten => sms,n,Hangup()
exten => _.,1,Set(CALLERID(name)=${CALLERID(num)})
exten => _.,n,Goto(from-trunk,${EXTEN},1)

asterisk14 dongle

$
0
0

https://github.com/wdoekes/asterisk-chan-dongle

cd /usr/src

wget https://github.com/wdoekes/asterisk-chan-dongle/archive/master.zip

apt-get install unzip

unzip master.zip

cd  asterisk-chan-dongle-master

./bootstrap

./configure --with-astversion=14.4
make
make install

 

確認

/usr/lib/asterisk/modules/chan_dongle.so

 

設定ファイルのコピー

cd etc

cp etc/dongle.conf /etc/asterisk


HT-503 トランク設定

$
0
0

トランク名

HT503

アウトバウンドのピア詳細

host=HT-503のIP
user=HT503
username=HT503
secret=HT-503に設定したパスワード
type=peer
directmedia=no
insecure=port,invite
dtmfmode=auto
nat=no
port=5062
qualify=yes
context=from-pstn

ユーザーコンテキスト

from-pstn

インパウンドのピア詳細

host=HT-503のIP
user=HT503
username=HT503
secret=HT-503に設定したパスワード
type=peer
directmedia=no
insecure=port,invite
dtmfmode=auto
nat=no
port=5062
qualify=yes
context=from-pstn

 

参考サイトhttp://www.asterweb.org/i/tutorial_guida_grandstream_ht_503_configurazione_avanzata_e_trunk_sip.php

 

HT-702 着信 相手と通話できない

$
0
0

Caller ID Scheme」を「NTT Japan」に設定すると着信音が鳴るのですが通話できない

Caller ID Scheme を Bellcore/Telcordia に変更すると正常に通話できた

armhf asterisk g729 compile

$
0
0
# apt-get update && apt-get upgrade
# apt-get install build-essential
# apt-get install dh-autoreconf

# cd /usr/local/src
# wget http://download-mirror.savannah.gnu.org/releases/linphone/plugins/sources/bcg729-1.0.0.tar.gz
# tar xzf bcg729-1.0.0.tar.gz
# cd bcg729-1.0.0
# ./configure --libdir=/lib
# make
# make install

# cd /usr/local/src
# wget http://asterisk.hosting.lv/src/asterisk-g72x-1.4.tar.bz2
# tar -jxvf asterisk-g72x-1.4.tar.bz2
# cd asterisk-g72x-1.4
# ./autogen.sh 
# ./configure CFLAGS='-march=armv6' --with-asterisk140 --with-bcg729 --with-asterisk-includes=/usr/include
# make
# make install
# reboot

参考サイト https://techfoxweb.wordpress.com/2017/02/23/g729-raspbx-in-raspberry-pi-3/

asterisk dongle.conf

$
0
0

[general]

interval=15 ; Number of seconds between trying to connect to devices

;—————————— JITTER BUFFER CONFIGURATION ————————–
;jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
; Dongle channel. Defaults to “no”. An enabled jitterbuffer will
; be used only if the sending side can create and the receiving
; side can not accept jitter. The Dongle channel can’t accept jitter,
; thus an enabled jitterbuffer on the receive Dongle side will always
; be used if the sending side can create jitter.

;jbforce = no ; Forces the use of a jitterbuffer on the receive side of a Dongle
; channel. Defaults to “no”.

;jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.

;jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is
; resynchronized. Useful to improve the quality of the voice, with
; big jumps in/broken timestamps, usually sent from exotic devices
; and programs. Defaults to 1000.

;jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a Dongle
; channel. Two implementations are currently available – “fixed”
; (with size always equals to jbmaxsize) and “adaptive” (with
; variable size, actually the new jb of IAX2). Defaults to fixed.

;jbtargetextra = 40 ; This option only affects the jb when ‘jbimpl = adaptive’ is set.
; The option represents the number of milliseconds by which the new jitter buffer
; will pad its size. the default is 40, so without modification, the new
; jitter buffer will set its size to the jitter value plus 40 milliseconds.
; increasing this value may help if your network normally has low jitter,
; but occasionally has spikes.

;jblog = no ; Enables jitterbuffer frame logging. Defaults to “no”.
;———————————————————————————–

[defaults]
; now you can set here any not required device settings as template
; sure you can overwrite in any [device] section this default values

context=from-trunk-dongle ; context for incoming calls
group=0 ; calling group
rxgain=0 ; increase the incoming volume; may be negative
txgain=0 ; increase the outgoint volume; may be negative
autodeletesms=yes ; auto delete incoming sms
resetdongle=yes ; reset dongle during initialization with ATZ command
u2diag=-1 ; set ^U2DIAG parameter on device (0 = disable everything except modem function) ; -1 not use ^U2DIAG command
usecallingpres=yes ; use the caller ID presentation or not
callingpres=allowed_passed_screen ; set caller ID presentation by default use default network settings
disablesms=no ; disable of SMS reading from device when received
; chan_dongle has currently a bug with SMS reception. When a SMS gets in during a
; call chan_dongle might crash. Enable this option to disable sms reception.
; default = no

language=en ; set channel default language
smsaspdu=yes ; if ‘yes’ send SMS in PDU mode, feature implementation incomplete and we strongly recommend say ‘yes’
mindtmfgap=45 ; minimal interval from end of previews DTMF from begining of next in ms
mindtmfduration=80 ; minimal DTMF tone duration in ms
mindtmfinterval=200 ; minimal interval between ends of DTMF of same digits in ms

callwaiting=auto ; if ‘yes’ allow incoming calls waiting; by default use network settings
; if ‘no’ waiting calls just ignored
disable=no ; OBSOLETED by initstate: if ‘yes’ no load this device and just ignore this section

initstate=start ; specified initial state of device, must be one of ‘stop’ ‘start’ ‘remote’
; ‘remove’ same as ‘disable=yes’

exten=+1234567890 ; exten for start incoming calls, only in case of Subscriber Number not available!, also set to CALLERID(ndid)

dtmf=relax ; control of incoming DTMF detection, possible values:
; off – off DTMF tones detection, voice data passed to asterisk unaltered
; use this value for gateways or if not use DTMF for AVR or inside dialplan
; inband – do DTMF tones detection
; relax – like inband but with relaxdtmf option
; default is ‘relax’ by compatibility reason

; dongle required settings
[dongle0]
audio=/dev/ttyUSB1 ; tty port for audio connection; no default value
data=/dev/ttyUSB2 ; tty port for AT commands; no default value

; or you can omit both audio and data together and use imei=123456789012345 and/or imsi=123456789012345
; imei and imsi must contain exactly 15 digits !
; imei/imsi discovery is available on Linux only
;imei=123456789012345
;imsi=123456789012345

; if audio and data set together with imei and/or imsi audio and data has precedence
; you can use both imei and imsi together in this case exact match by imei and imsi required

asterisk dongle extensions_custom.conf

$
0
0

[hgw-custom]
exten => s,1,Set(DESTNUM=${SIP_HEADER(To)})
exten => s,n,NoOp(${DESTNUM})
exten => s,n,Set(DESTNUM=${DESTNUM:1:10})
exten => s,n,Goto(from-trunk,${DESTNUM},1)

[from-trunk-dongle]
exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,Set(FILE(/var/log/asterisk/sms.txt,,,a)=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} – ${DONGLENAME} – ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,System(echo >> /var/log/asterisk/sms.txt)
exten => sms,n,Hangup()
exten => _.,1,Set(CALLERID(name)=${CALLERID(num)})
exten => _.,n,Goto(from-trunk,${EXTEN},1)

Viewing all 1419 articles
Browse latest View live