We're currently running an install of Kannel 1.4.3-0ubuntu2 (as
installed from the Ubuntu respositories) with a Multi-Tech MTCBA-G-F4
(http://www.multitech.com/en_US/products/families/multimodemgprs/)
running to deliver SMS messages.
We've experienced twice so far over a few months (rarely) that the modem
appears to lose connectivity to the GSM operator. This is what happens
then (the SMS PDU has been redacted for confidentiality reasons)
2011-03-25 08:58:06 [14228] [8] DEBUG: boxc_receiver: sms received
2011-03-25 08:58:06 [14228] [8] DEBUG: send_msg: sending msg to box:
<127.0.0.1>
2011-03-25 08:58:08 [14228] [6] DEBUG: AT2[multitech-modem-1]:
TP-Validity-Period: 24.0 hours
2011-03-25 08:58:08 [14228] [6] DEBUG: AT2[multitech-modem-1]: -->
AT+CMGS=50^M
2011-03-25 08:58:08 [14228] [6] DEBUG: AT2[multitech-modem-1]: <-- >
2011-03-25 08:58:08 [14228] [6] DEBUG: AT2[multitech-modem-1]: send
command status: 1
2011-03-25 08:58:08 [14228] [6] DEBUG: AT2[multitech-modem-1]: -->
[redacted]
2011-03-25 08:58:08 [14228] [6] DEBUG: AT2[multitech-modem-1]: --> ^Z
2011-03-25 08:58:09 [14228] [6] DEBUG: AT2[multitech-modem-1]: <-- >
2011-03-25 08:58:09 [14228] [6] DEBUG: AT2[multitech-modem-1]: <-- ERROR
2011-03-25 08:58:09 [14228] [6] ERROR: AT2[multitech-modem-1]: Generic
error: ERROR
2011-03-25 08:58:09 [14228] [6] DEBUG: AT2[multitech-modem-1]: send
command status: -1
At this point, a restart of Kannel is not sufficient to get SMS delivery
working again. What I've had to do is to shut down Kannel, then use
Minicom to send an "AT+CFUN=1" command to the modem. This command is
used to perform a reset on the modem, as per the documentation available
from Multitech at
http://www.multitech.com/en_US/DOCUMENTS/Collateral/manuals/S000293J.pdf
(page 16).
Now, this is a pain to have to do manually, so ideally what I'd like to
do is to make it so that Kannel will automatically restart the modem if
it runs into any difficulty. Adding AT+CFUN=1 to the modem
initialization string should mean that the modem is automatically
restarted whenever Kannel is (I have not tested this...) but that only
solves half the problem - the other half is to automatically
re-initialize the modem whenever there's an ERROR like that.
Is there any convenient way to do this, perhaps I'm running an
antiquated version of Kannel and this functionality already exists in a
later version? Or is the only way to change this behaviour to change the
AT2 driver itself?