Sie sind auf Seite 1von 9

Huawei/Vodafone 3G USB Modem on Asterisk-datacard

????? 3G USB Modem ?? Asterisk ? GSM gateway? ???? ???? PIAF 1.7.5.5, BRONZE Linux 2.6.18-194.26 Asterisk 1.6.2.17.2 Asterisk-addons 1.6.2.3 Vodafone 3G Modem K3520 Vodafone_3G_Modem_k3520.jpg

???????????? ???? ????????Linux ?? USB 3G Modem ????

root@pbx:~ $ lsusb Bus 001 Device 012: ID 12d1:1001 Huawei Technologies Co., Ltd. E620 USB M Bus 001 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 root@pbx:~ $ dmesg ... ... usb 1-1: new full speed USB device using uhci_hcd and address 12 usb 1-1: configuration #1 chosen from 1 choice usb-storage: probe of 1-1:1.0 failed with error -5 usb-storage: probe of 1-1:1.1 failed with error -5 usb-storage: probe of 1-1:1.2 failed with error -5 scsi27 : SCSI emulation for USB Mass Storage devices usb-storage: device found at 12 usb-storage: waiting for device to settle before scanning Vendor: HUAWEI Model: Mass Storage Rev: 2.31 Type: CD-ROM ANSI SCSI revision: 02 sr0: scsi-1 drive sr 27:0:0:0: Attached scsi CD-ROM sr0 sr 27:0:0:0: Attached scsi generic sg0 type 5

Vendor: HUAWEI Model: SD Storage Rev: 2.31 Type: Direct-Access ANSI SCSI revision: 02 sd 27:0:0:1: Attached scsi removable disk sda sd 27:0:0:1: Attached scsi generic sg1 type 0 usb-storage: device scan complete Tips: ???? /dev/ttyUSB* ?????? modem ?????
??????

????????? CentOS Linux ?????? USB modem ????????????????????? CentOS 5.5 Linux ?????????? USB modem? ??????

root@pbx:~/temp $ lsusb Bus 001 Device 004: ID 12d1:1001 Huawei Technologies Co., Ltd. E620 USB M Bus 001 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 root@pbx:~/temp $ crw-rw---- 1 root crw-rw---- 1 root crw-rw---- 1 root ls -l /dev/ttyUSB* asterisk 188, 0 May asterisk 188, 1 May asterisk 188, 2 May 9 17:56 /dev/ttyUSB0 9 17:56 /dev/ttyUSB1 9 18:12 /dev/ttyUSB2

?????? ttyUSB* ?????? Asterisk???? F.A.Q?


?? Dongle ??

?????https://code.google.com/p/asterisk-chan-dongle/downloads/list ???? Asterisk 11 ????????????? patch(?????????????) https://github.com/jstasiak/ asterisk...asterisk11.zip cd /usr/src tar xzf chan_dongle-1.1.r14.tgz cd chan_dongle-1.1.r14/ ./configure make make install amportal stop amportal start

????? make ?????????? make ?? ?? dongle ?? # asterisk -rx "module show like dongle" Module Description chan_dongle.so dongle Channel Driver 1 modules loaded ????? /etc/asterisk/dongle.conf [general] interval=15

U 0

; Number of seconds between trying to con

;------------------------------ JITTER BUFFER CONFIGURATION ------------;jbenable = yes ; Enables the use of a jitterbuffer on th ; Dongle channel. Defaults to "no". An en ; be used only if the sending side can cr ; side can not accept jitter. The Dongle ; thus an enabled jitterbuffer on the rec ; be used if the sending side can create ;jbforce = no ;jbmaxsize = 200 ;jbresyncthreshold = 1000

; Forces the use of a jitterbuffer on the ; channel. Defaults to "no".

; Max length of the jitterbuffer in milli ; ; ; ; ; ; ; ; ; ; ; ; ; ;

Jump in the frame timestamps over which resynchronized. Useful to improve the q big jumps in/broken timestamps, usually and programs. Defaults to 1000.

;jbimpl = fixed

