SMPPCLIENT_RCVTIMEOUT

Smpp v3.4 client

Moderator: alt

Locked
ipc
Posts: 5
Joined: Tue Oct 30, 2007 12:07 pm

SMPPCLIENT_RCVTIMEOUT

Post by ipc » Tue Oct 30, 2007 12:12 pm

Hi !
I found your app while googleing online, great Job ! I keep getting an SMPPCLIENT_RCVTIMEOUT error everytime a message is being sent to the SMSC, and then it sends the message like 3 times. What causes the SMPPCLIENT_RCVTIMEOUT error ?
Thanks.
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Post by alt » Tue Oct 30, 2007 2:03 pm

SMPPCLIENT_RCVTIMEOUT error arises when SMSC did not response after 120 seconds. SmppClient has propery Timeout with default value 120 seconds.
Do you need to send concatenated message?
Which SubmitMode do you use? Payload or ShortMessage?
Try both. SMSC servers work different.
Can you send me the log from Sample Application?
ipc
Posts: 5
Joined: Tue Oct 30, 2007 12:07 pm

Post by ipc » Wed Oct 31, 2007 11:37 am

Thanks for your reply.

Here's a description of what am trying to do. I have an app that receives SMS and sends back an SMS reply after querying a database.
I plan to put the reply logic within the client_eveDeliverSm method, so that whenever a message comes in, I process it and reply to it right away.

private void client_evDeliverSm(object sender, DeliverSm data)
{

string messageText = SmppClient.GetMessageText(data.UserDataPdu.ShortMessage,data.DataCoding);

try
{
AddToLog("DeliverSm received : Reference Number :" + data.MessageReferenceNumber.ToString()
+ " Sequence : " + data.Sequence.ToString()
+ " SourceAddr : " + data.SourceAddr
+ " Sequence Number: " + data.SequenceNumber.ToString()
+ " Total Segments : " + data.TotalSegments.ToString()
+ " Coding : " + data.DataCoding.ToString()
+ " MessageText : " + messageText
+ " Counter: " + counter);


string [] Keywords = Parse(messageText);
IPCSMS.DBInsert("log",DBParse(Keywords));
SendMessage("It Works !!"); // this is the problem !!!


}
catch(Exception e)

{

AddToLog("**************evDeliverSm ERROR**************");
AddToLog(e.ToString());
AddToLog("**************END ERROR**************");


}

}


Everytime I do a reply using the SendMessage method, I get the following error:

Bad status returned during Submit : SubmitSmResp with status SMPPCLIENT_RCVTIMEOUT
Wait 60 seconds before next try


If I use the SendMessage method by a button click, it does work fine.

public void SendMessage(string Message)
{
client.SubmitText(
SubmitMode.Payload,
byte.Parse(tbSrcAdrTON.Text),
byte.Parse(tbSrcAdrNPI.Text),
strDestination.ToString(),
byte.Parse(tbDestAdrTON.Text),
byte.Parse(tbDestAdrNPI.Text),
strSource.ToString(),
DataCodings.Default,
Message);


}


So how can one handle an automatic reply to an incomming message ?

Here's the log

SmppClient connected
Binding SmppClient for SystemId: smppclient
Sending Data: 00000029000000090000000052def22d736d7070636c69656e740070617373776f7264000034050000
SmppClient bound
Bind result : sytem is SMPPSim with status ESME_ROK Bind Command BindTransceiverResp
Received Data: 00000018800000090000000052def22d534d505053696d00
DeliverSm received : Reference Number :0 Sequence : 1442 SourceAddr : 3333 Sequence Number: 0 Total Segments : 0 Coding : 0 MessageText : pharma 3 Counter: 2
Sending Data: 00000038000000040000000052def230000000323030300001013333333300000000000000000000000424000b497420576f726b73212121
Bad status returned during Submit : SubmitSmResp with status SMPPCLIENT_RCVTIMEOUT
Wait 60 seconds before next try
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Post by alt » Fri Nov 02, 2007 6:40 pm

SmppClient sends DeliverSmResp packet after evDeliverSm event.
You did not receive SubmitSmResp because SMSC still waits DeliverSmResp.
Solution could be to add evDeliverSmComplete which will be raised after sending response packet.
What do you think?
ipc
Posts: 5
Joined: Tue Oct 30, 2007 12:07 pm

Post by ipc » Mon Nov 05, 2007 12:36 pm

I think you're right, and adding an evDeliverSmComplete could be the right solution.
For the time being I am just storing the messages in a database as they arrive, a counter in the evDeliverSm method gets incremented.
With a timer I check if the counter>0, which means the DB has stored incomming messages, then I kick start another process that does a select statement to retrieve the messages from the DB and process them.

With an evDeliverSmComplete method, I could avoid this read/write process from the DB and just do a write once the message is processed.
And the delay caused by the timer interval wouldn't exist anymore, messages would get processed as they come in.

I guess that improvement would be in the next release or so...?

Thanks.
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Post by alt » Mon Nov 05, 2007 5:34 pm

I'll do my best to implement this in the next release.
I'll add two new events evDeliverSmComplete and evDataSmComplete.
ipc
Posts: 5
Joined: Tue Oct 30, 2007 12:07 pm

Post by ipc » Tue Nov 06, 2007 8:55 am

Thanks a lot, I'll look forward to testing that new release.
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Post by alt » Tue Nov 06, 2007 6:03 pm

Please try version 1.2.6
ipc
Posts: 5
Joined: Tue Oct 30, 2007 12:07 pm

Post by ipc » Wed Nov 07, 2007 3:08 pm

I've installed the new version, it takes care of the problem.
Thanks !!!
zmrcic
Posts: 4
Joined: Sat Mar 15, 2008 4:07 pm

HELP

Post by zmrcic » Sat Mar 15, 2008 4:21 pm

I have same problem but could not get to implemet new version....could you plesa post code for evDeliverSmComplete and evDeliverSm

Thanks....urgent for this evening
Locked