Asterisk & chan_dogle - incoming call and busy line

Hello Community!

I’ve chosen Asterisk for my home automation project. Hope that my final target will be achievable but for now I’ve got stuck on probably simple thing… I am not able to react on any call incoming to the dongle - the line is incessantly busy. I would like to hear just anything like, let’s say, SayDigits(23456789) or any other “hello world”. It should be easy, right? :slight_smile:

My current conf:
Ubuntu 17.10 + MSISDN + HUAWEI E173u-2 + Asterisk + asterisk-chan-dongle

MSISDN on dongle is, let’s say +48xxxyyyzzz, (will use this below)

Assuming that dongle is correctly installed because:

Loaded chan_dongle.so => (Huawei 3G Dongle Channel Driver)
    -- [dongle0] IMEI 8XXXXXXXX found on data_tty=/dev/ttyUSB2 audio_tty=/dev/ttyUSB1
    -- [dongle0] Trying to connect on /dev/ttyUSB2...
    -- [dongle0] Dongle has connected, initializing...
    -- [dongle0] Dongle initialized and ready

plus: I can receive and send SMS. Dongle is unlocked, voice is enabled.

My dongle properties:

dongle show device state dongle0 
-------------- Status -------------
  Device                  : dongle0
  State                   : Free
  Audio                   : /dev/ttyUSB1
  Data                    : /dev/ttyUSB2
  Voice                   : Yes
  SMS                     : Yes
  Manufacturer            : huawei
  Model                   : E173
  Firmware                : 11.126.85.02.52
  IMEI                    : 8--------------0
  IMSI                    : 2---------------0
  GSM Registration Status : Registered, home network
  RSSI                    : 10, -93 dBm
  Mode                    : No Service
  Submode                 : No service
  Provider Name           : Era
  Location area code      : XXX
  Cell ID                 : XXX
  Subscriber Number       : +48XXXXXXXX
  SMS Service Center      : +48XXXXXXXX
  Use UCS-2 encoding      : Yes
  USSD use 7 bit encoding : Yes
  USSD use UCS-2 decoding : No
  Tasks in queue          : 0
  Commands in queue       : 0
  Call Waiting            : Disabled
  Current device state    : start
  Desired device state    : start
  When change state       : now
  Calls/Channels          : 0
    Active                : 0
    Held                  : 0
    Dialing               : 0
    Alerting              : 0
    Incoming              : 0
    Waiting               : 0
    Releasing             : 0
    Initializing          : 0

My Asterisk version is:

PBX Core settings
-----------------
  Version:                     15.2.2
  Build Options:               BUILD_NATIVE, OPTIONAL_API
  Maximum calls:               Not set
  Maximum open file handles:   1024
  Root console verbosity:      0
  Current console verbosity:   5
  Debug level:                 6
  Maximum load average:        0.000000
  Minimum free memory:         0 MB
  Startup time:                20:31:55
  Last reload time:            20:38:50
  System:                      Linux/4.13.0-36-generic built by root on x86_64 2018-03-06 21:49:35 UTC
  System name:                 
  Entity ID:                   4:::::f
  PBX UUID:                    2-----8
  Default language:            en
  Language prefix:             Enabled
  User name and group:         /
  Executable includes:         Disabled
  Transcode via SLIN:          Enabled
  Transmit silence during rec: Disabled
  Generic PLC:                 Disabled
  Min DTMF duration::          80
  Cache media frames:          Enabled
  RTP use dynamic payloads:    1
  RTP dynamic payload types:   35-63,96-127

* Subsystems
  -------------
  Manager (AMI):               Disabled
  Web Manager (AMI/HTTP):      Disabled
  Call data records:           Enabled
  Realtime Architecture (ARA): Disabled

