DLR occasionally failed, with "xxxx.SMS" files piling up in SMS-IN ...

DLR occasionally failed, with "xxxx.SMS" files piling up in SMS-IN ... SearchSearch
Author Message
Nelson Lam
New member
Username: Nelsonlam

Post Number: 32
Registered: 02-2013
Posted on Wednesday, March 09, 2016 - 11:13 am:   

Dear Support team

We are using NowSMS as SMS Gateway (v2013.09.26) and the conection is as follows:

ClientA-SMS-GW --> (SMPP) --> NowSMS --> (SMPP) --> MobileOp

- ClientA SMS are submitted to MobileOp with DLR relaying back to ClientA successfully

- Recently ClientA complains that some of the DLR are missing.

- When we investigate the problem by looking at files under "NowSMS" directory,
we found that thousands of "XXXXX.SMS" files are piling up in directory
".\NowSMS\SMS-IN\"

- The NowSMS has 2 x SMPP bindings to MobileOps with 2 different IP address defined
under the same SMSC route names SMS_MBOP

- The "Process Received SMS Messages" is checked in 2 way SMS tab

- Under the SMS users tab, the ClientA, the "Accept Received Messages for this user" is
checked.

- ClientA said some of the DLR are missing.

- We have sent smsdebug log and other log files to nowsms@nowsms.com with subject
Attention: Des

- Pls help to investigate the issue in xxxxx.SMS files piling up and DLR missing at client
side.

Thanks.

Best Regards
Nelson
Nelson Lam
New member
Username: Nelsonlam

Post Number: 33
Registered: 02-2013
Posted on Wednesday, March 09, 2016 - 02:56 pm:   

Dear Support Team,

Further to our investigation:

ClientA-SMS-GW --> (SMPP) --> NowSMS --> (SMPP) --> MobileOp

We did trace one of the SMS/DLR messageID where ClientA complained no DLR, we found that :
1. After received SMS from ClientA, NowSMS returned messageID=5400384B
2. NowSMS then passed this SMS to MobileOp and MobileOp returned
messageID=11.000.20160309.173944.403
3. In NowSMS directory ".\NowSMS\SMS-IN", we did find the filename: 5400384E.SMS which
contained the content of the delivery receipt for this SMS. The file content is listed below.
======================================
[SMS-IN]
Sender=SASASASA
PhoneNumber=DADADADA
Data=id:11.000.20160309.173944.403 sub:001 dlvrd:001 submit date:1603091639
done date:1603091639 stat:DELVRD err:000
pid=00
dcs=00
Binary=0
ReceiptDelivered=Yes
ReceiptMessageId=11.000.20160309.173944.403
ModemName=SMPP - xxx.xxx.xxx.xxx:ppp
======================================

I think NowSMS failed in matching the messageId to the DLR due to incorrect messageId recorded
in the filename. Pls help to investigate the problem. Thanks.

Best Regards
Nelson
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5598
Registered: 08-2008
Posted on Thursday, March 10, 2016 - 01:56 pm:   

Hi Nelson,

The problem occurs because there are connections to the same SMSC on multiple IP addresses.

In the SMPP world, message IDs are not globally unique. Each SMSC has its own message ID space.

So let's take your example above.

In the SMSOUT log we see:

2016-03-09 17:39:43,5400384B,ip.omitted,xxxxxxxxxxx,OK -- SMPP - 172.18.6.72:8301,SubmitUser=aaaaaa;SMSCRouteName=bbbbbbbb;Sender=ccccccc;SMSCMsg Id=11.000.20160309.173944.403;Text="zzzz"

The SMSIN log records the receipt arriving:

2016-03-09 17:49:48,+ xxxxxxxxxxx,SMPP - 172.18.6.71:8301,Text="id:11.000.20160309.173944.403 sub:001 dlvrd:001 submit date:1603091639 done date:1603091639 stat:DELVRD err:000";SMSCRouteName= bbbbbbbb;Recip=+ xxxxxxxxxxx;SMSCReceiptMsgId=11.000.20160309.173944.403;SMSCReceiptMsgIdOrig=11. 000.20160309.173944.403

The reason the message ID cannot be resolved is because the message was sent out via 172.18.6.72:8301, but the delivery report arrives from 172.18.6.71:8301

NowSMS does not know that these are the same SMSC.

