2017年7月15日 星期六

Voip SPA3000/9000 設定


架設Voip

1.Analog Telephone Adaptor (ATA)

一個類比電話轉換到基於數位VoIP電話網路

An ATA contains the following components:
  • FXS Ports – Used for interfacing with analog telephones.
  • RJ45 Ports – Used for interfacing with the LAN/WAN
  • FXO Ports – Used for interfacing with the PSTN

2.網絡電話交換機(IPPBX)

能通過IP網提供語音、視頻以及即時消息通信。這些通信不僅可以在企業內部網上進行,也可以通過Internet與外網甚至PSTN(Public Switched Telephone Network)電話間進行。

3.網路電話(IPPHONE)

SPA921、支援SIP應用程式或電話


SPA3000設定

參照 OSSLab 的設定設完發現會PSTN接到來電時
等到 PSTN Answer Delay 秒數過後將會自動接起外線
仍然等待Voip分機接起話筒可能會造成撥打者不必要的電話費
可能原因是 Off Hook While Calling VoIP  被設為Yes

SPA9000設定

Wan Setup
Internet Connection Settings
Connection Type:
SIP
Hunt Groups:
設定群組獵線 群組號碼為500,分機100-102, 響鈴300秒

回到SPA3000

PSTN Line
Dial Plan 2:

來電時將轉接至群組


發現的問題:
剛開機使用SPA3000 LINE1 撥打至PSTN Line 分機
在打外線會導致所有分機都將無法在外線
開完機後先用其他分機撥打測試後就可正常使用

2017年6月7日 星期三

nodemcu 紀錄

首頁:http://www.nodemcu.com/index_en.html

ESP Flash Download Tool (flasher)
http://bbs.espressif.com/viewtopic.php?f=57&t=433

https://github.com/espressif/ESP8266_NONOS_SDK


# 1.Build NodeMCU firmware
https://nodemcu-build.com/index.php

modules: adc bit coap cron crypto encoder enduser_setup file gpio http i2cmqtt net node ow pwm sjson sntp spi tmr uart websocket wifi.

https://drive.google.com/file/d/0Bx2A-Jefadp8amFJTkpVWDJTX3M/view?usp=sharing

# 2.燒錄

https://github.com/nodemcu/nodemcu-flasher






You successfully commissioned a NodeMCU custom build from the master branch. You selected the following 23 modules: adc bit coap cron crypto encoder enduser_setup file gpio http i2cmqtt net node rtcfifo rtcmem rtctime sjson sntp struct tmr uart wifi.

You successfully commissioned a NodeMCU custom build from the master branch. You selected the following 22 modules: adc bit coap cron encoder enduser_setup file gpio http i2c mqttnet node pwm rtctime sjson sntp spi tmr uart websocket wifi.


You successfully commissioned a NodeMCU custom build from the master branch. You selected the following 23 modules: adc bit coap cron crypto encoder enduser_setup file gpio http i2cmqtt net node pwm rtctime sjson sntp spi tmr uart websocket wifi.

2017年4月27日 星期四

解決 .NET Core 使用 MailKit 無法送信

在使用MailKit 送信時
測試時使用的SMTP server 需要使用者認證
測試時也OK

當把程式放到正式站台時
本以為是需要使用者認證的所以程式原封不動放上去
發現信送不出去!?

在網路上GOOGLE 一番
以為是下面問題
http://www.cnblogs.com/davytitan/p/6650050.html
把
client.QueryCapabilitiesAfterAuthenticating = false;
補上去就行

結果還是不行!?!???


最後發現正式站台上給的SMTP server 只有認IP且不需要使用者認證

解決方法為:
MailKit 使用上憑證一直出錯
使用以下繞過
client.ServerCertificateValidationCallback = delegate { return true; };

認證部分註解
//var creds = new NetworkCredential(acc, pass, domain);
//client.Authenticate(creds);

認證部分不註解他也會出現錯誤給你看!

2017年3月2日 星期四

ffmpeg 加入第二音軌

