2023-01-14 20:40:05 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2023-10-21 11:47:10 +00:00
|
|
|
# BSD 2-Clause License
|
2023-01-14 20:40:05 +00:00
|
|
|
#
|
2023-04-13 08:41:12 +00:00
|
|
|
# Apprise - Push Notification Library.
|
2024-06-07 18:48:09 +00:00
|
|
|
# Copyright (c) 2024, Chris Caron <lead2gold@gmail.com>
|
2023-01-14 20:40:05 +00:00
|
|
|
#
|
2023-04-13 08:41:12 +00:00
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions are met:
|
2023-01-14 20:40:05 +00:00
|
|
|
#
|
2023-04-13 08:41:12 +00:00
|
|
|
# 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
# this list of conditions and the following disclaimer.
|
2023-01-14 20:40:05 +00:00
|
|
|
#
|
2023-04-13 08:41:12 +00:00
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
# this list of conditions and the following disclaimer in the documentation
|
|
|
|
# and/or other materials provided with the distribution.
|
2023-01-14 20:40:05 +00:00
|
|
|
#
|
2023-04-13 08:41:12 +00:00
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
|
|
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
2023-01-14 20:40:05 +00:00
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
# API Reference: https://smsmanager.cz/api/http#send
|
|
|
|
|
|
|
|
# To use this service you will need a SMS Manager account
|
2023-01-14 20:40:05 +00:00
|
|
|
# You will need credits (new accounts start with a few)
|
2024-06-07 18:48:09 +00:00
|
|
|
# https://smsmanager.cz
|
|
|
|
# 1. Sign up and get test credit
|
|
|
|
# 2. Generate an API key in web administration.
|
|
|
|
|
2023-01-14 20:40:05 +00:00
|
|
|
import requests
|
2024-06-07 18:48:09 +00:00
|
|
|
from .base import NotifyBase
|
2023-01-14 20:40:05 +00:00
|
|
|
from ..common import NotifyType
|
|
|
|
from ..utils import is_phone_no
|
|
|
|
from ..utils import parse_phone_no
|
|
|
|
from ..utils import parse_bool
|
2024-06-07 18:48:09 +00:00
|
|
|
from ..utils import validate_regex
|
|
|
|
from ..locale import gettext_lazy as _
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
class SMSManagerGateway(object):
|
2023-01-14 20:40:05 +00:00
|
|
|
"""
|
2024-06-07 18:48:09 +00:00
|
|
|
The different gateway values
|
2023-01-14 20:40:05 +00:00
|
|
|
"""
|
2024-06-07 18:48:09 +00:00
|
|
|
HIGH = "high"
|
|
|
|
ECONOMY = "economy"
|
|
|
|
LOW = "low"
|
|
|
|
DIRECT = "direct"
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Used for verification purposes
|
2024-06-07 18:48:09 +00:00
|
|
|
SMS_MANAGER_GATEWAYS = (
|
|
|
|
SMSManagerGateway.HIGH,
|
|
|
|
SMSManagerGateway.ECONOMY,
|
|
|
|
SMSManagerGateway.LOW,
|
|
|
|
SMSManagerGateway.DIRECT,
|
2023-01-14 20:40:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
class NotifySMSManager(NotifyBase):
|
2023-01-14 20:40:05 +00:00
|
|
|
"""
|
2024-06-07 18:48:09 +00:00
|
|
|
A wrapper for SMS Manager Notifications
|
2023-01-14 20:40:05 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
# The default descriptive name associated with the Notification
|
2024-06-07 18:48:09 +00:00
|
|
|
service_name = 'SMS Manager'
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# The services URL
|
2024-06-07 18:48:09 +00:00
|
|
|
service_url = 'https://smsmanager.cz'
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# All notification requests are secure
|
2024-06-07 18:48:09 +00:00
|
|
|
secure_protocol = ('smsmgr', 'smsmanager',)
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# A URL that takes you to the setup/help of the specific protocol
|
2024-06-07 18:48:09 +00:00
|
|
|
setup_url = 'https://github.com/caronc/apprise/wiki/Notify_sms_manager'
|
2023-01-14 20:40:05 +00:00
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
# SMS Manager uses the http protocol with JSON requests
|
|
|
|
notify_url = 'https://http-api.smsmanager.cz/Send'
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# The maximum amount of texts that can go out in one batch
|
|
|
|
default_batch_size = 4000
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
# The maximum length of the body
|
|
|
|
body_maxlen = 160
|
|
|
|
|
2023-01-14 20:40:05 +00:00
|
|
|
# A title can not be used for SMS Messages. Setting this to zero will
|
|
|
|
# cause any title (if defined) to get placed into the message body.
|
|
|
|
title_maxlen = 0
|
|
|
|
|
|
|
|
# Define object templates
|
|
|
|
templates = (
|
2024-06-07 18:48:09 +00:00
|
|
|
'{schema}://{apikey}@{targets}',
|
2023-01-14 20:40:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Define our template tokens
|
|
|
|
template_tokens = dict(NotifyBase.template_tokens, **{
|
2024-06-07 18:48:09 +00:00
|
|
|
'apikey': {
|
|
|
|
'name': _('API Key'),
|
2023-01-14 20:40:05 +00:00
|
|
|
'type': 'string',
|
|
|
|
'private': True,
|
2023-10-21 11:47:10 +00:00
|
|
|
'required': True,
|
2023-01-14 20:40:05 +00:00
|
|
|
},
|
|
|
|
'target_phone': {
|
|
|
|
'name': _('Target Phone No'),
|
|
|
|
'type': 'string',
|
|
|
|
'prefix': '+',
|
|
|
|
'regex': (r'^[0-9\s)(+-]+$', 'i'),
|
|
|
|
'map_to': 'targets',
|
|
|
|
},
|
|
|
|
'targets': {
|
|
|
|
'name': _('Targets'),
|
|
|
|
'type': 'list:string',
|
2023-10-21 11:47:10 +00:00
|
|
|
'required': True,
|
2023-01-14 20:40:05 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
# Define our template arguments
|
|
|
|
template_args = dict(NotifyBase.template_args, **{
|
2024-06-07 18:48:09 +00:00
|
|
|
'key': {
|
|
|
|
'alias_of': 'apikey',
|
|
|
|
},
|
2023-01-14 20:40:05 +00:00
|
|
|
'to': {
|
|
|
|
'alias_of': 'targets',
|
|
|
|
},
|
|
|
|
'from': {
|
|
|
|
'name': _('From Phone No'),
|
|
|
|
'type': 'string',
|
|
|
|
'regex': (r'^\+?[0-9\s)(+-]+$', 'i'),
|
2024-06-07 18:48:09 +00:00
|
|
|
'map_to': 'sender',
|
2023-01-14 20:40:05 +00:00
|
|
|
},
|
2024-06-07 18:48:09 +00:00
|
|
|
'sender': {
|
|
|
|
'alias_of': 'from',
|
2023-01-14 20:40:05 +00:00
|
|
|
},
|
2024-06-07 18:48:09 +00:00
|
|
|
'gateway': {
|
|
|
|
'name': _('Gateway'),
|
|
|
|
'type': 'choice:string',
|
|
|
|
'values': SMS_MANAGER_GATEWAYS,
|
|
|
|
'default': SMS_MANAGER_GATEWAYS[0],
|
2023-01-14 20:40:05 +00:00
|
|
|
},
|
|
|
|
'batch': {
|
|
|
|
'name': _('Batch Mode'),
|
|
|
|
'type': 'bool',
|
|
|
|
'default': False,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
def __init__(self, apikey=None, sender=None, targets=None, batch=None,
|
|
|
|
gateway=None, **kwargs):
|
2023-01-14 20:40:05 +00:00
|
|
|
"""
|
2024-06-07 18:48:09 +00:00
|
|
|
Initialize SMS Manager Object
|
2023-01-14 20:40:05 +00:00
|
|
|
"""
|
2024-06-07 18:48:09 +00:00
|
|
|
super(NotifySMSManager, self).__init__(**kwargs)
|
|
|
|
|
|
|
|
self.apikey = validate_regex(apikey)
|
|
|
|
if not self.apikey:
|
|
|
|
msg = 'An invalid API Key ({}) was specified.'.format(apikey)
|
2023-01-14 20:40:05 +00:00
|
|
|
self.logger.warning(msg)
|
|
|
|
raise TypeError(msg)
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
# Setup our gateway
|
|
|
|
self.gateway = self.template_args['gateway']['default'] \
|
|
|
|
if not isinstance(gateway, str) else gateway.lower()
|
|
|
|
if self.gateway not in SMS_MANAGER_GATEWAYS:
|
|
|
|
msg = 'The Gateway specified ({}) is invalid.'.format(gateway)
|
|
|
|
self.logger.warning(msg)
|
|
|
|
raise TypeError(msg)
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# Define whether or not we should operate in a batch mode
|
|
|
|
self.batch = self.template_args['batch']['default'] \
|
|
|
|
if batch is None else bool(batch)
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
# Maximum 11 characters and must be approved by administrators of site
|
|
|
|
self.sender = sender[0:11] if isinstance(sender, str) else None
|
|
|
|
|
2023-01-14 20:40:05 +00:00
|
|
|
# Parse our targets
|
|
|
|
self.targets = list()
|
|
|
|
|
|
|
|
for target in parse_phone_no(targets):
|
|
|
|
# Parse each phone number we found
|
2024-06-07 18:48:09 +00:00
|
|
|
# It is documented that numbers with a length of 9 characters are
|
|
|
|
# supplemented by "420".
|
|
|
|
result = is_phone_no(target, min_len=9)
|
2023-01-14 20:40:05 +00:00
|
|
|
if result:
|
2024-06-07 18:48:09 +00:00
|
|
|
# Carry forward '+' if defined, otherwise do not...
|
|
|
|
self.targets.append(
|
|
|
|
('+' + result['full'])
|
|
|
|
if target.lstrip()[0] == '+' else result['full'])
|
2023-01-14 20:40:05 +00:00
|
|
|
continue
|
|
|
|
|
|
|
|
self.logger.warning(
|
2024-06-07 18:48:09 +00:00
|
|
|
'Dropped invalid phone # ({}) specified.'.format(target),
|
2023-01-14 20:40:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
|
|
|
|
"""
|
2024-06-07 18:48:09 +00:00
|
|
|
Perform SMS Manager Notification
|
2023-01-14 20:40:05 +00:00
|
|
|
"""
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
if not self.targets:
|
2023-01-14 20:40:05 +00:00
|
|
|
# We have nothing to notify
|
2024-06-07 18:48:09 +00:00
|
|
|
self.logger.warning('There are no SMS Manager targets to notify')
|
2023-01-14 20:40:05 +00:00
|
|
|
return False
|
|
|
|
|
|
|
|
# error tracking (used for function return)
|
|
|
|
has_error = False
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
# Send in batches if identified to do so
|
|
|
|
batch_size = 1 if not self.batch else self.default_batch_size
|
|
|
|
|
2023-01-14 20:40:05 +00:00
|
|
|
# Prepare our headers
|
|
|
|
headers = {
|
|
|
|
'User-Agent': self.app_id,
|
|
|
|
}
|
|
|
|
|
|
|
|
# Prepare our targets
|
|
|
|
targets = list(self.targets) if batch_size == 1 else \
|
|
|
|
[self.targets[index:index + batch_size]
|
|
|
|
for index in range(0, len(self.targets), batch_size)]
|
|
|
|
|
|
|
|
while len(targets):
|
|
|
|
# Get our target to notify
|
|
|
|
target = targets.pop(0)
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
# Prepare our payload
|
|
|
|
# Note: Payload is assembled inside of our while-loop due to
|
|
|
|
# mock testing issues (payload singleton isn't persistent
|
|
|
|
# when performing follow up checks on the params object.
|
|
|
|
payload = {
|
|
|
|
'apikey': self.apikey,
|
|
|
|
'gateway': self.gateway,
|
|
|
|
# The number gets populated in the loop below
|
|
|
|
'number': None,
|
|
|
|
'message': body,
|
|
|
|
}
|
|
|
|
|
|
|
|
if self.sender:
|
|
|
|
# Sender is ony set if specified
|
|
|
|
payload['sender'] = self.sender
|
|
|
|
|
|
|
|
# Printable target details
|
|
|
|
if isinstance(target, list):
|
2023-01-14 20:40:05 +00:00
|
|
|
p_target = '{} targets'.format(len(target))
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
# Prepare our target numbers
|
|
|
|
payload['number'] = ';'.join(target)
|
|
|
|
|
2023-01-14 20:40:05 +00:00
|
|
|
else:
|
|
|
|
p_target = target
|
2024-06-07 18:48:09 +00:00
|
|
|
# Prepare our target numbers
|
|
|
|
payload['number'] = target
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# Some Debug Logging
|
2024-06-07 18:48:09 +00:00
|
|
|
self.logger.debug(
|
|
|
|
'SMS Manager POST URL: {} (cert_verify={})'.format(
|
|
|
|
self.notify_url, self.verify_certificate))
|
|
|
|
self.logger.debug('SMS Manager Payload: {}' .format(payload))
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# Always call throttle before any remote server i/o is made
|
|
|
|
self.throttle()
|
|
|
|
try:
|
2024-06-07 18:48:09 +00:00
|
|
|
r = requests.get(
|
2023-01-14 20:40:05 +00:00
|
|
|
self.notify_url,
|
2024-06-07 18:48:09 +00:00
|
|
|
params=payload,
|
2023-01-14 20:40:05 +00:00
|
|
|
headers=headers,
|
|
|
|
verify=self.verify_certificate,
|
|
|
|
timeout=self.request_timeout,
|
|
|
|
)
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
if r.status_code != requests.codes.ok:
|
2023-01-14 20:40:05 +00:00
|
|
|
# We had a problem
|
|
|
|
status_str = \
|
|
|
|
NotifyBase.http_response_code_lookup(r.status_code)
|
|
|
|
|
|
|
|
# set up our status code to use
|
|
|
|
status_code = r.status_code
|
|
|
|
|
|
|
|
self.logger.warning(
|
2024-06-07 18:48:09 +00:00
|
|
|
'Failed to send SMS Manager notification to {}: '
|
2023-01-14 20:40:05 +00:00
|
|
|
'{}{}error={}.'.format(
|
|
|
|
p_target,
|
|
|
|
status_str,
|
|
|
|
', ' if status_str else '',
|
|
|
|
status_code))
|
|
|
|
|
|
|
|
self.logger.debug(
|
|
|
|
'Response Details:\r\n{}'.format(r.content))
|
|
|
|
|
|
|
|
# Mark our failure
|
|
|
|
has_error = True
|
|
|
|
continue
|
|
|
|
|
|
|
|
else:
|
|
|
|
self.logger.info(
|
2024-06-07 18:48:09 +00:00
|
|
|
'Sent SMS Manager notification to {}.'.format(
|
|
|
|
p_target))
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
except requests.RequestException as e:
|
|
|
|
self.logger.warning(
|
2024-06-07 18:48:09 +00:00
|
|
|
'A Connection error occurred sending SMS Manager: to %s ',
|
2023-01-14 20:40:05 +00:00
|
|
|
p_target)
|
|
|
|
self.logger.debug('Socket Exception: %s' % str(e))
|
|
|
|
|
|
|
|
# Mark our failure
|
|
|
|
has_error = True
|
|
|
|
continue
|
|
|
|
|
|
|
|
return not has_error
|
|
|
|
|
|
|
|
def url(self, privacy=False, *args, **kwargs):
|
|
|
|
"""
|
|
|
|
Returns the URL built dynamically based on specified arguments.
|
|
|
|
"""
|
|
|
|
|
|
|
|
# Define any URL parameters
|
|
|
|
params = {
|
|
|
|
'batch': 'yes' if self.batch else 'no',
|
2024-06-07 18:48:09 +00:00
|
|
|
'gateway': self.gateway,
|
2023-01-14 20:40:05 +00:00
|
|
|
}
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
if self.sender:
|
|
|
|
# Set our sender if it was set
|
|
|
|
params['sender'] = self.sender
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# Extend our parameters
|
|
|
|
params.update(self.url_parameters(privacy=privacy, *args, **kwargs))
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
return '{schema}://{apikey}@{targets}' \
|
|
|
|
'?{params}'.format(
|
|
|
|
schema=self.secure_protocol[0],
|
|
|
|
apikey=self.pprint(self.apikey, privacy, safe=''),
|
|
|
|
targets='/'.join([
|
|
|
|
NotifySMSManager.quote('{}'.format(x), safe='+')
|
|
|
|
for x in self.targets]),
|
|
|
|
params=NotifySMSManager.urlencode(params))
|
2023-01-14 20:40:05 +00:00
|
|
|
|
2023-10-21 11:47:10 +00:00
|
|
|
def __len__(self):
|
|
|
|
"""
|
|
|
|
Returns the number of targets associated with this notification
|
|
|
|
"""
|
|
|
|
|
|
|
|
#
|
|
|
|
# Factor batch into calculation
|
|
|
|
#
|
|
|
|
# Note: Groups always require a separate request (and can not be
|
|
|
|
# included in batch calculations)
|
|
|
|
batch_size = 1 if not self.batch else self.default_batch_size
|
|
|
|
targets = len(self.targets)
|
|
|
|
if batch_size > 1:
|
|
|
|
targets = int(targets / batch_size) + \
|
|
|
|
(1 if targets % batch_size else 0)
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
return targets
|
2023-10-21 11:47:10 +00:00
|
|
|
|
2023-01-14 20:40:05 +00:00
|
|
|
@staticmethod
|
|
|
|
def parse_url(url):
|
|
|
|
"""
|
|
|
|
Parses the URL and returns enough arguments that can allow
|
|
|
|
us to re-instantiate this object.
|
|
|
|
|
|
|
|
"""
|
2024-06-07 18:48:09 +00:00
|
|
|
|
2023-01-14 20:40:05 +00:00
|
|
|
results = NotifyBase.parse_url(url, verify_host=False)
|
|
|
|
if not results:
|
|
|
|
# We're done early as we couldn't load the results
|
|
|
|
return results
|
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
# Get our API Key
|
|
|
|
results['apikey'] = NotifySMSManager.unquote(results['user'])
|
|
|
|
|
|
|
|
# Store our targets
|
2023-01-14 20:40:05 +00:00
|
|
|
results['targets'] = [
|
2024-06-07 18:48:09 +00:00
|
|
|
*NotifySMSManager.parse_phone_no(results['host']),
|
|
|
|
*NotifySMSManager.split_path(results['fullpath'])]
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# The 'from' makes it easier to use yaml configuration
|
|
|
|
if 'from' in results['qsd'] and len(results['qsd']['from']):
|
2024-06-07 18:48:09 +00:00
|
|
|
results['sender'] = \
|
|
|
|
NotifySMSManager.unquote(results['qsd']['from'])
|
|
|
|
|
|
|
|
elif 'sender' in results['qsd'] and len(results['qsd']['sender']):
|
|
|
|
# Support sender= value as well to align with SMS Manager API
|
|
|
|
results['sender'] = \
|
|
|
|
NotifySMSManager.unquote(results['qsd']['sender'])
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# Support the 'to' variable so that we can support targets this way too
|
|
|
|
# The 'to' makes it easier to use yaml configuration
|
|
|
|
if 'to' in results['qsd'] and len(results['qsd']['to']):
|
|
|
|
results['targets'] += \
|
2024-06-07 18:48:09 +00:00
|
|
|
NotifySMSManager.parse_phone_no(results['qsd']['to'])
|
2023-01-14 20:40:05 +00:00
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
if 'key' in results['qsd'] and len(results['qsd']['key']):
|
|
|
|
results['apikey'] = \
|
|
|
|
NotifySMSManager.unquote(results['qsd']['key'])
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
# Get Batch Mode Flag
|
|
|
|
results['batch'] = \
|
|
|
|
parse_bool(results['qsd'].get(
|
2024-06-07 18:48:09 +00:00
|
|
|
'batch', NotifySMSManager.template_args['batch']['default']))
|
2023-01-14 20:40:05 +00:00
|
|
|
|
2024-06-07 18:48:09 +00:00
|
|
|
# Define our gateway
|
|
|
|
if 'gateway' in results['qsd'] and len(results['qsd']['gateway']):
|
|
|
|
results['gateway'] = \
|
|
|
|
NotifySMSManager.unquote(results['qsd']['gateway'])
|
2023-01-14 20:40:05 +00:00
|
|
|
|
|
|
|
return results
|