The solution is described here: http://www.nowsms.com/smpp-receipt-message-id-tracking-over-multiple-connections

There is a way to configure NowSMS to use the same receipt message ID database for multiple connections. This should only be done when you are connecting to an SMSC via multiple IP addresses where you are certain that the SMSC shares a message ID space across the IP addresses.

To enable this, it is necessary to edit the SMSGW.INI file.

Under the [SMPP – server:port] section header for each connection that shares the same receipt message ID namespace, add TrackSMPPReceipts=somename

“somename” can be any text that makes sense to you. NowSMS will group together receipt message ID tracking for all connections that share the same TrackSMPPReceipts value.

--
Des
NowSMS Support
Nelson Lam
New member
Username: Nelsonlam

Post Number: 34
Registered: 02-2013
Posted on Thursday, March 10, 2016 - 05:01 pm:   

Hi Des

- Appreciated with your prompt response.

- If we have multi-parts SMS with MessageID like 54003da4-2-1 and 54003da4-2-2,
will it help solving the problem by putting back the setting "TrackSMPPReceipts=xxx" ????

I would like to clarify the following issue:
- I've 2 binding of different IP 1.1.1.1:3333 and 1.1.1.2:3333
using the same route name ABC_Route. I have put back "TrackSMPPReceipts" this morning
around 10am(10Mar) where NowSMS stored around 12000 xxxxx.SMS files under
"NowSMS\SMS-IN" directory. (Add procedures: stop NowSMS service, add setting
and start NowSMS again)

- Right after that we found a new directory created "NowSMS\SMPPData\ABC_Route" and
a DB file 20160310.DB was created.

- On the same day at around 23:30 we found that
a. 21000 xxxxx.SMS files stored, an increase by 9000 since the setting was put back
b. There are old directories "SMPPData\SMPP-1.1.1.1_3333 and SMPP-1.1.1.2_3333"
c. Files stored under SMPP-1.1.1.1_3333:
20160307.DB and 20160308.DB (both file date = 8Mar 6pm)
20160309.DB and 20160310.DB (both file date = 10Mar 10am)
d. Files stored under SMPP-1.1.1.2_3333:
20160304.DB,20160305.DB,....,20160308.DB (all files dated on or before 9Mar 00:00)
20160309.DB (file date = 10Mar 00:00
20160310.DB (file date = 11Mar 00:00) ==>> why this file not stopped update and size increase ??
20160311.DB (file date = 11Mar 00:00) ==>> why still create new file and and size increasing ???

- So... what should I do with those files in "c." and "d." ?

- Should I delete all these directories and files in "c." and "d."?

- The number of files keep increasing in "a." why ?? Will those files finally stops increasing ?

- With new DB file created in "d.", does it means that "TrackSMPPReceipts" setting not
functioning at all ???

Thanks.

Best Regards
Nelson
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5599
Registered: 08-2008
Posted on Thursday, March 10, 2016 - 05:59 pm:   

Hi Nelson,

Whenever you make this change, it is going to be a problem for pending delivery reports that have not yet been received.

Make sure TrackSMPPReceipts=ABC_Route is in SMSGW.INI twice, once under each SMPP connection that needs it.

Daily DB files should be created in NowSMS\SMPPData\ABC_Route, but stop in SMPPData\SMPP-1.1.1.1_3333 and SMPP-1.1.1.2_3333

If files are still being created in SMPP-1.1.1.2_3333, then this suggests TrackSMPPReceipts=ABC_Route is not set for this connection.

To avoid loss of reports, you could copy DB files to NowSMS\SMPPData\ABC_Route, but change the dates. NowSMS will look back 7 days, so you could copy:

From SMPP-1.1.1.1_3333:
20160310.DB
20160309.DB
20160308.DB

From SMPP-1.1.1.2_3333:
20160310.DB => 20160307.DB
20160309.DB => 20160306.DB
20160308.DB => 20160305.DB

In fact, after you do this, rename .SMS files in SMS-IN to .RCT extension, and NowSMS should try again to resolve IDs.

--
Des
NowSMS Support
Nelson Lam
New member
Username: Nelsonlam

Post Number: 35
Registered: 02-2013
Posted on Friday, March 11, 2016 - 11:11 am:   

Hi Des,

The problem is resolved and all pending DLR are delivered successfully.
Thanks for your brilliant advice.

Best Regards
Nelson