wdoekes / asterisk-chan-dongle

chan_dongle channel driver for Huawei UMTS cards, works with Asterisk 14+
Other
300 stars 105 forks source link

Discovery by imei problem. #37

Open laigor opened 7 years ago

laigor commented 7 years ago

in dongle.conf: [dongle0] imei=867455001874393

[dongle3] imei=867455001874393

All modems huawei e173 asterisk console: [Jul 17 15:58:26] ERROR[18905]: at_response.c:118 at_response_ok: [dongle0] Received unexpected 'OK' [Jul 17 15:58:28] ERROR[18943]: chan_dongle.c:440 do_monitor_phone: [dongle3] timedout while waiting 'OK' in response to 'AT' [Jul 17 16:08:20] ERROR[18942]: at_response.c:118 at_response_ok: [dongle3] Received unexpected 'OK' [Jul 17 16:08:22] ERROR[18904]: pdiscovery.c:570 pdiscovery_do_cmd: [dongle0 discovery] failed to get valid response from /dev/ttyUSB8 in 500 msec It seems the messages destined for the dongle3 are sent to the wrong com port...

Centos 7 x64 asterisk 13.16.0

wdoekes commented 7 years ago

Too little info. I can't deduce any cause from these error messages alone.

CpServiceSpb commented 7 years ago

If I disable or remove audio=/dev/...... data=/dev/...... and add or enable imei = ............... I will not my dongle connected to dongle chan. That is dongle show devices is empty.

gamba47 commented 7 years ago

When you start asterisk without any dongle configured, you can search for a device with this command:

Asterisk *CLI> dongle discovery 
; discovered device
[dc_0177_0724](defaults)
;audio=/dev/ttyUSB1
;data=/dev/ttyUSB2
imei=35921103712xxxx
imsi=72234124377xxxx

As you can see, there is "imei" but "imsi" is important too. Those lines show a common configuration for dongle.conf. Showing the actual ttyUSB# used by audio and data.

You need to put both lines in your dongle.conf

Best regards.

Emiliano - gamba47

oooo1 commented 7 years ago

How is to specify /dev/............. ? I reassigned /dev/ttyUSB9 to /dev/devModem. Even not /dev/ttyUSB1. But dongle discovery requests /dev/ttyUSB1 only. The error message is: at_read.c:101 at_read: [/dev/ttyUSB1] at cmd receive buffer overflow pdiscovery.c:565 pdiscovery_do_cmd: [MyHuawei discovery] read from /dev/ttyUSB1 failed: Inappropriate ioctl for device

I knew imei and imsi through minicom, specified it at dongle.conf and noone dongle appeared by 'dongle show devices' . More correctly,device from dongle.conf is shown but as not connected.

gamba47 commented 7 years ago

Post the output of this commands (as root):

best regards.

oooo1 commented 7 years ago

Here is:

**lsusb**
Bus 002 Device 005: ID 04d8:f94f Microchip Technology, Inc.
Bus 002 Device 011: ID 1076:8002 GCT Semiconductor, Inc. LU150 LTE Modem
Bus 002 Device 010: ID 19d2:0031 ZTE WCDMA Technologies MSM MF110/MF627/MF636
Bus 002 Device 007: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Bus 002 Device 008: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Bus 002 Device 006: ID 14cd:8601 Super Top
Bus 002 Device 004: ID 2109:2813 VIA Labs, Inc.
Bus 002 Device 003: ID 0d3d:0040 Tangtop Technology Co., Ltd PS/2 Adapter
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0557:2221 ATEN International Co., Ltd Winbond Hermon
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

**asterisk -rx "dongle show devices"**
ID           Group State      RSSI Mode Submode Provider Name       Model      Firmware          IMEI        IMSI             Number
Huawei007     0     Free       14   0    0       My carrier          E367       11.838.01.00.1131 My imei    My imsi        Unknown

My carrier, my imei, my imsi are changed from real correct values.
**asterisk -rx "dongle discovery"**
; discovered device
[dc__](defaults)
;audio=/dev/ttyUSB2
;data=/dev/ttyUSB1
imei=
imsi=
**cat /etc/asterisk/dongle.conf**
[general]

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

[Huawei007]

context=DID_007          ; context for incoming calls
group=0                         ; calling group
rxgain=4                        ; increase the incoming volume; may be negative
txgain=4                        ; 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=ru                     ; 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=yes                 ; 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'

exten=007                ; 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

audio=/dev/Modem007Audio  ; Only if such port is mapped at /etc/udev folder               ; tty port for audio connection;        no default value
data=/dev/Modem007Data         ; Only if such port is mapped at /etc/udev folder               ; tty port for AT commands;             no default value
gamba47 commented 7 years ago

Ok, dongle discovery only show new and unconfigured modems at your server.

Please do this:

  1. Edit dongle.conf and comment audio and data lines (the last two lines of this)
  2. restart asterisk
  3. check "asterisk -rx "dongle show devices". You need to see this empty
  4. Then run "asterisk -rx "dongle discovery" and you will see your IMEI and IMSI.

Best regards.

Emiliano -

oooo1 commented 7 years ago

Nothing changed.

asterisk -rx "dongle show devices" ID Group State RSSI Mode Submode Provider Name Model Firmware IMEI IMSI Number

asterisk -rx "dongle discovery"

; discovered device
[dc__](defaults)
;audio=/dev/ttyUSB2
;data=/dev/ttyUSB1
imei=
imsi=