RestComm / smscgateway

RestComm SMS Gateway (SMSC) to send/receive SMS from/to Operators Network (GSM)
http://www.restcomm.com/
GNU Affero General Public License v3.0
127 stars 111 forks source link

Missing of error events in SMPP RA #112

Closed vetss closed 8 years ago

vetss commented 8 years ago

We have reports that in some cases (I have seen it in a connection reestablishing case) and we have sent a message into SMPP destination (via RxSmpp) then there is no delivery / error / timeout events to SBB and SBB continue of treating of state as "still delivering". We need to investigate a reason and fix.

vetss commented 8 years ago

Log that gives us a described case

2016-09-06 14:49:58,163 INFO com.cloudhopper.smpp.impl.DefaultSmppSession sync send PDU: (enquire_link: 0x00000010 0x00000015 0x00000000 0x000002 05) (body: ) (opts: ) 2016-09-06 14:49:58,164 INFO com.cloudhopper.smpp.impl.DefaultSmppSession write bytes: [00000010000000150000000000000205] 2016-09-06 14:49:58,176 INFO com.cloudhopper.smpp.impl.DefaultSmppSession read bytes: [00000010800000150000000000000205] 2016-09-06 14:49:58,176 INFO com.cloudhopper.smpp.impl.DefaultSmppSession received PDU: (enquire_link_resp: 0x00000010 0x80000015 0x00000000 0x00000 205 result: "OK") (body: ) (opts: ) 2016-09-06 14:50:00,629 ERROR javax.slee.RAEntityNotification[entity=SmppServerRA].SmppSessionHandlerInterfaceImpl Received fireUnknownThrowable java.io.IOException: Connection reset by peer at sun.nio.ch.FileDispatcherImpl.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) at sun.nio.ch.IOUtil.read(IOUtil.java:192) at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 2016-09-06 14:50:00,629 INFO com.cloudhopper.smpp.impl.DefaultSmppSession Successfully closed 2016-09-06 14:50:00,629 INFO com.cloudhopper.smpp.impl.DefaultSmppSession read bytes: [00000010800000060000000000000000] 2016-09-06 14:50:00,630 INFO com.cloudhopper.smpp.impl.DefaultSmppSession received PDU: (unbind_resp: 0x00000010 0x80000006 0x00000000 0x00000000 result: "OK") (body: ) (opts: )

vetss commented 8 years ago

Other possible log (for this concrete case I am not 100% sure):

2016-08-09 10:11:21,630 ERROR javax.slee.SbbNotification[service=ServiceID[name=SmscRxSmppServerService,vendor=org.mobicents,version=1.0],sbb=SbbID[name=RxSmpp ServerSbb,vendor=org.mobicents,version=1.0]].RxSmppServerSbbImpl onPduRequestTimeout : PduRequestTimeout=PduRequestTimeout [pduRequest=(deliver_sm: 0x000000B0 0x00000005 0x00000000 0x0004F020) (body: (serviceType [] sourceAdd r [0x01 0x01 [995577105620]] destAddr [0x01 0x01 [16464553443]] esmCls [0x04] regDlvry [0x00] dcs [0x00] message [69643A3130383630353132207375623A30303120646C76 72643A303031207375626D697420646174653A3136303830393130313020646F6E6520646174653A3136303830393130313020737461743A44454C49565244206572723A30303020746578743A596F75 7220507269766174657320636F6E666972])) (opts: ), systemId=SMART_SS7_conn_1] 2016-08-09 10:11:32,635 ERROR javax.slee.RAEntityNotification[entity=SmppServerRA].SmppSessionHandlerInterfaceImpl Received fireUnknownThro wable java.io.IOException: Connection timed out at sun.nio.ch.FileDispatcherImpl.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) at sun.nio.ch.IOUtil.read(IOUtil.java:192) at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:384) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 2016-08-09 10:11:35,174 ERROR javax.slee.RAEntityNotification[entity=SmppServerRA].SmppSessionHandlerInterfaceImpl Received fireUnknownThro wable java.io.IOException: Connection timed out at sun.nio.ch.FileDispatcherImpl.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) at sun.nio.ch.IOUtil.read(IOUtil.java:192) at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:384) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 2016-08-09 10:11:36,631 WARN javax.slee.RAEntityNotification[entity=SmppServerRA].SmppSessionHandlerInterfaceImpl PduRequestExpired =(deliver_sm: 0x000000A8 0x00000005 0x00000000 0x0001233E) (body: (serviceType [] sourceAddr [0x01 0x01 [93716674131]] destAddr [0x05 0x00 [BIGO]] esmCls [0x04] regDlvry [0x00] dcs [0x00] message [69643A3130383630353034207375623A30303120646C7672643A303031207375626D697420646174653A3136303830393130313020646F6E65206461746 53A3136303830393130313020737461743A554E44454C4956206572723A30303120746578743A39353532323120697320796F7572204249474F20])) (opts: )

vetss commented 8 years ago

Fixing by: https://github.com/RestComm/smscgateway/commit/c839f2f6b886fedcd7bd090d9cc71d7f2fa3a736 https://github.com/RestComm/smscgateway/commit/b3842e59f5af9674d24c2c9cc207dd7fcfc3ad4b https://github.com/RestComm/smscgateway/commit/6d162897023ef6be83f505609c8949858c8715f0 https://github.com/RestComm/smscgateway/commit/dd6a387d7a3c57286c6f7d7ae253e1b8ad00937e https://github.com/RestComm/smscgateway/commit/6d162897023ef6be83f505609c8949858c8715f0 https://github.com/RestComm/smscgateway/commit/dd6a387d7a3c57286c6f7d7ae253e1b8ad00937e

We need to test the case at logs from different users how it goes now.

Also there is anothe r fixed issue that also help this case (minimizing of problems) : https://github.com/RestComm/smscgateway/issues/111