Digi IX20-WAG4 User Manual page 567

Table of Contents

Advertisement

Applications
1. Log into the IX20 command line as a user with full Admin access rights.
Depending on your device configuration, you may be presented with an Access selection
menu. Type admin to access the Admin CLI.
2. At the command line, type config to enter configuration mode:
> config
(config)>
3. At the config prompt, type:
(config)> system schedule sms_script_handling true
(config)>
4. Save the configuration and apply the change:
(config)> save
Configuration saved.
>
5. Type exit to exit the Admin CLI.
Depending on your device configuration, you may be presented with an Access selection
menu. Type quit to disconnect from the device.
See
Configure scripts to run automatically
Example digidevice.sms code
The following example code receives an SMS message and sends a response:
#!/usr/bin/python
# DIGI SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY,
# PROVIDED HEREUNDER IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND.
# DIGI HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
# ENHANCEMENTS, OR MODIFICATIONS.
#
# IN NO EVENT SHALL DIGI BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
# SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
# ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
# DIGI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
"""
NOTE: This code allows SMS messages to be sent and received and should be
reviewed before implementing. If you allow SMS incoming messages to modify or
run commands on the device, all incoming messages should be encrypted and
validated prior to execution.
"""
import os
import threading
import sys
from digidevice.sms import Callback, send
COND = threading.Condition()
def sms_test_callback(sms, condtion):
print(f"SMS message from {sms['from']} received")
IX20 User Guide
for more information about scheduling scripts.
Digidevice module
567

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ix20

Table of Contents