Jitterbuffer implementation, used on th channel. Two implementations are curren (with size always equals to jbmaxsize) variable size, actually the new jb of I

;jbtargetextra = 40

This option only affects the jb when 'j The option represents the number of mil will pad its size. the default is 40, s jitter buffer will set its size to the increasing this value may help if your but occasionally has spikes.

;jblog = no ; Enables jitterbuffer frame logging. Def ;-----------------------------------------------------------------------[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=from-trunk ; context for incoming calls, SMS and group=0 ; calling group rxgain=0 ; increase the incoming volume; may be ne txgain=0 ; increase the outgoint volume; may be ne autodeletesms=yes ; auto delete incoming sms resetdongle=yes ; reset dongle during initialization with u2diag=-1 ; set ^U2DIAG parameter on device (0 = di ; -1 not use ^U2DIAG command usecallingpres=yes ; use the caller ID presentation or not callingpres=allowed_passed_screen ; set caller ID presentation. By defaul ; see http://www.the-asterisk-book.com/unstable/applikati disablesms=no ; disable of SMS reading from device when ; sms reception. Use smsaspdu=yes to avoid problem when S smsaspdu=yes ; if 'yes' send SMS in PDU mode. language=en ; set channel default language mindtmfgap=45 ; minimal interval from end of previews D mindtmfduration=80 ; minimal DTMF tone duration in ms mindtmfinterval=200 ; minimal interval between ends of DTMF o callwaiting=auto

; if 'yes' allow incoming calls waiting; ; if 'no' waiting calls just ignored disable=no ; if 'yes' no load this device and just i exten=+1234567890 ; exten for start incoming calls, only in ; also set to CALLERID(dnid) dtmf=relax ; ; ; ; ;

; control of incoming DTMF detection, possible values off - off DTMF tone detection, voice data passed t use this value for gateways or if you do n inband - do DTMF tones detection relax - like inband but with relaxdtmf option default is 'relax' for backward compatibility

; 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 parameters and use imei=1234567 ; imei and imsi must contain exactly 15 digits ! ; imei/imsi discovery is available on Linux only imei=123456789012345 imsi=612849384756451 ; ; chown chmod

if you set audio and data parameter together with imei and/or imsi, you can use both imei and imsi together. In this case exact match b asterisk:asterisk /etc/asterisk/dongle.conf 664 /etc/asterisk/dongle.conf

?????????? # asterisk -rx "help dongle" dongle callwaiting dongle cmd dongle discovery dongle pdu dongle reload dongle remove dongle reset dongle restart dongle show device settings dongle show device state dongle show device statistics dongle show devices dongle show version dongle sms dongle start dongle stop dongle ussd ?? IMEI & IMSI? pbx*CLI> dongle show devices ID Group State RSSI Mode Submode Provider Name Model dongle 0 Free 19 0 0 805A015BF696FB K3520 Tips: ?? dongle ??????? modem ????? SIM card? Enable/Disable Call-Waiting on the dongle Send commands to port for debugging Discovery devices and create config Send PDU of SMS from the dongle Reload dongle Remove dongle Reset dongle now Restart dongle Show Dongle device settings Show Dongle device state Show Dongle device statistics Show Dongle devices state Show module version Send SMS from the dongle Start dongle Stop dongle Send USSD commands to the dongle

11

?? /etc/asterisk/dongle.conf? ; K3520 imei=3534360385000000 imsi=466890000000000 dongle ????? pbx*CLI> dongle show device statistics dongle0 -------------- Statistics ------------Device : dongle0 Queue tasks : 13 Queue commands : 34 Responses : 53 Bytes of readed responces : 657 Bytes of wrote commands : 268 Bytes of readed audio : 0 Bytes of wrote audio : 0 Readed frames : 0 Readed short frames : 0 Wrote frames : 0 Wrote short frames : 0 Wrote silence frames : 0 Write buffer overflow bytes : 0 Write buffer overflow times : 0 Incoming calls : 0 Waiting calls : 0 Handled input calls : 0 Fails to PBX run : 0 Attempts to outgoing calls : 0 Answered outgoing calls : 0 Answered incoming calls : 0 Seconds of outgoing calls : 0 Seconds of incoming calls : 0 ACD for incoming calls : -1 ACD for outgoing calls : -1 ASR for incoming calls : -1 ASR for outgoing calls : -1 pbx*CLI> dongle show device settings dongle0 ------------- Settings -----------Device : dongle0 Audio : /dev/ttyUSB1 Data : /dev/ttyUSB2 IMEI : 123456789012345 IMSI : 612849384756451

Channel Language : UTF-8 Context : dongle-incoming Exten : +85267896789 Group : 0 RX gain : 3 TX gain : -3 U2Diag : -1 Use CallingPres : Yes Default CallingPres : Presentation Allowed, Passed Screen Auto delete SMS : Yes Disable SMS : No Reset Dongle : Yes SMS PDU : Yes Call Waiting : auto DTMF : inband Minimal DTMF Gap : 45 Minimal DTMF Duration : 80 Minimal DTMF Interval : 200 Initial device state : start FreePBX/Asterisk ????
Inbound ??

1. ?? dongle.conf ?????? [defaults] > context=from-trunk [dongle0] > exten=<SIM ??????> 2. FreePBX > Inbound Routes > Add Inbound Roue DID Number: <SIM ????> Set Destination: <whatever you wanted>
Outbound ??

1. ?? Custom Trunk FreePBX > Trunks > Add Custom Trunk Trunk Description: 3G Modem Outbound Caller ID: <????> Custom Dial String: Dongle/dongle0/$OUTNUM$ ??dongle0 ??? dongle.conf ?????? 2. ?? Outbound Route FreePBX > Outbound Routes > Add Roue

Route Name: 3GModem Dial Patterns: 009|. Trunk Sequence: Dongle/dongle0/$OUTNUM$ ???? 3G Modem ???Vodafone K3520 ???? Linux ??-CentOS 5.5 ???? ???? ?? PASS PASS PASS ??

??? DTMF ?? (SJphone -> 3G Modem PASS > Vibo ?? ??? DTMF ?? (?? -> 3G Modem -> Asterisk IVR -> SIP ??) ????SMS ????SMS F.A.Q
?????

PASS PASS PASS

chan_dongle.c: -- [dongle0] Trying to connect on /dev/ttyUSB2... chan_dongle.c: unable to open /dev/ttyUSB2: No such file or directory Ans: chown asterisk:asterisk /dev/ttyUSB1 chown asterisk:asterisk /dev/ttyUSB2
?????

-- [dongle0] Trying to connect on /dev/ttyUSB2... -- [dongle0] Dongle has connected, initializing... -- [dongle0] Dongle needs to be reinitialized. The SIM card is not ready yet -- [dongle0] Error initializing Dongle -- [dongle0] Dongle has disconnected Ans: ?? 3G Modem ???????? SIM card???????

?? /dev/ttyUSB1, ttyUSB2 ?????? USB modem ???????? root?

Ans: ?? /etc/udev/rules.d/50-udev.rules KERNEL=="tty[A-Z]*", ??????? udev?????http://benjr.tw/node/407?


????? IVR ???????? DTMF ????????

NAME="%k", GROUP="asterisk", MODE="0660"

Ans: ??? /etc/asterisk/dongle.conf ????? dtmf=inband mindtmfgap=45 mindtmfduration=20, ???????????? 80 ?? 20 ?????????? mindtmfinterval=200

???? USB modem ???????

Ans: cat /proc/bus/usb/devices ???? http://www.telecom-cafe.com/forum/vi...555&highlight= http://www.elastix.org/en/component/...-dongle.html http://forge.asterisk.org/gf/project...se&forum_id=74 http://www.elastix.org/en/component/...bi-odicha.html Ubuntu ?? 3G ???? Howto use 3G dongle Huawei E1750 in OpenWrt [Raspberry Pi] GSM VoIP Gateway with Chan_dongle

Das könnte Ihnen auch gefallen