我正在尝试使用星号来配置和接听来电。这只是迈向发展的第一步。一旦调制解调器接听电话,我将开始制定拨号计划。请检查我的 conf 文件
加密狗.conf
[general]
interval=15
[defaults]
context=dongle-incoming
group=0
rxgain=0
txgain=0
autodeletesms=yes
resetdongle=yes
u2diag=-1
usecallingpres=yes
callingpres=allowed_passed_screen
disablesms=no
language=en
mindtmfgap=45
mindtmfduration=80
mindtmfinterval=200
callwaiting=auto
disable=no
exten=+1234567890
dtmf=relax unaltered diaplan
[dongle0]
audio=/dev/ttyUSB1
data=/dev/ttyUSB0
imei=<valid>
imsi=<valid>
extensions.conf
[general]
static = yes
writeprotect = no
clearglobalvars = no
[globals]
CONSOLE = Console/dsp ; Console interface for demo
;CONSOLE=DAHDI/1
;CONSOLE=Phone/phone0
IAXINFO = guest ; IAXtel username/password
;IAXINFO=myuser:mypass
TRUNK = DAHDI/G2 ; Trunk interface
TRUNKMSD = 1 ; MSD digits to strip (usually 1 or 0)
FEATURES =
DIALOPTIONS =
RINGTIME = 20
FOLLOWMEOPTIONS =
PAGING_HEADER = Intercom
[dongle-incoming]
exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${SMS})
exten => sms,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLE} - ${CALLERID(num)}: ${SMS}' >> /var/log/asterisk/sms.txt)
exten => sms,n,Hangup()
exten => ussd,1,Verbose(Incoming USSD: ${USSD})
exten => ussd,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLE}: ${USSD}' >> /var/log/asterisk/ussd.txt)
exten => ussd,n,Hangup()
exten => s,1,Dial(SIP/100,,)
exten => s,n,Hangup()
一些调试步骤
- 加密狗显示设备状态返回
- - - - - - - 地位 - - - - - - -
Device : dongle0
State : Free
Audio : /dev/ttyUSB1
Data : /dev/ttyUSB0
Voice : Yes
SMS : Yes
Manufacturer : huawei
Model : E303D
Firmware : 21.157.72.00.356
IMEI : <valid>
IMSI : <valid>
GSM Registration Status : Registered, home network
RSSI : 18, -114 dBm
Mode : No Service
Submode : No service
Provider Name : IDEA
Location area code : "A03D"
Cell ID : "B96B"
Subscriber Number : Unknown
SMS Service Center : <valid>
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
- 当我拨入电话时,状态不会改变。理想情况下,“传入”应该增加。它不是。
dongle sms dongle0 +911234567890 hi
,发送短信并且可以正常工作dongle cmd dongle0 dongle cmd dongle0 ATD+91123456789T;
,这行得通,出站呼叫发生dongle cmd dongle0 ATSO=1;
通了,但电话仍然没有被接听。理想情况下应该在 1 次响铃后拾取。
我在配置中缺少什么?我知道它有点小而愚蠢。