利用者:Pin ptrのソースを表示
←
利用者:Pin ptr
ナビゲーションに移動
検索に移動
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループのいずれかに属する利用者のみが実行できます: メール確認された利用者、
管理者
。
このページのソースの閲覧やコピーができます。
== 直収 == Ubuntuでひかり電話を直収するのに試したことメモ。 === 接続 === <nowiki>NTT東日本| -------- |壁| -- |VDSLモデム| -- |Raspberry Pi3| -- |KX-UT123N|</nowiki> === DHCP === Ubuntu 16.04 Serverのisc-dhcp-clientにはclassless-static-routeのサポートが入っている。 また、dhclient.confで新たなオプションを定義できるので、再コンパイルせずに使う。 * /etc/network/interface <nowiki> auto eth0 iface eth0 inet dhcp</nowiki> * /etc/dhcp/dhclient.conf <nowiki># 既存の dhclient.conf に追加する option ip-sip-servers code 120 = { boolean, array of ip-address }; option vendor-class.ntt code 210 = string; option space ntt code width 1 length width 1 hash size 3; option ntt.mac code 201 = string; option ntt.number code 202 = text; option ntt.domain code 204 = domain-list; option ntt.firmware code 210 = domain-list; option vendor.ntt code 210 = encapsulate ntt; interface "eth0" { also request ip-sip-servers, vivso; send vendor-class.ntt = concat(06, suffix(hardware, 6)); }</nowiki> うまくいくと、dhclient.eth0.leases に設定が入っているのが確認できる。 === Asterisk === Ubuntu 16.04のAsteriskは壊れていて面倒そうなので使わない。 https://bugs.launchpad.net/ubuntu/+source/asterisk/+bug/1314058 install_prereqはX関連のアレコレが入るので使わない。 <nowiki>$ sudo apt install build-essential libncurses-dev uuid-dev libjansson-dev libxml2-dev libsqlite3-dev libssl-dev $ tar xvf asterisk-13.14.0.tar.gz $ cd asterisk-13.14.0 $ ./configure --with-pjproject-bundled --prefix=/usr/local $ make menuconfig # CORE-SOUNDS-JA-GSM $ make $ sudo make isntall $ sudo make config $ sudo make samples $ sudo make install-logrotate</nowiki> * /etc/default/asteriskのALTCONFを/usr/local/etc/asterisk/asterisk.confに変えたり… * ログが /usr/local/var/lib/log に出力されるので、適当に移動したり… === ntt.conf === dhclientが起動するスクリプトからasteriskの設定を作る。 * /etc/dhcp/dhclient-exit-hooks.d/sip-configuration <nowiki>if [ "eth0" = "$interface" ]; then case $reason in BOUND|RENEW|REBIND|REBOOT) domain=$(echo "$new_ntt_domain" | sed -e 's/[.]$//') number="$new_ntt_number" is_ip=$(echo "$new_ip_sip_servers" | awk '{ print $1; }') server=$(echo "$new_ip_sip_servers" | awk '{ print $2; }') if [ -n "$domain" ] && [ -n "$number" ] && [ "$is_ip" = 'true' ] && [ -n "$server" ]; then cat /etc/asterisk/ntt.conf.up | \ sed \ -e "s/DOMAIN/$domain/g" \ -e "s/NUMBER/$number/g" \ -e "s/SERVER/$server/g" \ > /usr/local/etc/asterisk/ntt.conf service asterisk reload fi ;; EXPIRE|FAIL|RELEASE|STOP) cp /etc/asterisk/ntt.conf.down /usr/local/etc/asterisk/ntt.conf service asterisk reload ;; esac fi</nowiki> * /etc/asterisk/ntt.conf.up <nowiki>register => NUMBER@DOMAIN@SERVER/NUMBER [ntt] type=peer host=SERVER context=fromntt fromdomain=DOMAIN</nowiki> * /etc/asterisk/ntt.conf.down <nowiki>; empty</nowiki> * sip.conf <nowiki>[general] (略) #include <ntt.conf> [201] (略)</nowiki> === 結果 === <nowiki>eri*CLI> sip show registry Host dnsmgr Username Refresh State Reg.Time xxx.xxx.xxx.x:5060 N 0xxxxxxxxx@n 3585 Registered Tue, 04 Apr 2017 04:55:15 1 SIP registrations.</nowiki> === おまけ:IPv6 === 116に電話したらRAにprefixが含まれなくなった。タイプ2に移行されたらしい。タイプ2ではDHCPv6-PDが使えるようになる。 client-idは -D LL を指定してdhclientを起動していればいらないと思いきや、うっかりleaseファイルからDUID-LLTを読んでしまうと困るので書いておく。 * dhclient.conf <nowiki> option space my-vsio code width 4 length width 2 hash size 3; option my-vsio.ntt6 code 210 = string; option dhcp6.my-vendor-opts code 16 = encapsulate my-vsio; option space ntt6 code width 2 length width 2 hash size 7; option ntt6.mac code 201 = string; option ntt6.number code 202 = text; option ntt6.domain code 204 = domain-list; option ntt6.firmware code 210 = domain-list; option vsio.ntt6 code 210 = encapsulate ntt6; interface "eth0" { send dhcp-client-identifier = hardware; request subnet-mask, routers, ip-sip-servers, rfc3442-classless-static-routes, vivso; send vendor-class.ntt = concat(06, suffix(hardware, 6)); send dhcp6.client-id = concat(00:03:00, hardware); also request dhcp6.name-servers, dhcp6.domain-search, dhcp6.sntp-servers, dhcp6.sip-servers-addresses, dhcp6.vendor-opts; send my-vsio.ntt6 = suffix(hardware, 6); }</nowiki> * /etc/network/interfaces <nowiki> iface eth0 inet6 manual #(ip -6 address show dev eth0 の結果がtentativeでなくなるのを待って) #(NGNの経路を足して) up /sbin/dhclient -1 -6 -P -D LL -pf /run/dhclient6.eth0.pid -lf /var/lib/dhcp/dhclient6.eth0.leases -I -df /var/lib/dhcp/dhclient.eth0.leases eth0 pre-down /sbin/dhclient -r -pf /run/dhclient6.eth0.pid eth0 </nowiki> うまくいくと /var/lib/dhcp/dhclient6.eth0.leases にIPv4のものと同等の情報が入る。 IPv6のSIPサーバは REGISTER にも OPTIONS にも応答しない。技術参考資料には 登録時にはIPv4を用いてSIP信号の送受信を行ってください。 とあるので、 Contact: <sip:0XXXXXXXXX@[2408:...]:5060> なREGISTERをIPv4のSIPサーバに送り付ければよいのかもしれない。(試せていない)
利用者:Pin ptr
に戻る。
ナビゲーション メニュー
個人用ツール
アカウント作成
ログイン
名前空間
利用者ページ
議論
日本語
表示
閲覧
ソースを閲覧
履歴表示
その他
検索
案内
メインページ
最近の更新
おまかせ表示
ヘルプ
広告
サイトコンテンツ
コミュニティ
Asterisk
Asterisk 18
Asterisk 20
Asterisk 22
IP電話機
購入情報
導入事例
回線接続
ベンダー
ひかり電話
セキュリティ
イベント情報
スペシャル
Asterisk pjsip
ABS
黒電話 ハック
ツール
リンク元
関連ページの更新状況
利用者の投稿記録
記録
利用者グループの表示
特別ページ
ページ情報