jookies / jasmin

Jasmin - Open source SMS gateway
http://jasminsms.com
Other
1.02k stars 549 forks source link

How Send MO SMS from Jasmin SMPP Server #1013

Closed bandiphani closed 4 months ago

bandiphani commented 2 years ago

Hi All,

How to send MO-SMS from Jasmin SMPP Server.

Use Case: One of our SMSC Vendor connected as Client to JASMIN SMPP Server with user Test1. Now we need to send MO SMS to SMSC Vendor through user Test1. How to fulfill this use case in Jasmin.

Thanks & Regards, Phani.

magojr commented 2 years ago

In your sentence there are some "incompatibilities" MO means Mobile Originated so it can be only a message sent from a mobile device (so uou are receiving the SMS not sending. Also the terms "Vendor" means "someone that sell something"... usually the Vendor is the upstream provider that sell you the service. But you wrote that he connect to your Jasmin so it may be.... ???a resellere of your service??? or ???a Customer of yours that want to send SMS??? I suggest you to explain the techincal role instead of the commercial one (Customer/Client or sms provider).

If you need to send SMS to an SMSC, you probably are trying to send MT (Mobile Terminated) SMS and all you need is "at page 1" of the documentation (plus a commercial contract with an sms provider/telco): https://docs.jasminsms.com/en/latest/installation/index.html#sending-your-first-sms

About the "incoming connection" from the ?customer? (that seems to be already done with user Test1 reading your post), you may found documentation here for the server config: https://docs.jasminsms.com/en/latest/apis/smpp-server/index.html and here for the MT routing: https://docs.jasminsms.com/en/latest/management/jcli/modules.html#mt-router-manager

I suspect that "MO" was a misunderstading and you probably was using MO router instead of MT router in order to route messages to an SMC, isn't it?

bandiphani commented 2 years ago

Thanks for you detailed explanation... actually we have Mobile APP, From this mobile app we want to initiate MO SMS and sent to Telco Operator (who bind to Jasmin SMPP Server as SMPP Client) through JASMIN.

Message flow Mobile App (MO-SMS) ---> JASMIN SMPP Server --> Telco Operator (Client)

Want to send MO-SMS from Jasmin through SMPP Server.. please find below Jasmin architecture image image

magojr commented 2 years ago

Ok, now it's clear your needs and it's not my use case so I may be in error but there something that seems strange to me and may explain the correct flow (but i'm not sure). As you can see the in the image you posted, SMS MO go out from the server and SMS MT come in from outside of the server. In the same picure in the lower part, the client part, the arrows are the opposite so the MT go out and MO come inside. As you are receiving in your server an SMS sendt from a mobile device i figured out this full flow:

START: Mobile App (MO-SMS) ---> USER OPERATOR SMSC (this is because every mobile device route to the user's operatos SMSC) ---> Other SMSC nodes based on commercial agreements (we don't care about these) ---> Assigned final number Operator SMSC (here in my opinion the MO flow arrived to his END) From here, the message is routed to you because you have an agreement with the operator, so youare not the sasigner of the phone number but you only get the SMS because the number assigner reroute it to you based on some commercial agreement. So this is a new START: START: the operator connect to your server as a client, generating a MT SMS ---> your jasmin should reroute it (??? it should probably change the destination number based on your goal???) ---> the message go out as MT SMS to achieve ?a mobile device? using an operator. (configurend using smppccm). https://docs.jasminsms.com/en/latest/management/jcli/modules.html#smpp-client-connector-manager

Please take care about these info because, as said it's my understanding of the documentation, not my use case and not tried before from me. Maybe wait a confirmation from the mantaining staff or try if it works as a test. Hope it may help you. Regards

bandiphani commented 2 years ago

Thanks for your quick response... we don't have any issue with MT SMS from Operator/Clients connected to Jasmin. Issue with MO SMS. How Jasmin will send MO-SMS to Operator/Clients. Need one example how it can be achieved through Jasmin SMPP Server API.

Thanks in advance.

magojr commented 2 years ago

For what i understood, MO SMS must come from a server to witch you connect. If it come to your Jasmnin node from a client connecting to your server it's a valid flow BUT it's called MT SMS, that's it. Take care about the arrows direction on the architecture picture. Architecture-overview-—-Jasmin-SMS-Gateway There isn't any arrow incoming in the server section (on top) for "MO SMS" if they come from third party, they are called MT SMS, the MO SMS has an only outgoing Arrow. So, Jasmin consider them MT SMS even if it's first origin is a mobile. As you wrote "Vendor connected as Client to JASMIN SMPP Server with user Test1" it simply cannot be MO and it will never follows MO routing.

Let's give it a try, just try to route and get it using MT routes and filters, I'think you can easily solve your doubt. Then, the part of change the destination number (if it needs to be rerouted to a mobile) or to catch the data and store it in a database is up to you coding from interceptors (or rabbit log queue consuming if it may be the case).

PS. That's also a correct naming because a message (for example) may start from my phone as MO and arrive to your phone as MT. Where is the switch? The switch is in the SMSC of the operator that "owns" (is assigner for) the destination number (To: field in the sms composition). The same SMSC responsible for the DLR (if requested). If an operator has a phone number assigned, when he (the operator) receive the sms, the MO flow ends. The operator probably will "re-route" it to the final user phone (or to your node in this case) but this is already a new MT flow.

bandiphani commented 2 years ago

Can you please give one use case for MO-SMS as show in the architecture diagram.

image

magojr commented 2 years ago

Not my case, so I don't know... but I can figure out at a telco operator: it gets sms from user trough cell hardware and must route the messages to other operators in order to achieve the destination. He need HLR to know the final operator because of number portability, HLR is made over SS7 protocol, I think they usually prefer comemrcial gateways linked with commercial hardware to route to direct-linked operators (Eg. the well known operators of the same country) after an SS7 query. But foreign traffic may be sent to some jasmin nodes, from there distributed to different suppliers based on country coverage and commercial agreement.

https://docs.jasminsms.com/en/latest/messaging/index.html#smppclientsmlistener Here the doc explain how the incoming messages (incoming in jasmin trough a client connection manager conmnected TO a foreign server) are splitted into DLR flow or SMS MO flow. This is the incoming point of MO SMS. The result is that the external SMSC/SME connected to the Jasmin server, may receive those MO SMS based on MO routing.

I suggest you to start from your use case and follow the documentation to understand the flow. -The SMS come from a connection from an external source connected as a client to your server => the flow is MT. -The SMS come from a connection that you made to an external SMPP server => the flow is MO.

farirat commented 2 years ago

What pdu you using for MO flow: deliver_sm or submit_sm ?

volga629-1 commented 2 years ago

That exactly what issue I have We get submit_sm in MO

PDU [command: CommandId.submit_sm, sequence_number: 17139, command_status: CommandStatus.ESME_ROK

Use case

Some upstream providers are not allowing inbound SMPP connection ( security ) hence they ask bind to Jasmin SMPP server

                                                MO (Active binds: CommandId.bind_transceiver: 1)
SIP SERVER ( SMPP Client ) -----> Jasmin SMPP Server <----------Active binds: CommandId.bind_transceiver: 1------ Upstream Provider  

Because transceiver: 1 I should be able send messages both direction , but can't figure out routing rules if it possible.

In general it should be possible by introducing traffic tagging.

Example:

Jasmin SMPP Server have 10 active binds as server then possible create special MO route called TagMORoute which will allow set tag RED_LINE on 2 from 10 binds.
In addition will be possible set push connector which will determine which provider (direction) send message. And last message is ACK for submitted SM.

Flow

Phone ---SMS--->SIP Server (client1) --- SMS ---> Jasmin SMPP Server  < ----- SMS ----Provider1---- Destination Number

Mo Rule

Type=TagMORoute Tag=RED_LINE Member=client1,provider1 PushConnector=smpps(Provider1)

Hopefully idea is clear

github-actions[bot] commented 5 months ago

Stale issue detected, remove stale label or comment or this will be closed soon.

github-actions[bot] commented 4 months ago

This issue was closed because it has been stalled more than a year with no activity.