返回列表 發帖
For plain Asterisk server, we can easily apply the settings for chan_dongle. However, if we use Asterisk-GUI, it is extremely to add dongle channel.

TOP

Command>dongle show devices

ID           Group State      RSSI Mode Submode Provider Name  Model      Firmware          IMEI             IMSI             Number        
dongle0      0     GSM not re 14   0    0       NONE           E180       11.126.10.01.68     

成功安裝,
請問之後又點做呢??

TOP

回復 47# SuiYan

你可以在APL 加入 dial in and dial out settings

TOP

我在想,有些人不会APL,只会用GUI click click吓!

看来要想想办法。

TOP

是否跟佢個extensions.conf sample改??
在我心目中, 以為裝完就會有一個fxo等等給我在gui內set.



; this is chunks of Asterisk extensions.conf file for show some chan_dongle features
[general]
[dongle-incoming]
; example of ussd receive
exten => ussd,1,Set(type=${USSD_TYPE})
        ; values from 0 till 5
        ;  0 - 'USSD Notify'
        ;  1 - 'USSD Request'
        ;  2 - 'USSD Terminated by network'
        ;  3 - 'Other local client has responded'
        ;  4 - 'Operation not supported'
        ;  5 - 'Network time out'
exten => ussd,n,Set(typestr=${USSD_TYPE_STR})
        ; type in string, see above
exten => ussd,n,Set(ussd=${USSD})
        ; USSD text, but may be truncated by first \n
exten => ussd,n,Set(ussd_multiline=${BASE64_DECODE(${USSD_BASE64})})
        ; USSD text, may be multiline
; Note:  this exten run in Local channel not attached to anything, also all CALLERID() is empty
exten => ussd,n,Hangup

; example of sms receive
exten => sms,1,Set(sms=${SMS})
        ; SMS text, but may be truncated by first \n
exten => sms,n,Set(sms_multiline=${BASE64_DECODE(${SMS_BASE64})})
        ; SMS text, may be multiline
exten => sms,n,Set(raw_cmgr_message=${CMGR})
        ; raw CMGR message from dongle
; Note:  this exten run in Local channel not attached to anything, also CALLERID(num) is address of SMS originator
exten => sms,n,Hangup

; example of begining context execution from not default exten
exten => +12345678901,1,Verbose(This exten executed if Subscriber Number is available and equal +12345678901 or exten setting value is +12345678901)
exten => +12345678901,n,Hangup

; example of channel variables setting by chan_dongle
exten => s,1,Set(NAME_OF_DEVICE=${DONGLE0_STATUS})
    ; for example 'dongle0' or 'dongle1' see dongle.conf
exten => s,n,Set(NAME_OF_PROVIDE=${DONGLEPROVIDER})
    ; for example see output of cli 'dongle show devices' column "Provider Name"
exten => s,n,Set(IMEI_OF_DEVICE=${DONGLEIMEI})
    ; for example see output of cli 'dongle show devices' column "IMEI"
exten => s,n,Set(IMSI_OF_SIMCARD=${DONGLEIMSI})
    ; for example see output of cli 'dongle show devices' column "IMSI"

TOP

回復 47# SuiYan

Are you able to send SMS to other mobile phone number. For reference, there is an example to illustrate the task.

http://www.telecom-cafe.com/foru ... =5958&pid=35862

TOP

Finally I was able to set up 3G modem (both outbound and inbound calls) using a light editing process and then the rest of tasks could be done by the Asterisk-GUI.

TOP

本帖最後由 SuiYan 於 2013-11-3 22:17 編輯
回復  SuiYan

Are you able to send SMS to other mobile phone number. For reference, there is an exa ...
角色 發表於 2013-11-3 18:12


cannot. it show :
Command>dongle sms dongle0 852XXXXXXX Hello. this is a test.
{dongle0} Device not connected / initialized / registered


