Skip to content

Instantly share code, notes, and snippets.

View MateusLeguir's full-sized avatar
:octocat:
Focusing

mateus MateusLeguir

:octocat:
Focusing
View GitHub Profile
@riceo
riceo / deliver_sm.py
Last active August 30, 2023 16:27 — forked from zspine/deliver_sm.py
Fork of zspine/deliver_sm.py, updated to work with changes in Jasmin SMS since the original was created + fixes a rabbitmq bug. This script will take a submit_sm PDU, send an OK back to the originator whilst replaying it to jasmin as a deliver_sm, effectively converting a submit_sm to deliver_sm. Also will send back a DELIVRD DLR!
# V0.64
# Bump the above version when modifying this script / pushing to the CLI -
# it's a nice way to confirm that the right code is running on jasmin.
import pickle
import logging
import uuid
import pika
from datetime import datetime
from jasmin.managers.content import DeliverSmContent
import pickle
from twisted.internet.defer import inlineCallbacks
from twisted.internet import reactor
from twisted.internet.protocol import ClientCreator
from twisted.python import log
from txamqp.protocol import AMQClient
from txamqp.client import TwistedDelegate
import txamqp.spec