I'm using SMSLib in my java application to send messages, I make that using a usb modem as a gateway and send the messages to any phone throw it, the point here that when i receive the message it displays the sender as the sim number(the sim that exists in the usb modem).
The thing i want to do is to assign a name instead of the sim number so the recipient will see that name not the usb modem sim number
In most cases sender name is overridden by the Service Provider to their identification 'SIM number'.
By the Library it provides two locations to set sender information.
On gateway level
SerialModemGateway gateway = new SerialModemGateway("modem.com4",
"COM4", 57600, "Huawei", "E160");
gateway.setFrom("chandpriyankara");
On Message level
SMS
OutboundMessage msg = new OutboundMessage("+94123456789",
"SMS test: sample message from StackOverflow");
msg.setFrom("chandpriyankara");
I couldn't set a customer sender for SMS from either of my tested SMS providers[GSM Providers]. But this should work for buld SMS gateways. You have to discuss this with your service provider.
WAP
OutboundWapSIMessage wapMsg = new OutboundWapSIMessage("+94123456789",
new URL("http://stackoverflow.com/"),
"WAP test: sample message from StackOverflow!");
wapMsg.setFrom("chandpriyankara");
For WAP messages, some of GSM providers set my custom sender details, but not all.
You can put sender information to your message instance before sending.
message.setFrom("your sender information");
Additionally it may depend on your GSM provider.
Related
This is the code i found on SNS's official site to publish to a topic
String msg = "My text published to SNS topic with email endpoint";
PublishRequest publishRequest = new PublishRequest(topicArn, msg);
PublishResult publishResult = snsClient.publish(publishRequest);
System.out.println("MessageId - " + publishResult.getMessageId());
I am developing a chat app on for android using sns(it will also push notifications to the existing ios counterpart of the app)
if i want to publish to a single device directly can i give device's "ApplicationEndPointArn" instead of topicArn
SNS is intended to decouple notification service from application layer.
We could create a topic and add mobile endpoints as subscribers.
When a message is published to the topic all subscribers will get notified.
Apart from this if you would really need single endpoint messaging you could try,
PublishRequest publishRequest = new PublishRequest();
publishRequest.setTargetArn(endpointArn);
publishRequest.setMessage("SOME MESSAGE");
snsClient.publish(publishRequest)
where endpointArn is a device endpoint.
But make sure that you persist this device endpoint when device is registered in SNS and use the same returned EndpointArn for further communication.
I recently made an app which could send messages using the android smsManager api, and was wondering if there is a way to send a sms message through the an android api where the id of the sender is spoofed.
this is the current state of the code I used which sends the message to my cell:
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(recipient, scAdress, msg, null, null);
I've tried to edit the scAddress, but the message doesnt send (I was seeing if that would work, and wasn't sure what scAdress was)
I am also aware that I could use a site like Twilio or Tropo, but I want to send the message through the sim card, not over the internet.
I know you are interested in doing this on your current SIM via other means. Sorry I can't be of more help there. However, this does sound like a fun way to play with Twilio Wireless. You should check out the documentation here.
I am very new to java server side development, i have followed this link [http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/][1] and successfully implemented GCM with my android device, the problem is dont know how to trigger the GCM server while the content is updated in my db,i need to notify each and every update of my db to the user, am i need to watch the db using timer task something like that or is there any default solution to keep track of db ?
My Server side code :
regId = "my registration id";
String userMessage = request.getParameter("message");
Sender sender = new Sender(GOOGLE_SERVER_KEY);
Message message = new Message.Builder().timeToLive(30)
.delayWhileIdle(true).addData(MESSAGE_KEY, userMessage).build();
result = sender.send(message, regId, 1);
have tried with many solution but till now not getting exact solution, Suggestion, ideas or related links are most welcome
Thanks in advance
Without knowing the specific functionality of your server and app, I can only offer a general solution.
Each process in your server that performs DB updates that have to be pushed to some Android devices via GCM can write the messages and the registration IDs to some kind of queue.
Then you can have another process (or processes) that would consume the queue of GCM messages, and send them to Google. These processes can handle failures (retry sending the messages in case of temporary failures), and update your database of registration IDs if they receive responses with canonical registration IDs or errors such as InvalidRegistration or NotRegistered.
I am working on a service that sends out emails using SMTP. I set my SMTP properties this way:
property.setProperty("mail.transport.protocol", "smtp");
property.setProperty("mail.smtp.host", mailHost);
property.setProperty("mail.from", "xyz#gmail.com");
It also works for successful cases. However, when the email sending process fails, I want a notification sent to another one of our customer care email address(say, CC#gmail.com)..
How do I accomplish this. Is there any property among SMTP properties that lets me give like a "failure email address" so that it send a notification to that address, if a failure occurs
Bounced emails usually go back to the From: address, so you might change this to, say, "CC#gmail.com". This is also nice because it allows your customers back to you by just hitting "reply" in their mail client.
I am using Logica OpenSMPP (http://opensmpp.org/) to manage messages via SMPP protocol. I have a server, which can answer on my SMS and USSD messages, and I am developing a client. I have already managed to send DeliverSM message and get SubmitSM response from server via SMS: first I start SMSC, and then do something like that:
DeliverSM request = new DeliverSM();
request.setSourceAddr(from);
request.setDestAddr(to);
try {
request.setShortMessage(message);
} catch (WrongLengthOfStringException e) {
log.error("Error during setShortMessage", e);
}
request.setRegisteredDelivery((byte) 0);
new Transmitter(this.connection).send(request);
But I encounter some problems while doing the same for USSD. I know, that I must somehow use the following (cut from SMPP V3.4 Specification):
The ussd_service_op parameter is required to define the USSD service
operation when SMPP is being used as an interface to a (GSM) USSD
system.
What are the steps that I need to do to learn my client send both SMS and USSD messages to server?
This project hosts code for sending USSD. You may consider browsing the code to see how it's done, and then implement similar features in Logica OpenSMPP.