Skip to main content

Manage Jasmin SMS Gateway through telnet

Project description

Jasmin Telnet

Manage Jasmin SMS Gateway's configurations through telnet

I wrote some of it and collected most of from: jasmin-api and jasmin-web-panel.

Also some of the logic is ported from this PHP package jasmin-web by nnikitos95

Table of Contents

  1. Installation Instructions
  2. Usage Instructions

Installation Instructions

PYPI

pip3 install -U jasmin-telnet

From Source

git clone https://github.com/BlackOrder/jasmin_telnet.git
cd jasmin_telnet
pip3 install .

Usage Instructions

Import

from jasmin_telnet.proxy import Proxy as JasminTelnetProxy

Initialize variables

jasmin_proxy = JasminTelnetProxy(
    host=**jasmin_cli_host**,                               # Default: 127.0.0.1
    port=**jasmin_cli_port**,                               # Default: 8990
    timeout=**jasmin_cli_timeout**,                         # Default: 10
    auth=**jasmin_cli_auth**,                               # Default: True
    username=**jasmin_cli_username**,                       # Default: "jcliadmin"
    password=**jasmin_cli_password**,                       # Default: "jclipwd"
    standard_prompt=**jasmin_cli_standard_prompt**,         # Default: "jcli : "
    interactive_prompt=**jasmin_cli_interactive_prompt**,   # Default: "> "
    log_status=True,                                        # Default: False
    logger=self.logger_callback                             # Default: None
)

Sync

Single Module

To sync, remove any sub-module not sent and add not existing and update existing.

jasmin_proxy.sync(
    module="smppccm",
    sub_modules_data={
        "cid1":{
            "cid":"cid1",
            "username":"someUsername1",
            "host":"127.0.0.1"
        },
        "cid2":{
            "cid":"cid2",
            "username":"someUsername2",
            "host":"127.0.0.2"
        },
        "cid3":{
            "cid":"cid3",
            "username":"someUsername3",
            "host":"127.0.0.3"
        }
    }
)

Sync All

jasmin_proxy.syncAll(
    collection_data={
        "smppccm": {
            "cid1":{
                "cid":"cid1",
                "username":"USERNAME",
                "host":"127.0.0.1"
            },
            "cid2":{
                "cid":"cid2",
                "username":"USERNAME",
                "host":"127.0.0.2"
            },
            "cid3":{
                "cid":"cid3",
                "username":"USERNAME",
                "host":"127.0.0.3"
            }
        },
        "group":{
            "gid1":{
                "gid": "gid1"
            }
        },
        "user":{
            "uid1": {
                "uid": "uid1",
                "gid": "gid1",
                "username": "USERNAME",
                "password": "PASS"
            }
        }
    }
)

Beware, any module not included will be flushed. if you send this:

jasmin_proxy.syncAll()

or

jasmin_proxy.syncAll(collection_data={})

or

jasmin_proxy.syncAll(collection_data=None)

This will flush all of Jasmin configurations.

Add New

jasmin_proxy.add(
    module="user",
    sub_id="uid3",
    options={
                "uid": "uid3",
                "gid": "gid1",
                "username": "USERNAME",
                "password": "PASS"
            }
)

Edit

jasmin_proxy.edit(
    module="user",
    sub_id="uid3",
    options={
                "password": "NEW_PASS"
            }
)

Remove

jasmin_proxy.remove(
    module="user",
    sub_id="uid3"
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jasmin_telnet-0.0.32.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jasmin_telnet-0.0.32-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file jasmin_telnet-0.0.32.tar.gz.

File metadata

  • Download URL: jasmin_telnet-0.0.32.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for jasmin_telnet-0.0.32.tar.gz
Algorithm Hash digest
SHA256 1a0a9e46ce14e22c55c7fb83338fc1ad527b1cdf4276aacead401b25ccee941a
MD5 705b28b3b12e9a13b4cb90e7b3b626ae
BLAKE2b-256 1f1070bd25c8e52a56725a26f2e917b3b9e4749e94a81efb1c643e80bdb91bda

See more details on using hashes here.

File details

Details for the file jasmin_telnet-0.0.32-py3-none-any.whl.

File metadata

  • Download URL: jasmin_telnet-0.0.32-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for jasmin_telnet-0.0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 962b3c51f7eb395752e0fd86a7b522287af37859f5edae916bd448119dd8d520
MD5 7d6f3f1d2c083555ad2d4cfabc484bef
BLAKE2b-256 de6ac227f06692c17d44b2818c9adb9a62a1bbc478f0cb12f26399cf38952d9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page