相続、親が弱ってきたら銀行の預金は親の面倒を見ているものが全て解約して管理すべきである、銀行は解約させない!!

chan_mobile intel-nuc PLANEX BT-Micro4 で成功

Asterisk

これをさした

確認

lsusb

Bus 001 Device 005: ID 0a5c:21e8 Broadcom Corp. BCM20702A0 Bluetooth 4.0

 

apt-get install bluetooth bluez libbluetooth-dev blueman
apt-get install bluez-hcidump
apt-get install pulseaudio-module-bluetooth
reboot
cd /usr/src/asterisk-13.15.0

./configure

make menuselect

chan_mobileを有効にします

make

make install

 

ラズパイに挿したBTドングル情報の確認
hcitool dev

周辺のBTデバイスのスキャン
hcitool scan

 

ペアの仕方

bluetoothctl
list
scan on

pair <your-phone-id>

port番号の確認方法

asterisk -rvvvvv

CLI> mobile search

スマホのBT設定画面を立ち上げておく

 

vi /etc/asterisk/chan_mobile.conf

[general]
interval=30 ; デバイスに接続しようとする秒数

[adapter]
id=blue
address=5C:F3:70:82:F7:AB ;hcitool dev命令で得られたMACアドレスを転記

[iphone]
address=E4:98:D6:3A:19:AC ; hcitool scan命令で得られたMACアドレスを転記
port=8 ; 上記のポートを転記
context=from-mobile-custom-1 ; dialplan context for incoming calls
adapter=blue ; adapter to use
group=1 ; this phone is in channel group 1
;sms=no ; support SMS, defaults to yes
;nocallsetup=yes ; set this only if your phone reports that it supports call progress notification, but does not do it. Motorola L6 for example.

asteriskにBTが登録されているか?
asterisk -rvvvvv
CLI> mobile show devices

全設定が完了したら再起動する
スマホのBT画面を立ち上げておく
ペアリングしますかと聞いてくる
これで接続済みとでればOK

ところがペアリングはうまくいくが
相手に発信、接続完了後、音声が聞こえない
いろいろやったがわからない

BTアダプタがだめののか?
ここに情報があった最近chan_mobileの独り言ばかり。でもまだ続く。

これはchan_mobileで正常動作したBTアダプタ(昨日買った)
PLANEX BT-Micro4
amazon.co.jp/gp/product/B00…
やっぱりモトローラチップだと正常動作するという仮説はあってそうだな。

BTアダプタについてなんとなく思った。これに確信はない。
Broadcom製:ペアリングOK、音声NG
Motorola製:ペアリングOK、音声OK

これでもう一度挑戦

スマホはiphone5sとmoto-Gでトランクに成功している

こつはBTをONにしただけではダメでスマホのBT設定画面を出しておく必要がある

 

freepbxでトランク

アプリケーション→接続→トランク→customトランクを追加→customの設定

 に下記を転記(送信)

Mobile/phone-profile-name-here/$OUTNUM$

vi /etc/asterisk/extensions_custom.conf(着信)

[from-mobile-custom-1]
exten => s,1,Noop(Setting DID =0123456789)
exten => s,n,Set(__FROM_DID=0123456789)
exten => s,n,Goto(from-trunk,0123456789,1)
exten => s,h,Hangup

0123456789は自分の番号に変更する

参考サイト

下記の参考サイト

【Motorola製】
特徴 : 多くのメーカーが出しているがWindows8のstack(ドライバー)がない。最新のstackはVer.4.0.14.324。また802.11 Co-existenceをサポートしており、無線LAN(2.4G帯域)の電波干渉を抑えることがポイント。
PLANEX BT-Micro4 ( Bluetooth 4.0 Class 2 )
BUFFALO BSHSBD08BK ( Bluetooth 4.0 Class 2 )
サンワサプライ MM-BTUD40 ( 流通終了 / Bluetooth 4.0 Class 2 )
BUFFALO BSHSBD05BK ( 流通終了 / Bluetooth 3.0 Class 1 )
BUFFALO BSHSBD04BK ( Bluetooth 3.0 Class 2 )
PLANEX BT-Micro3E1X ( 流通終了 / Bluetooth 3.0 Class 1 )
PLANEX BT-Micro3E2X ( 価格高騰 / Bluetooth 3.0 Class 2 )

【Broadcom製】
特徴 : ネットワーク機器の分野において定評なBroadcom。Bluetoothも同様でLenovo ThinkPadシリーズなどに搭載されるなど海外では幅広く使われている。価格は若干高めだが、Windows8.1のstack(ドライバー)もあり最新のstackはBroadcomの 公式サイトよりダウンロードすればよい。
I-O DATA USB-BT40LE ( 人気 / Bluetooth 4.0 Class 2 / BCM20702 )
Kinivo BTD-400 ( 人気 / Bluetooth 4.0 Class 2 / BCM20702 )
GMYLE Bluetooth 4.0 USB ( Bluetooth 4.0 Class 2 / BCM20702 )
Inateck Bluetooth BTA-BC4B6 ( Bluetooth 4.0 Class 2 )
Asus USB-BT400 ( 価格高騰 / Bluetooth 4.0 Class 2 / BCM20702 )
Logitec LBT-UAN03C1BK ( 流通終了 / Bluetooth 3.0 Class 1 )
Logitec LBT-UAN03C2BK8 ( 流通終了 / Bluetooth 3.0 Class 2 )

 

chipsetがBroadcom製は端末側に音声が通らない

 

PLANEX BT-Micro4とiphone5sでchan_mobileに成功した

ただiphoneはペアリングが解除されて自動で再接続されない

moto-gはペアリングは解除されなかった

androidはbluetooth自動接続アプリがある

 

