Page 1 of 2

Receiving Message from SMSC

Posted: Thu Jul 23, 2009 9:26 am
by Chandrasekar
Please can anyone suggest how to receive message from smsc

Posted: Thu Jul 23, 2009 9:36 pm
by adrianaitken
http://www.inetlab.ru/support/viewtopic.php?t=565

May 12 on the topic started by me :D

Posted: Sun Aug 02, 2009 2:00 am
by chaoraksa
Hi adrianaitken!

I read your post already and i still got sms from smsc but that sms only the first part of the longsms(more than 2) and the other part got nothing and it give me

Code: Select all

Invalid DELIVER_SM packet
What should i do?

Thanks,,
Raksa

Posted: Mon Aug 03, 2009 8:29 pm
by alt
Hi Raksa,

Sorry, I'm so overloaded this time.
But I try to solve your problem.

I need "Received Data" from your log.
Possible you disabled evReceiveData event in your code

Code: Select all

private void client_evReceiveData(object sender, byte[] data)
{
	AddToLog("Received Data: "+ByteArrayToHexString(data));
}
Can you post here this invalid packet?

Posted: Tue Aug 04, 2009 1:24 am
by chaoraksa

Posted: Tue Aug 04, 2009 7:32 am
by alt
There are only "Sending Data:" lines, but I need "Received Data:" to analyze invalid packet.

Posted: Tue Aug 04, 2009 8:57 am
by chaoraksa
Here it is

Code: Select all

3:55:14 PM: SmppClient connected
3:55:14 PM: Binding SmppClient for SystemId: xxxx
3:55:14 PM: SmppClient bound
3:55:14 PM: Bind result : system is NowSMS with status ESME_ROK
3:55:14 PM: Sending Data: 00000023000000090000000040d7bb1c3233363700323336376d61696c000034000000
3:55:14 PM: Received Data: 0000001c800000090000000040d7bb1c4e6f77534d53000210000134
3:55:55 PM: Received Data: 000000ce000000050000000000000002736d7363390001013835353938363130373533000001323336370040000000000100000099472d6765742075700a4f2d6f70656e20796f757220657965730a4f2d6f7574206f6620796f7572206265640a442d6461792068617320726973656e0a4d2d6d65727279206c6966650a4f2d6f6c6420647265616d732063756d20747275650a522d726973652024207368696e650a4e2d6e65772066726e64730a492d69646561206f66206c6966650a4e2d6e696365206675747572650a472d
3:55:55 PM: DeliverSm received :  Sequence : 2 SourceAddr : 85598610753 Coding : 0 MessageText : ine
N-new frnds
I-idea of life
N-nice future
G-
3:55:55 PM: Sending Data: 0000001180000005000000000000000200
3:55:57 PM: Received Data: 00000042000000050000000000000003736d736339000101383535393836313037353300000132333637004000000000010000000d474f4f44444159203420552120
3:55:57 PM: Sending Data: 0000001180000005000000080000000300
3:55:57 PM: Invalid DELIVER_SM packet
[/code]

Posted: Tue Aug 04, 2009 5:09 pm
by alt
Both DELIVER_SM packets have enabled UDHI (User-Data-Header-Indicator)
but actually short_message field does not contain user data header.

How did you receive such messages?

Posted: Tue Aug 04, 2009 5:25 pm
by chaoraksa
I got nothing just only one part of sms like i told u. Does it's ok with ur library or it wrong because of my code? please i really need it.


Thanks,,
Raksa

Posted: Tue Aug 04, 2009 5:44 pm
by alt
My library tries to find user data header in the short_message and it reports
"Invalid DELIVER_SM packet" when UDH cannot be found.
It is not problem in your code.
This problem comes from SMSC side. Please ask them why they send ems_class = 0x40 (which means UDHI is enabled), but short_message field does not contain UDH.

Posted: Tue Aug 04, 2009 5:57 pm
by chaoraksa
I don't know too but i try other library it can get all message. does it is problem with smsc?

Posted: Tue Aug 04, 2009 6:08 pm
by alt
Normal concatenated message should contain information about
1) msg_ref_num
2) total segments
3) sequence number
But your packets does not have such information neither in UDH nor in SAR parameters.

I'll think how to avoid "Invalid DELIVER_SM packet" in your second case.
But it is not normal for concatenated messages.

Posted: Tue Aug 04, 2009 6:31 pm
by chaoraksa
Yes I see that too when i debug ur code i don't get those 3 that why it not work. I need one thing only bec now i really need to complete my project. I just want to got all full sms(long sms) even it not concante. bec your sample can get only first message only.

Thanks,,
Raksa

Posted: Tue Aug 04, 2009 7:41 pm
by alt
Your first message is 153 (0x99) bytes length and I believe it contains

"G-get up
O-open your eyes
O-out of your bed
D-day has risen
M-merry life
O-old dreams cum true
R-rise $ shine
N-new frnds
I-idea of life
N-nice future
G-"

and second message is 13 (0x0d) bytes length and it contains
"GOODDAY 4 U! "

And there is no sequence information. You won't be able to concatenate these messages into one message.

Are you able to combine these messages with other library?

Posted: Tue Aug 04, 2009 9:33 pm
by alt
I've fixed "Invalid DELIVER_SM packet" problem for your examples.
But again without ability to combine these two messages. I hope you understood why I can not provide this ability.

Please download last version.