* Directories
  -------------
  Configuration file:          /etc/asterisk/asterisk.conf
  Configuration directory:     /etc/asterisk
  Module directory:            /usr/lib/asterisk/modules
  Spool directory:             /var/spool/asterisk
  Log directory:               /var/log/asterisk
  Run/Sockets directory:       /var/run/asterisk
  PID file:                    /var/run/asterisk/asterisk.pid
  VarLib directory:            /var/lib/asterisk
  Data directory:              /var/lib/asterisk
  ASTDB:                       /var/lib/asterisk/astdb
  IAX2 Keys directory:         /var/lib/asterisk/keys
  AGI Scripts directory:       /var/lib/asterisk/agi-bin

Tried to configure /etc/asterisk/dongle.conf as below:

[general]

interval=3			; 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=helloWorld		; 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=				; 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
data=/dev/ttyUSB2		; tty port for AT commands

; 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=XXXXXXXXXXXXXXXX
;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

one of dozens /etc/asterisk/extensions.conf variants is as below:

[helloWorld]
exten => _X.,1,Answer()
exten => _X.,2,SayDigits(23456789)
exten => _X.,3,Hangup()

and that’s all of my configurations.

My assumption is that in example above ANY incoming call to dongle (+48xxxyyyzzz) will be taken, I will hear a voice which reads the numbers and then call will be hanged up. Am I mistaken? But I hear always busy line…

tried to do some debugging:

asterisk -rvvvvvvvvvddddddddddddd

but when I am calling to dongle nothing appears on the screen.

Could you, please, help me understand what is missed? Do you know any documentation that could help me? How to move forward?

Thanks!

I think chan_dongle is community supported, so you may find that there is little knowledge of it here.

@david551
Hi,
thanks for reply and advice!

Pozdrowienia z Polski :slight_smile:

First of all I will check if you really had unlocked voice, for example use ‘Mobile Partner’ application to make and receive test voice calls. If you could then you really have unlocked voice on that usb device.

1 Like

@przeqpiciel
również pozdrawiam :slight_smile:

You may have really good point!

As you can see above, the result of “dongle show device state dongle0” shows that Voice is enabled. The same shows another tool (dc-unlocker), but if I go to Mobile Partner (v23.009.09.01.983), I do not see any “Call” option. If Mobile Partner v23.009.09.01.983 supports such feature, but I can not see it, then it may be something wrong with firmware or so (found on Google Images that guys having MP v23.009.09.01.983 with such call feature).

And also… when device is connected on W10 with Mobile Partner, the line is busy while call attempt.

Many thanks for you for your hint! Good lesson for me :slightly_smiling_face:

//edit an hour later
pulled other distro of Mobile Partner (other than is already provided on modem) and indeed, cannot make or receive call despite the call feature is now available. So seems that your idea can be a good one. Thanks!

Hi,

This is setup of Mobile Parter which i used to - https://files.fm/u/5f3bng6x
I unlocked voice on my huawei e-160 with screen application on linux because dc-unlocker was too expensive for me. You need just find AT commands for that.

@przeqpiciel

once again - many thanks for your help! Your hint broke the bank - it was the cause.

So for next generations :slight_smile:

  • I bought dongle Huawei e173u-2 from local stock.
  • All tools gave me clear information that Voice feature is enabled (more info above), so initial requirement to play with dongle was fulfilled.
  • However the issue was, that no matter what configuration on asterisk I had (extension.conf/dongle.conf), I always had busy line signal plus there was no logs while call attempt on Asterisk.
  • Because of no logs, I assumed that my asterisk/dongle configuration is broken however I was not able to find where its broken.
  • Finally, in desperation, I have posted my issue on community and @przeqpiciel advised me to empirically check if I am really able to call from Mobile Partner program.
  • I was surprised because some versions of Media Partner don’t have “call option”, so initially just assumed that the call /out and in/ can be done just with other software but not Mobile Partner.
  • @przeqpiciel presented the version with Mobile Partner with such feature.
  • It turned out that line (on Windows at this time) is also busy.
  • Tried to play with unlocking dongle by AT commands, but all commands that I found showed “COMMAND NOT SUPPORT”.
  • Found firmware: 11.126.85.00.209 for educational purposes. Flashed device and I was able to make/receive call on Media Partner.
  • Tested Asterisk: I was able to create “Hello world” configuration.

Problem fixed! Thank You!