blutoothのペアリング方法

#bluetoothctl … bluetooth設定を起動

[bluetooth]#power on ...コントローラを起動します
[bluetooth]#devices ...ペアリングしたいデバイスのMACアドレスを調べます

[bluetooth]# scan on …デバイスが見つからない場合はスキャンをします

[CHG] Device XX:XX:XX:XX:XX:XX

[bluetooth]# scan off … デバイスのスキャンを停止

[bluetooth]# pair XX:XX:XX:XX:XX:XX … 見つかったデバイスに対してペアリング要求

Attempting to pair with XX:XX:XX:XX:XX:XX
[CHG] Device XX:XX:XX:XX:XX:XX Connected: yes
[CHG] Device XX:XX:XX:XX:XX:XX Modalias: usb:v0xxxxx
[CHG] Device XX:XX:XX:XX:XX:XX UUIDs:
    00001000-0000-1000-8000-00805f9b34fb
    00001124-0000-1000-8000-00805f9b34fb
    00001200-0000-1000-8000-00805f9b34fb
[CHG] Device XX:XX:XX:XX:XX:XX Paired: yes
Pairing successful
...

ペアリング成功

[bluetooth]# trust XX:XX:XX:XX:XX:XX … 次回起動時に自動接続できるよう、trustする

[CHG] Device XX:XX:XX:XX:XX:XX Trusted: yes
Changing XX:XX:XX:XX:XX:XX trust succeeded
...

iphone5sではスリープに入ると20〜30分程度で接続が解除されて自動で復帰してくれない

なのでスリープを解除した、画面を一番暗くした

文字を大きく、太くした

 

コントローラの電源起動と停止

list # ローカルコントローラのリスト表示
show # コントローラの状態表示
power on # コントローラ起動
power off # コントローラ停止

ペアリングと接続

scan on # デバイス検索モード
devices # デバイス表示
pair (dev) # ペアリング
trust (dev) # デバイスを信用する。(必要かどうか分からない)
paired-devices # ペアリング済デバイス表示
connect (dev) # 接続
info (dev) #デバイスの状態

その他のコントローラのコマンド

  • select (ctrl) : コントローラ (ローカルの BT) 選択
  • discoverable (on/off) : on で発見可能にする
  • agent (on/off/capability) : リモートデバイスからペアリングを行う時使う。
  • default-agent : リモートデバイスからペアリングを行う時使う。
  • pairable (on/off) : ペア機能の ON/OFF

その他のデバイスのコマンド

  • remove (dev) : ペアリングの削除
  • disconnect (dev) : デバイス切断

 

bluetoothは2,4GHzでありwifiの2.4GHzと干渉する

なので接続がそっちゅう切断する場合はwifi2.4GHzをなくなす必要がある

なくしたら切断しなくなった

ただ電子レンジが動くと切断してしまう(対策レンジから距離を置く)

 

BTアダプタとスマホのペアリング方法

#bluetoothctl

以下のようにBTアダプタのIDが出る

[NEW] Controller 00:1B:DC:05:D4:57 chromebox3 [default]

MAC ID: 00:1B:DC:05:D4:57 を/etc/asterisk/chan_mobile.confに記述する

スマホのBT設定画面を立ち上げてBTをONにする

#power on

#scan on

そうすると以下のようにスマホのIDがでる

[NEW] Device E4:98:D6:3A:19:AC iPhone

MAC ID:E4:98:D6:3A:19:AC を/etc/asterisk/chan_mobile.confに記述する

BTアダプタとスマホのペアリングを行う

[bluetooth]#pair E4:98:D6:3A:19:AC (スマホのID)

スマホにペアリング要請が出るので許可する

[bluetooth]#trust E4:98:D6:3A:19:AC (スマホのID)

[bluetooth]#exit

vi /etc/asterisk/chan_mobile.conf

[adapter]
id=blue
address=00:1B:DC:05:D4:57 ;BTアダプタ
;forcemaster=yes ; attempt to force adapter into master mode. default is no.
;alignmentdetection=yes ; enable this if you sometimes get ‘white noise’ on asterisk side of the call
; its a bug in the bluetooth adapter firmware, enabling this will compensate for it.
; default is no.

[iphone]
address=E4:98:D6:3A:19:AC ;スマホのMAC ID
port=4 ; the rfcomm port number (from mobile search)
context=incoming-mobile ; dialplan context for incoming calls
adapter=blue ; adapter to use
group=1 ; this phone is in channel group 1
;sms=no ; support SMS, defaults to yes
;nocallsetup=yes ; set this only if your phone reports that it supports call progress notification, but does not do it. Motorola L6 for example.

 

chown asterisk:asterisk /etc/asterisk/chan_mobile.conf

次にポートの変更を行います。
以下のコマンドを入力しましょう。

#amportal restart
#asterisk -rx “mobile search”

いかが表示される

Address Name Usable Type Port
68:C4:4D:4A:CB:9D [Moto G (4) (694)]0 Yes Phone 3

 

chan_mobile.conf内のスマホのportを3に変更する

#amportal restart

#asterisk -rx “mobile show devices”
以下のように表示されたらOK
ID Address Group Adapter Connected State SMS
moto-g4-plus 68:C4:4D:4A:CB:9D 1 blue Yes Free No

iphoneのペアリングは解除された場合自動復帰しないがサーバーの横に置いとけば解除はされない

AACとapt-Xに対応したサンワサプライ Bluetooth 4.0 USBアダプタ(class2) MM-BTUD44も成功した

これはCSRチップである

CSRもOKみたい

 

Asterisk
スポンサーリンク
シェアする
ふじやんをフォローする
スポンサーリンク
なんでもDIY

コメント