Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me
MIDL
if (!comPort.IsOpen)
               comPort.Open();
           comPort.DiscardInBuffer();
           comPort.DiscardOutBuffer();


MIDL
atCommandStr = "AT";
           comPort.WriteLine(atCommandStr + (char)13);
           messageTXT.Text = comPort.ReadExisting();
            //baraye moshakas kardan halate PDU
           atCommandStr = "AT+CMGF=0";
           comPort.WriteLine(atCommandStr + (char)13);
           messageTXT.Text = comPort.ReadExisting();
           atCommandStr = "AT+CMGS=20";
           comPort.WriteLine(atCommandStr + (char)13);
           messageTXT.Text = comPort.ReadExisting();

MIDL
string path;
           //path = "0681398647575611000B819083660786F00008FF06062A0633062A" + Char.ConvertFromUtf32(26);
           path = "0681398647575611000B819083660786F00008FF06062A0633062A" + Char.ConvertFromUtf32(26);
           comPort.WriteLine(path + (char)13);
           //read immediately response
           messageTXT.Text = comPort.ReadExisting();
           comPort.Close();

run this code but do not send sms
where is problem ?
Posted

Perhaps you are missing a timestamp in the PDU message.

0681398647575611000B819083660786F00008FF06062A0633062A is converted to:


SMSC#9368747565
Sender:09386670680
TP_PID:00
TP_DCS:08
TP_DCS-popis:Uncompressed Text
class: "0"
Alphabet:UCS2(16)bit
تست
Length:3


Check out this links:

Online PDU Encoder and Decoder[^]

Library for Decode/Encode SMS PDU[^]

http://www.dreamfabric.com/sms/[^]
 
Share this answer
 
Comments
thatraja 11-Jun-11 7:25am    
Good bunch Kim, 5!. I have bookmarked too.
Kim Togo 11-Jun-11 12:03pm    
Thanks :-)
Instead of:

MIDL
path = "0681398647575611000B819083660786F00008FF06062A0633062A" + Char.ConvertFromUtf32(26);
comPort.WriteLine(path + (char)13);


do:

MIDL
path = "0681398647575611000B819083660786F00008FF06062A0633062A";
char eof = Convert.ToChar( 26 );
comPort.Write( path + eof );


best regards


edit.
i just checked your pdu length.

MIDL
atCommandStr = "AT+CMGS=20";


should be

MIDL
atCommandStr = "AT+CMGS=26";


in general:
AT+CMGS = (pduString.Length / 2) - 1
 
Share this answer
 
v2
Thanks From All
I Find My Problem
When Decode In Pdu Must Send Sumber Be Whitout 0
For Example

Send To:935421542
Message:دلتا سافت

Pdu Code:00110009A139451245F20008AA12062F0644062A06270020063306270641062A

After Decode:

CSS
Service center number:
Service center time stamp: 01/01/0001 12:00:00 ق.ظ
Message reference #: 0
Direction: Submited
Phone number: 935421542
Status report indication: False
Message:
دلتا سافت


This Pdu Format Is True
 
Share this answer
 
Comments
RajabzadehSara 8-Sep-12 3:37am    
I will send persian sms with gsm modem in C#, i have a problem, when i send a message, text message isnt correct, forexample textmessage = 'سلام', i recived '????'
please help me. Tanks.
Member 13443730 31-Oct-17 18:10pm    
Hello Hamid can you please share with me full working code i'll be really appreciated
i am try
http://twit88.com/home/utility/sms-pdu-encode-decode[^]

and use follow code
VB
AT+CMGW=17
07929083660786F011000B929063787465F50004AA032A332A

///////////////////////////////////////////////////////////////////////////
phone number for send :09386670680 and phone number for receive :09368747565
but again error
 
Share this answer
 
Comments
Kim Togo 11-Jun-11 12:03pm    
Use comment under my solution or else I do not get any email notify.
Perhaps the mobile operator expect full msisdn number ?
+4520908070 ? Or try to not define "Sender" . You cannot send sms as another person only the number defined by the mobile operator.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900