0

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

Muhammed Refaat
  • 8,914
  • 14
  • 83
  • 118

2 Answers2

2

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.

Chand Priyankara
  • 6,739
  • 2
  • 40
  • 63
  • well, this solution works for some purposes for me, but on the other side i want that name to appear on the phone itself. any ideas ? – Muhammed Refaat Jun 24 '13 at 07:39
  • 1
    As my experience it works for WAP messages but not SMS since the operator overrides the setFrom by sender mobile number. So it depends on the service provider's configurations. – Chand Priyankara Oct 18 '14 at 06:44
1

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

message.setFrom("your sender information");

Additionally it may depend on your GSM provider.

  • well, this solution works for some purposes for me, but on the other side i want that name to appear on the phone itself. any ideas ? – Muhammed Refaat Jun 24 '13 at 07:39