See original README of this project.
Supported modules:
- Quectel EC25-E,
- SimCOM SIM7600G-H,
- SimCOM SIM900 (analog input/output, see here for more details),
- SimCOM SIM800C (analog input/output),
- SimCOM A7670E (analog input/output, see here for more details).
-
Minimal supported Asterisk version is 16 now.
-
Using JSON-formatted channel variables.
One may use
JSON_DECODEfunction in dialplan in order to extract required field.-
All
QUECTEL*variables are wrapped into one JSON-formattedQUECTELvariable. -
For SMS reporting
SMSJSON-formatted variable is defined.[incoming-sms] exten => sms,1,NoOp(SMS from device ${JSON_DECODE(QUECTEL,name)}) same => n,Set(SMS_TXT=${JSON_DECODE(SMS,msg)}) same => n,GotoIf($[${EXISTS(${SMS_TXT})}]?smstxt:smsempty) same => n(smstxt),Verbose(2, [${JSON_DECODE(QUECTEL,name)}] Incoming SMS from ${CALLERID(num)} [${JSON_DECODE(SMS,ts)}]: ${SMS_TXT}) same => n,Goto(smsbye) same => n(smsempty),Verbose(2, [${JSON_DECODE(QUECTEL,name)}] Empty incoming SMS from ${CALLERID(num)}) same => n(smsbye),Hangup
-
For USSD rporting
USSDJSON-formatted variable is defined.[incoming-ussd] exten => ussd,1,NoOp(USSD from device ${JSON_DECODE(QUECTEL,name)}) same => n,Set(USSD_TXT=${JSON_DECODE(USSD,ussd)}) same => n,Verbose(2, [${JSON_DECODE(QUECTEL,name)}] Incoming USSD [${JSON_DECODE(USSD,type_description)}]: ${USSD_TXT}) same => n,Hangup
-
For reporting
REPORTJSON-formatted variable is defined.[incoming-report] exten => report,1,NoOp(Report from device ${JSON_DECODE(QUECTEL,name)}) same => n,Set(REPORT_SUBJECT=${JSON_DECODE(REPORT,subject)}) same => n,Set(REPORT_DIRECTION=${JSON_DECODE(REPORT,direction)}) same => n,Set(REPORT_SUCCESS=${JSON_DECODE(REPORT,success)}) same => n,Set(REPORT_JSON=${JSON_DECODE(REPORT,report)}) same => n,Set(REPORT_INFO=${JSON_DECODE(REPORT_JSON,info)}) same => n,GotoIf($[${REPORT_SUCCESS} = 1]?reportsuccess:reportfail) same => n(reportsuccess),Verbose(2,${JSON_DECODE(QUECTEL,name)} - ${REPORT_SUBJECT} - ${REPORT_DIRECTION} - ${CALLERID(num)} - ${REPORT_INFO}) same => n,Goto(reportbye) same => n(reportfail),Verbose(1,${JSON_DECODE(QUECTEL,name)} - ${REPORT_SUBJECT} - ${REPORT_DIRECTION} - ${CALLERID(num)} - ${REPORT_INFO}) same => n,Goto(reportbye) same => n,Hangup
-
Renamed and reimplemented dialplan functions (applications).
-
QuectelStatusapplication renamed toQUECTEL_STATUSfunction.same => n,Set(QSTATUS=${QUECTEL_STATUS(quectel0)}) same => Verbose(2,Device status: ${QSTATUS})
-
New
QUECTEL_STATUS_EXfunction.Returns device status as JSON.
same => n,Set(QQSTATUS=${QUECTEL_STATUS_EX(quectel0)}) same => Verbose(2,Extended device status: ${QQSTATUS})
-
QuectelSendSmsapplication renamed toQUECTEL_SEND_SMSone. -
QuectelSendUssdapplication renamed toQUECTEL_SEND_USSDone.
-
-
-
quectel_uacoption renamed touacand it's a on/off/ext switch now.alsadevoption is also defaulted tohw:Android(whenuac=on) orhw:0(whenuac=ext). -
New
multipartyoption (on/off).Ability to handle multiparty calls wastly complicates audio handling. Without multiparty calls audio handling is much simpler and uses less resources (CPU, memory, synchronization objects). I decided to turn off multiparty calls support by default. You can enable it but remember that multiparty calls were never working in UAC mode and even in TTY (serial) mode this support should be considered as unstable. When
mutlipartyis off all multiparty calls are activley rejected. -
dtmfoption is a on/off switch now.DTMF detection is now performed by module itself (
AT+QTONEDETorAT+DDETcommand). -
New
dtmf_durationoption.Duration in miliseconds of generated DTMF.
-
New
msg_directoption (none/on/off).Specify how to receive messages (
AT+CNMIcommand):value description none do not change on messages are received directly by +CMT:URCoff messages are received by AT+CMGRcommand in response to+CMTIURC -
New
msg_storageoption (auto/sm/me/mt/sr).Setting prefered message storage (
AT+CPMScommand):value description auto do not change sm (U)SIM message storage me mobile equipment message storage mt same as me storage sr SMS status report storage location -
New
msg_serviceoption (-1/0/1).Selecting
Message Service(AT+CSMScommand):value description -1 do not change 0 SMS AT commands are compatible with GSM phase 2 1 SMS AT commands are compatible with GSM phase 2+ -
New
mohoption (on/off).Specify hold/unhold action:
value description on play/stop MOH off disable/enable uplink voice using AT+CMUTcommand -
txgainandrxgainoptions reimplented.-
TX/RX gain is performed by module itself.
This channel driver just sends `AT+QMIC`/`AT+QRXGAIN` (`AT+CMICGAIN`/`AT+COUTGAIN` for *SimCOM* module) commands. -
Default value is -1 now - use current module setting, do not change gain.
-
Range: 0-65535 or 0-100%.
See also
quectel autio gain txandquectel audio gain rxcommands below.
-
-
New
query_timeoption (on/off).value description on ping module with AT+QLTS(Quectel) orAT+CCLK(SimCOM) commandoff ping module with standard ATcommand -
New
slin16option (on/off).Enable/disable 16kHz audio (default is 8kHz).
Currently only SimCOM SIM7600X module handles 16kHz audio. -
New
qhupoption (on/off).For Quectel modules hang up calls using
AT+QHUP(Hang up Call with a Specific Release Cause) or standardAT+CHUP(Hang up Voice Call) command. -
New
dscioption (on/off).For Quectel modules
ccinfo(AT+QINDCFG="ccinfo"command) notifications are used by default. You can switch back to (less efficient)dsci(AT^DSCIcommand) notifications if your module does not supportccinfonotifications. -
Removed
disablesmsoption. -
smsdboption in[general]section defaulted to:memory:Internal SQLite3 database is stored in memory by default now.
You can still put database into a file by specyfying its full path (not recommended).See also: SQLIte3: In-Memory Databases.
-
New
smsdb_backupoption in[general]section.Path to backup of SMS database created via
quectel sms db backupcommand (see below).
-
simcomis an alias ofquectelcommands now.You may type
simcom…command instead ofquectel…one. For examplequectel show device statuscommand is equivalent ofsimcom show device statusone. -
More SMS commands.
quectel sms <device> <number> <msg>…command renamed toquectel sms send <device> <number> <msg>….Additional commands:
-
quectel sms list received unread <device> -
quectel sms list received read <device> -
quectel sms list all <device> -
quectel sms delete received read <device> -
quectel sms delete all <device> -
quectel sms delete <device> <idx> -
quectel sms direct on <device> -
quectel sms direct off <device> -
quectel sms direct auto <device> -
quectel sms db backupBackup of SMS database. Path to backup file is specified in configuration file via
smsdb_bakupgeneral option.
-
-
Additional fields in
show device statuscommand.Added
Access technology,Network Name,Short Network Name,Registered PLMN,BandandModule Timefields:-------------- Status ------------- Device : quectel0 State : Free Audio UAC : hw:Android Data : /dev/ttyUSB2 Voice : Yes SMS : Yes Manufacturer : Quectel Model : EC25 Firmware : EC25EXXXXXXXXXX IMEI : YYYYYYYYYYYYYYY IMSI : ZZZZZZZZZZZZZZZ GSM Registration Status : Registered, home network RSSI : 22, -69 dBm Access technology : LTE Network Name : Xxxxx Short Network Name : Yxxxx Registered PLMN : 26006 Provider Name : Zxxxxxx Band : LTE BAND 3 Location area code : 0000 Cell ID : AAAAAAA Subscriber Number : Unknown SMS Service Center : +99000111222 Module Time : 2000/01/01,00:00:00+08,1 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 : 0Some of theese fields are constantly updated via
actandcsqnotifications (seeAT+QINDCFGcommand).Additional fields in (JSON-formatted)
QUECTELvariable are also defined:-
network_name, -
short_network_name, -
privider, -
plmn, -
mcc, -
mnc, -
iccid.PLMN(Public Land Mobile Network Code) combinesMCC(Mobile Country Code) andMNC(Mobile Network Code).SMS Service Centeris now decoded from UCS-2.
-
-
Additional fields ins
quectel show device settingscommand.Displaying new configuration options:
------------- Settings ------------ Device : quectel0 Audio UAC : hw:Android Data : /dev/ttyUSB2 IMEI : IMSI : Channel Language : en Context : quectel-incoming Exten : Group : 0 RX gain : -1 TX gain : -1 Use CallingPres : Yes Default CallingPres : Presentation Allowed, Passed Screen Disable SMS : No Message Service : 1 Message Storage : ME Direct Message : On Auto delete SMS : Yes Reset Quectel : No Call Waiting : auto Multiparty Calls : No DTMF Detection : No Hold/Unhold Action : Mute Query Time : Yes Initial device state : start -
New
quectel audiocommands:These are just wrappers around few audio-related AT commands:
command AT command quectel audio modeAT+QAUDMODquectel audio gain txAT+QMICquectel audio gain rxAT+QRXGAINquectel audio loopAT+QAUDLOOP -
New
quectel uac applycommand:This command just sends
AT+QPCMV=0andAT+CFUN=1,1commands. It is helpful if you changeTTYmode toUACor vice versa.
-
UCS-2 encoding is mandatory now.
-
Call handling is based on automatic call status contifications.
- For Quectel modules
ccinfo(default) ordscinotifications are used. - For SimCOM modules
clccnotifications are used.
- For Quectel modules
-
Improved/extended AT commands response handler.
Changes required to properly handle
AT+CMGLcommand response. This command is now executed at initialization stage in order to receive unread messages. -
Simplyfying audio handling (when
mutlipartyis off, see above) in UAC and TTY mode.- Using less resources.
- Much simpler error handling.
- More debug messages.
- Reorganized, improved and simplified code.
-
Fixed
USSDsending/receiving. -
Getting
ICCIDfrom SIM card.ICCID: Integrated Circuit Card Identifier.It is possible to address device by
ICCID(j:prefix):exten => s,n,Dial(Quectel/j:898600700907A6019125/+79139131234) -
Code (re)formatted by
clang-formatutility.Links:
-
Using
CMakebuild system. -
Improved debug messages.
-
Non-printable characters are C escaped using custom function based on
ast_escape_c:``` DEBUG[11643]: at_read.c:93 at_read: [quectel0] [1][\r\n+QIND: "csq",27,99\r\n] DEBUG[11654]: at_read.c:93 at_read: [quectel0] [1][\r\n+CPMS: 0,25,0,25,0,25\r\n\r\nOK\r\n] DEBUG[11654]: at_read.c:93 at_read: [quectel0] [1][\r\n+QPCMV: 0,2\r\n\r\nOK\r\n] DEBUG[13411]: at_queue.c:181 at_write: [quectel0] [AT+QSPN;+QNWINFO\r] ``` -
Using Unicode characters in log messages.
Mostly arrows are used: ``` DEBUG[20486]: src/at_queue.c:128 at_queue_add: [quectel0][AT+QLTS=1] ↵ [OK][AT+QLTS=1\r] after head DEBUG[20486]: src/at_queue.c:336 at_queue_run: [quectel0][AT+QLTS=1] → [AT+QLTS=1\r] DEBUG[20486]: src/at_response.c:2718 show_response: [quectel0][AT+QLTS=1] ← [+QLTS][+QLTS: "2000/01/01,00:00:00+00,1"] DEBUG[20486]: src/at_response.c:2718 show_response: [quectel0][AT+QLTS=1] ← [OK][OK] DEBUG[20486]: src/at_response.c:246 at_response_ok: [quectel0][AT+QLTS=1] ✓ DEBUG[20486]: src/at_queue.c:72 at_queue_remove: [quectel0][AT+QLTS=1] ↳ [OK] tasks:0 ```
-
-
Redesigned SMS database.
-
Using modern serial port locking methods:
ioctl(fd, TIOCGEXCL, &locking_status)andioctl(fd, TIOCEXCL),flock(fd, LOCK_EX | LOCK_NB).
-
Using thread pools and task processors:
Reading and processing modem responses in separate threads. You may see basic statistics of used thread pools and task processors via
core show taskprocessors like chan-quectelcommand.Asterisk*CLI> core show taskprocessors like chan-quectel Processor Processed In Queue Max Depth Low water High water chan-quectel/pool 16874 0 1 450 500 chan-quectel/pool-control 33749 0 1 450 500 chan-quectel/simcom7600-00000051 39171 0 4 360 400 3 taskprocessors -
Many small optimizations.