提取音頻
ffmpeg -i video.mpg -vn -acodec copy audio.ac3

加入第二音軌
ffmpeg -i video.mpg -i audio.mp3  -map 0:0 -map 0:1 -map 1:0 -codec copy newVideo.mpg

2016年12月29日 星期四

ASP.NET MVC ModelState 錯誤訊息

參考:http://www.cnblogs.com/darrenji/p/4415887.html


 if (ModelState.IsValid)
{
        ....
}else{
                String Message = "";
                var errors = ModelState.Where(m => m.Value.Errors.Any())
                    .Select(x => x.Value.Errors);
                foreach (var item in errors)
                {
                    var fieldErrors = item.Select(e => e.ErrorMessage).FirstOrDefault();
                    Message += fieldErrors;
                }
}

2016年12月26日 星期一

PandoraBox pptpd 設定

環境
 LuCI Trunk (0.12+svn-r1024) PandoraBox R2 14.09


安裝
kmod-gre

防火牆設定

防火墙 - 通信规则
打开路由器端口
外部端口:1723

自定义规则
iptables -t nat -I PREROUTING -p gre -j DNAT
iptables -A forwarding_rule -s 192.168.0.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o br-lan -j MASQUERADE

2016年12月2日 星期五

解決 Debian-sh4 for NextVODBox 的 iptables 無法使用

網樂通是安裝下面網址的版本
https://ftp.yzu.edu.tw/Linux/debian-sh4-for-nextvod/download.php

架PPTPD時發現iptables 沒班法用
只好重新編譯Kernel & modules 了..QQ

1.取得config
ssh登入網樂通
取得 /proc/config.gz

2.修改設定
參考這篇
http://mowei-tw.blogspot.tw/2016/12/kernel-modules.html

在編譯的時候
做完make mrproper
把
config.gz 解壓
把"config" 改名成".config"
mv condig .config

make ARCH=sh CROSS_COMPILE=sh4-linux- menuconfig

參考這文章改設定
https://groups.google.com/forum/#!topic/asterisk-tw/3-Dalh3FZYQ

Networking  ---->
 Networking options  ---->
  Network packet filtering framework (Netfilter)--->
   Core Netfilter Configuration ---->
    <*> Netfilter connection tracking support
    <*> Netfilter Xtables support (required for ip_tables)
    <*>   "NFLOG" target support
    <*>   "conntrack" connection tracking match support
    <*>   "state" match support
   IP: Netfilter Configuration --->
    <*> IPv4 connection tracking support (required for NAT)
    <*> IP tables support (required for filtering/masq/NAT)
    <*>   Packet Filtering
    <*>     REJECT target support
    <*>   Full NAT
    <*>     MASQUERADE target support
    <*> Packet mangling

儲存
蓋過kernel.config
編譯

編譯完檔案:
https://drive.google.com/file/d/0Bx2A-Jefadp8SVFYbGlNZk1HNlU/view?usp=sharing


更換Kernel 
cd /tmp
mkdir boot
mount /dev/sda1 boot
cd boot
把vmlinux.ub 換成新的
mv vmlinux.ub vmlinux.ub.bak
wget (新vmlinux.ub位置)

放置modules 

cd /lib/
mkdir modules 
cd  modules
wget (2.6.32.59-PDK7105-32BITS.tar)
tar -xvf 2.6.32.59-PDK7105-32BITS.tar


都OK後
reboot

uname -a
出現
Linux debian-wheezy-sh4 2.6.32.59-PDK7105-32BITS #6 PREEMPT Fri Dec 2 23:50:40 CST 2016 sh4 GNU/Linux

 iptables -L
不再有錯誤訊息了!
成功

預測2031/1/1可能 TWCA 憑證 IOS會出現不信任

緣由: TWCA CYBER Root CA 有兩張、兩個效期 (2030、2047年到期) 推測TWCA 預計 2030年12月會停用: TWCA CYBER Root CA (2030 年到期) TWCA Global Root CA 改用啟用: TWCA CYBER ...