Dear experts,
I am developing an application that receives sms msg from modem . It reads sms successfully, but sender phone number has wrong results. When the sender is just a numebr , it reads it sucessfully , eg 010016545526. But when the sender is ID eg "vodafone" , it reads a strange Hex data , like 56A7A7E166789E which is from sender id = etisalat .

My question how to convert 56A7A7E166789E to etisalat

Thanks for support

change the reading of your modem
SerialPort1.Encoding = Encoding.ASCII

But i read SMS properly. ie, when i read the stored SMS , i can read the message text properly , and if the SMS is from a sender phone number , i can get the sender number. the problem is when sms is sent from gateway , the sms apprears in phone with sender name as text (eg Vodafone) , not number. this HEX code i need to convert to text.

Thanks

i did an app a while back with a caller id it was working fine
as i recall i used this at command AT+VCID to enable callerid in my usb modem and i set it to 1 (1 will format your callerid into ascii)
and i receive it like this
System.Text.Encoding.ASCII.GetString(your modem bytes)
in your case as long as you see the sender number and the text message as plain text then you are doing it right!
this is not a modem reading issue, it is what the phone company wants to show you
i tried to convert it but im not getting "etisalat".. first u need to find out what type of encoding they are using (try hash identifier)
if that doesnt work and the company always send the same id use this
callerid.text = callerid.text.replace("56A7A7E166789E","etisalat")
good luck

Thanks for support. I really appreciate it so much.
Regarding your points, it is valid , but I think there is a miss-communication. Can you please check this online website. it converts the PDU format , which is the data i get from phone or mode
http://www.diafaan.com/sms-tutorials/gsm-modem-tutorial/online-sms-pdu-decoder/

here you will find a sms data in pdu format . then i have to convert this pdu into text. I successfully converted it to message . but the sender works fine if it is phone number , if it is text , it fails.

BTW , what was the idea of your applicaiton ? I use 3G usb modem.

Thanks,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.