USSD Gateway Connection - java

need help regarding USSD Gateway.
I have to develop an app, which will directly connect to telco's USSD Gateway and listen messages on specific allocated short code number e.g. 444.
Actually, when a customer issue *444# USSD from his phone, request arrived at teleco's USSD Gateway, and it should forward to my app, which should be connected and listening mode. It process the request and give back the response. FYI, I have credentials from telco to connect with their USSD Gateway.
Anybody, can give me idea/help/concept how I can achieve this, in Java.
This is taking my head and I will be bungle of thankful for the person who help me anyway.

You need to know how their ussd gateway supports communication .. i.e if it is smpp then you need smpp protocol implementation to connect to their gateway. process the request and give response back.. just like sms.

[Solution]
Yes, we received USSDC Gateway specification, and they are totally different than SMPP specification.
So, we just developed TCP based program which assemble the packet in desired format and sent them to the USSDC gateway, the response is parsed as USSDC docs said.
That's how we make the communication possible.
We used Apache Mina for optimal & Java NIO for socket communication, threads & polling and stuff like that. Over Apache Mina, we just send / receive our PDU/Packets.

Related

Micronaut, how to send updates to a websocket endpoint? (Java)

Currently I discover micronauts and regarding websockets, I am looking for a solution. Let me describe the idea and the issue:
A Browser connects to a microservice with a websocket endpoint
A session-ID may be send to the websocket endpoint to identify the client
On a different http request a long term async work has been started (e.g. with a message queue)
The process finishes and needs to tell the right websocket endpoint-thread to give this update to the browser.
But what would be a good way to tell the correct websocket thread, connected to the browser, an update is available?
What if there are more than one websocket microservices, called by a balancer? I think then they can not share any "Session" with an http server?
Can the exact websocket endpoint subscribe to a message service like Kafka?
I just found people asking the same with no answer. But it seems to be a typical issue.

Check if client is online

So I have a server with a few clients.
When a client sends in a message I'd like the server to send it out to any one of the clients. However I don't really want the clients to be polling for messages, rather, I'd somehow like the server to check if they are online and then send them the message if they are.
I'm assuming the client will need a socket that's listening for incoming messages?
But what's a good method for the server to 'test' if the client is online? How the server know the address of the client?
I'm using Java with JAX-WS.
I'm sure there must be some method or design pattern for this that I'm not finding via google?

How to connect to SMSC server over SMPP protocol?

Respected All! I'm working on a project where we are developing an SMS-based disaster management system.
we have to send a request to an SMSC server over SMPP protocol to broadcast an SMS to all of its Subscribers. The cellular company has provided us with the IP/port, username and pasword to connect to their SMSC server.
I'm a bit confused on what steps should be followed to connect to their SMSC server?
kindly someone answer my following questions:
1) How to connect to the SMSC server over SMPP protocol?
2) Do we have to create our own SMPP server to send request to the SMSC server?
3) If the answer to Question# 2 is yes, then how to send request to SMSC server from SMPP server?
Any help will be appreciated! Thanks in advance!
"If your provider uses the HTTP Protocol to have sms sent over to them then you would need to use HTTP POST/GET method. On the other hand if your provider uses the SMPP (Short Message Peer to Peer) Protocol you would have to use the same to connect to them."-Source
So, it looks like the provider is using SMPP protocol. That's means you have to set up a SMSC connection. You would need to use a Java API for this, download these libraries in your project. There should be documentation on how to set things up in the Java documentation with the download. gl
Another option is the Open Source Mobicents SMSC server, which supports SMPP, SIP and SS7/SIGTRAN interfaces, as well as HTTP REST APIs via Restcomm.
In fact you may want to consider promptly building the SMS handling logic with the Restcomm Visual Designer and use the External Service feature to integrate with the rest of your business logic.
https://code.google.com/p/smscgateway/
http://www.restcomm.com/

How should I go about implementing this SMS notification system?

I have developed a application which involves billing users. To do this i have incorporated a GSM modem (gateway) that the SMS messages are sent through. This SMS message is sent to the user when he is billed with the bill details. The GSM modem is connected to a single computer but the billing can happen in other systems. How do I send an SMS notification for the changes that occur in the other systems, as the GSM modem is attached to a COM port on the computer*.
can we access the COM port of other system or shoould i use socket programming (with the machine with the modem(Server) listening for any connection, the sender has to send data in particular format and the server has to parse the data and send the message) or use Java RMI or is there any other solution.
Suggestions please....
Thank you
There are any number of solutions you can think up. The most common ones would be:
Communication with some kind of RPC, be it RMI, SOAP, plain HTTP, telnet, etc.
Using an SMS gateway such as Nordic Messaging’s EMG (probably overkill, though) or kannel (seems to be down currently).
We've got an SMS Gatway. We wrapped it in a J2EE-application with a webservice interface. That way we can send SMS from any of our applications. For the sake of java we made a little jar-file that talks to the webservice
SmsClient smsclient = new SmsClient();
smsclient.sendSms(from, to, message);
I built a similar system to this in the past where small embedded systems sat on a network and reported messages over the network to a central server that logged the messages and sent SMS messages when required.
I used a java socket listener that waited for UDP messages from the embedded units and the java program wrote to the GSM modem on the servers comm port. UDP was only used instead of TCP as it was simpler to configure on an embedded system.

web server sending command to a J2ME app

Can a J2ME app be triggered by a message from a remote web server. I want to perform a task at the client mobile phone as soon as the J2ME app running on it receives this message.
I have read of HTTP connection, however what I understand about it is a client based protocol and the server will only reply to client requests.
Any idea if there is any protocol where the server can send a command to the client without client initiating any request?. How about Socket/Stream based(TCP) or UDP interfaces?.
If the mobile device doesnt allow you to make TCP connections, and you are limited to HTTP requests, then you're looking at implementing "long polling".
One POST a http request and the web-server will wait as long time as possible (before things time out) to answer. If something arrives while the connection is idling it can receive it directly, if something arrives between long-polling requests it is queued until a request comes in.
If you can make TCP connections, then just set up a connection and let it stay idle. I have icq and irc applications that essentially just sit there waiting for the server to send it something.
You should see PushRegistry feature where you can send out an SMS to a specific number have the application started when the phone receives that SMS and then make the required HTTP connection or whatever. However, the downside of it is that you might have to sign the application to have it working on devices and you also need an SMS aggregator like SMSLib or Kannel
You can open socket connection and implement "Hide" (or "Minimize") functionality in your app. Call this to hide:
Display.getDisplay(MyMIDlet.instance).setCurrent(null);
Listen to the server in a loop, and if you receive some message, popup the applicaion by calling this from canvas:
Display.getDisplay(MyMIDlet.instance).setCurrent(this);
But it dosen't work on all devices.
Socket push are supported by j2me. But it could work only if your server could deliver data to your mobile phone. Most likely that operator gateway don't allow to do this.
Maybe it would be possible if your mobile has static external IP address - some operators could provide this for $$.

Categories