raspberrypi*CLI> dongle show device state dongle0
-------------- Status -------------
  Device                  : dongle0
  State                   : GSM not registered
  Audio                   : /dev/ttyUSB1
  Data                    : /dev/ttyUSB2
  Voice                   : Yes
  SMS                     : Yes
  Manufacturer            : huawei
  Model                   : E180
  Firmware                : 11.126.10.01.68
  IMEI                    : 354241020
  IMSI                    : 454120606
  GSM Registration Status : Unknown
  RSSI                    : 14, -85 dBm
  Mode                    : No Service
  Submode                 : No service
  Provider Name           : NONE
  Location area code      :
  Cell ID                 :
  Subscriber Number       : Unknown
  SMS Service Center      : +85292040031
  Use UCS-2 encoding      : Yes
  USSD use 7 bit encoding : No
  USSD use UCS-2 decoding : Yes
  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

TOP

For your reference, I attached two screen captures as shown below:

1085a.gif

1085b.gif

TOP

Please make sure that you are able to see /dev/ttyU* as shown below:

1086.gif

TOP

本帖最後由 SuiYan 於 2013-11-3 22:42 編輯

Yes now, after I dongle restart now dongle0

Command>dongle sms dongle0 852XXXXXXX Hello. this is a test.
<dongle0> SMS queued for send with id 0x1f2d0e8


status :

Command>dongle show device state dongle0-------------- Status -------------  Device                  : dongle0  State                   : Free  Audio                   : /dev/ttyUSB1  Data                    : /dev/ttyUSB2  Voice                   : Yes  SMS                     : Yes  Manufacturer            : huawei  Model                   : E180  Firmware                : 11.126.10.01.68  IMEI                    : 35424102  IMSI                    : 45412060  GSM Registration Status : Registered, home network  RSSI                    : 15, -83 dBm  Mode                    : No Service  Submode                 : No service  Provider Name           : CMHK  Location area code      : 10E  Cell ID                 : 34DD  Subscriber Number       : Unknown  SMS Service Center      : +85292040031  Use UCS-2 encoding      : Yes  USSD use 7 bit encoding : No  USSD use UCS-2 decoding : Yes  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

TOP

本帖最後由 角色 於 2013-11-3 23:17 編輯

In order to get the system work, you have to add/modify the following variables in /etc/asterisk/dongle.conf

Listing 1
  1. [defaults]
  2. context = DID_3Gdongle0    (This context will be used in Asterisk-GUI)
  3. .
  4. .
  5. .
  6. exten = +852RRRRSSSS  (SIM card telephone number)


  7. [dongle0]
  8. imei = XXXXXXXXX453218 (the IMEI code of the SIM card)
  9. imsi = YYYYYYYYY232505 (the IMSI code of the SIM card)
複製代碼
In /etc/asterisk/dongle.conf


