Question

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

Était-ce utile?

La solution

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.

Autres conseils

You can put sender information to your message instance before sending.

message.setFrom("your sender information");

Additionally it may depend on your GSM provider.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top