Jasmin Interceptor - sms

I am just sharpening my skills on SMS services and now a days I am trying to configuring JASMIN for this purpose.
I have installed jasmin SMS and GUI interface PlaySMS on ubuntu 18.04. I am also successful using SMS service to send sms using SMPP and now I want to go into more details. I want to grep SMS attributes and set some set of rules before sending it to the provider. For this purpose I wanted to know how to use interceptor with JASMIN and to configure the same.
I have referred https://jasmin.readthedocs.io/ for this. But here, I am not getting such file https://jasmin.readthedocs.io/en/latest/interception/index.html
Here are some logs, which indicate successful connection with interceptor.
2020-05-11 15:01:50 INFO 8354 Interceptor configured and ready.
2020-05-11 15:01:51 INFO 8354 Authenticated Avatar: iadmin
As per reference link, I have also added some filter for MT route in jasmin. Here is the configuration for this.
#Order Type Rate Connector ID(s) Filter(s)
#102 StaticMTRoute 3.45000 smppc(smpptest) <TG (tag=21403)>
#101 StaticMTRoute 1.36000 smppc(smppclient1) <TG (tag=21401)>
#100 StaticMTRoute
Now, when I try to send sms, it's working but interceptor is not coming in picture any way.
If anyone can correct me with what is wrong with my configuration or any other idea to fulfill my need, please let me know.
Here I am also sharing my SMPP log.
SMPP Log :
2020-05-07 16:54:34 INFO 934 SMS-MT [cid:smpptest] [queue-msgid:af4e11d7-d83b-4988-9ee8-c0de955554b3] [smpp-msgid:8fcc3dab-d715-41fd-9cac-6f1bb2ec5b0a] [status:ESME_ROK] [prio:0] [dlr:SMSC_DELIVERY_RECEIPT_REQUESTED] [validity:none] [from:006542] [to:8965475636] [content:'Hi u there, good morning!! \x00admin']
2020-05-07 16:57:45 INFO 934 SMS-MT [cid:smpptest] [queue-msgid:1f58e285-a64d-4fb0-ae96-8f0f2ad6a4ee] [smpp-msgid:e6aa27cc-9b30-4878-8463-096f2949e0ae] [status:ESME_ROK] [prio:0] [dlr:SMSC_DELIVERY_RECEIPT_REQUESTED] [validity:none] [from:006542] [to:+21401896324] [content:'Hello , please hurry up, boss summons us ! \x00admin']
2020-05-07 16:59:42 INFO 934 SMS-MT [cid:smpptest] [queue-msgid:c112affd-7932-4f88-b20d-d5164fddbb72] [smpp-msgid:f0bbfdd2-ef91-4262-93b4-e5ba63cef259] [status:ESME_ROK] [prio:0] [dlr:SMSC_DELIVERY_RECEIPT_REQUESTED] [validity:none] [from:006542] [to:21401963874] [content:'Hello , please hurry up, boss summons us ! \x00admin']```

Try enabling the Interceptor
sudo systemctl start jasmin-interceptord
You can also view the status by checking the logs at
/var/log/jasmin/interceptor.log
Hope this helps

Have you created an interception rule as well as an interception file (a python file)?
Interceptor file example (/opt/jasmin-scripts/interception/mt-interceptor.py)
routable.pdu.params['source_addr'] = 'NewSource'
routable.lockPduParam('source_addr')
Interceptor rule example (in Jasmin SMS Gateway's CLI)
telnet <ip> <port>
mtinterceptor -a
type DefaultInterceptor
script python3(/opt/jasmin-scripts/interception/mt-interceptor.py)
ok
persist
quit
You might need to restart the Jasmin SMS interceptor as well
sudo systemctl start jasmin-interceptord

Related

golang http server tailing logs kubeapi proxy

Maybe anyone faced a similar problem. We have a kubeapi proxy which impersonates users using sso.
Kubectl tool works just fine with any commands unless you do tail -f
I do see that app data is coming back every 1-5 seconds, but to output it takes ~ 45 seconds.
We use http/server from standard go packages and our proxy is based of https://github.com/ericchiang/kube-oidc/issues
TCP Dump attached. Thanks

How do I set up and test Gammu RunOnFailure script

Gammu documentation related to gammu-smsdrc config says
RunOnFailure New in version 1.28.93.
Executes a program on failure.
This can be used to proactively react on some failures or to
interactively detect failure of sending message.
The program will receive optional parameter, which can currently be
either INIT (meaning failure during phone initialization)
I have added the following to my /etc/gammu-smsdrc config file:
RunOnFailure = /home/pi/fail.sh
How do I access and use the parameter INIT? I want to setup SMS notificaion on failure of phone initialization.
I figured it out.
There are two scenarios of failure.
Problem with sending a message. In which case $1 (bash) will be an integer which is the row id of message in MySql database. I am not sure what its going to be if you have configured Gammu in file backend mode.
Gammu cant access or connect to the phone or GSM modem. In this case $1 = INIT.
I am using a PHP script to RunOnFailure so it is going to be $argv[1] for me.

Change path of RabbitMQ WebSocket MQTT endpoint?

I am running a RabbitMQ instance that provides MQTT over websockets via the rabbitmq_web_mqtt plugin.
For legacy reasons, I need to support a non-default WebSocket URL.
I saw in the documentation it is possible to change the port via the { port, 1234 } config, but I could not find any way to change the WebSocket URL. It is currently set to the default path of /ws
Is it possible to change the WebSocket URL without modifying the plugin?
This has been made configurable back September 2018. See already mentioned ticket.
Add line:
# echo 'web_mqtt.ws_path = /mqtt' >> /etc/rabbitmq/rabbitmq.conf
# service rabbitmq-server restart
Now being accessible by (compliant) MQTT Clients. For instance at:
ws://192.168.210.84:15675/mqtt
UPDATE: RabbitMQ now allows configuration of the WebSocket URL. See this answer.
After some research, I found out that the path is not configurable

Set fixed rport in FreeSWITCH/Sofia subscribe message

The problem is that I know next to nothing about SIP, or FreeSWITCH, yet have been tasked with figuring this out.
The setup:
The FreeSWITCH client sends a subscribe to a remote server to receive presence updates. The client is behind a fairly restrictive firewall and NAT.
The server replies with the normal unauthorized, and Sofia replies, and we receive the SIP/2.0 200 OK message, its VIA header contains an rport for a port number we don't have open or forwarding to our FreeSWITCH installation.
We never receive the notify that ought to follow the 200 OK.
Subsequent subscribes returns different rport designations.
Is there a way to configure FreeSWITCH/Sofia to always use a specific port for the rport parameter?
Edit: We never managed to solve it, but the remote service did solve it by adding the correct routes to their firewall.
Is the far end server setup to allow NOTIFY to be sent to your client?
If you receive the 200 OK response to the initial SUBSCRIBE then that sets up the SIP dialog I believe (the dialog is a end-point to end-point association).
BTW you set up FS to be the presence watcher client? Thats cool since I tried doing that but the documentation gave me a headache and moved on to other things.
Since you sent the initial subscribe NAT shouldn't be a problem right? since rport should have the port to use. I would always use port 5060, have your FW people let udp port 5060 port in and out freely, use Fail2ban to filter your traffic.
But have no idea how FS works, and NAT firewalls are the greatest evil :-). Sorry and best of luck.

How to use notificationconf?

I have read THIS tutorial about creating Push nodes and posting/subscribing to notifications.
The only problem I have met is that it seems that notificationconf unable to create that node...
My first question: are nodename (parameter of notificationconf tool) and notificationName (NSString which I use from app) the same things?
Second:
notificationconf createnode push.example.com BFMyTestPushhNotification beefon
Enter password: // password from Open Directory for user beefon - it is Admin of the 10.6 server
2010-01-24 13:24:58.916 notificationconf[15221:903] created XMPP session
2010-01-24 13:24:58.931 notificationconf[15221:903] Connecting to push.example.com:5222 with user com.apple.notificationuser#push.example.com/TestPubsub, security = 2 ...
2010-01-24 13:24:59.130 notificationconf[15221:903] sessionCallback (event 1)
2010-01-24 13:24:59.130 notificationconf[15221:903] Session stopped (event 1)
What I do wrong?
And posting notification from app does nothing...
Thanks for any help!
I've been trying to use Snow Leopard Server's Push Notification service with a custom application based on XMPP Publish–Subscribe. I struggled to create a node but finally figured it out.
Track down the password for the service account com.apple.notificationuser. You can find it, for example, in /private/etc/dovecot/notify/notify.plist.
Connect to your push notification server with JID com.apple.notificationuser#your-chat-server-hostname.com and that password.
Create nodes the normal way. In XMPPFramework it's like this:
XMPPJID *serviceJID =
[XMPPJID jidWithString:#"pubsub.your-chat-server-hostname.com"];
XMPPPubSub *xmppPubSub = [[XMPPPubSub alloc] initWithServiceJID:serviceJID];
[xmppPubSub createNode:#"pubsub.your-chat-server-hostname.com`
withOptions:nil];
The server creates the node. It responds with an iq, but not the one the spec requires. It does send a compliant error if the node already exists.
<iq xmlns="jabber:client"
to="com.apple.notificationuser#your-chat-server-hostname.com/..."
from="pubsub.your-chat-server-hostname.com"
id="...:create_node" type="result"/>
Connect using that same user to publish your updates.
I was never able to get notificationconf to work.
Notifications are easy to use on the same node, but harder across a network. Especially, I don't think too many people are actually using it, as Google search results are scarce :) Now, regarding your questions:
For 1: yes, you need to have matching nodename and notificationName. The man page says so (although not crystal-clear):
createnode hostname nodename username
Creates a node on the server to send notifications using. Before
a client can subscribe to notifications with a given name, the
server must be configured with a node with a matching name.
So, first you have to create the node, then you can listen to notifications of a given name. Otherwise, you don't get the notifications.
For 2: I get this error when there is no XMMP daemon running (i.e. port 5222 is closed). Is that port open for you? (check the output of nmap -p 5222 push.example.com).

Resources