Listing 2
  1. ;!
  2. ;! Automatically generated configuration file
  3. ;! Filename: dongle.conf (/etc/asterisk/dongle.conf)
  4. ;! Generator: Manager
  5. ;! Creation Date: Sun Nov  3 19:15:14 2013
  6. ;!
  7. [general]

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

  9. ;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
  10. ;jbenable = yes                 ; Enables the use of a jitterbuffer on the receiving side of a
  11. ; Dongle channel. Defaults to "no". An enabled jitterbuffer will
  12. ; be used only if the sending side can create and the receiving
  13. ; side can not accept jitter. The Dongle channel can't accept jitter,
  14. ; thus an enabled jitterbuffer on the receive Dongle side will always
  15. ; be used if the sending side can create jitter.

  16. ;jbforce = no                   ; Forces the use of a jitterbuffer on the receive side of a Dongle
  17. ; channel. Defaults to "no".

  18. ;jbmaxsize = 200                ; Max length of the jitterbuffer in milliseconds.

  19. ;jbresyncthreshold = 1000       ; Jump in the frame timestamps over which the jitterbuffer is
  20. ; resynchronized. Useful to improve the quality of the voice, with
  21. ; big jumps in/broken timestamps, usually sent from exotic devices
  22. ; and programs. Defaults to 1000.

  23. ;jbimpl = fixed                 ; Jitterbuffer implementation, used on the receiving side of a Dongle
  24. ; channel. Two implementations are currently available - "fixed"
  25. ; (with size always equals to jbmaxsize) and "adaptive" (with
  26. ; variable size, actually the new jb of IAX2). Defaults to fixed.

  27. ;jbtargetextra = 40             ; This option only affects the jb when 'jbimpl = adaptive' is set.
  28. ; The option represents the number of milliseconds by which the new jitter buffer
  29. ; will pad its size. the default is 40, so without modification, the new
  30. ; jitter buffer will set its size to the jitter value plus 40 milliseconds.
  31. ; increasing this value may help if your network normally has low jitter,
  32. ; but occasionally has spikes.

  33. ;jblog = no                     ; Enables jitterbuffer frame logging. Defaults to "no".
  34. ;-----------------------------------------------------------------------------------

  35. [defaults]
  36. context = DID_3Gdongle0
  37. group = 0
  38. rxgain = 0
  39. txgain = 0
  40. autodeletesms = yes
  41. resetdongle = yes
  42. u2diag = -1
  43. usecallingpres = yes
  44. callingpres = allowed_passed_screen
  45. disablesms = no
  46. language = en
  47. smsaspdu = yes
  48. mindtmfgap = 45
  49. mindtmfduration = 80
  50. mindtmfinterval = 200
  51. callwaiting = auto
  52. disable = no
  53. initstate = start
  54. exten = +852RRRRSSSS
  55. dtmf = relax




  56. ;   off    - off DTMF tones detection, voice data passed to asterisk unaltered
  57. ;              use this value for gateways or if not use DTMF for AVR or inside dialplan
  58. ;   inband - do DTMF tones detection
  59. ;   relax  - like inband but with relaxdtmf option
  60. ;  default is 'relax' by compatibility reason

  61. ; dongle required settings
  62. [dongle0]
  63. audio = /dev/ttyUSB1  ; tty port for audio connection;  no default value
  64. data = /dev/ttyUSB2  ; tty port for AT commands;                no default value

  65. ; or you can omit both audio and data together and use imei=123456789012345 and/or imsi=123456789012345
  66. ;  imei and imsi must contain exactly 15 digits !
  67. ;  imei/imsi discovery is available on Linux only
  68. ;imei=123456789012345
  69. ;imsi=123456789012345
  70. imei = XXXXXXXXX453218
  71. imsi = YYYYYYYYY232505
  72. ; if audio and data set together with imei and/or imsi audio and data has precedence
  73. ;   you can use both imei and imsi together in this case exact match by imei and imsi required
複製代碼
The the following /etc/asterisk/users.conf was created by Asterisk-GUI and modified by hand

Listing 3
  1. [3Gdongle0]
  2. trunkname = 3Gdongle0
  3. context = DID_3Gdongle0
  4. hasexten = no
  5. hasiax = no
  6. hassip = yes
  7. registeriax = no
  8. registersip = yes
  9. trunkstyle = voip
  10. disallow = all
  11. allow = all
複製代碼
The listing 4 (/etc/asterisk/extensions.conf) was first initialised by Asterisk-GUI and modified by hand

Listing 4
  1. [CallingRule_Dongle0]
  2. ;exten = _82X.,1,Macro(trunkdial-failover-0.3,${trunk_1}/${EXTEN:2},,trunk_1,)
  3. exten = _82X.,1,Dial(Dongle/dongle0/${EXTEN:2})
  4. exten = _82X.,2,Hangup()
複製代碼

TOP

回復 56# SuiYan

Very good! The next task is the voice calls.

TOP

本帖最後由 SuiYan 於 2013-11-3 23:17 編輯

List3 係users.conf ?  List4 係唔係extensions.conf ?

TOP

回復 59# SuiYan

I have already modified the post accordingly. Please take a look.

TOP

返回列表