Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive message handler is not working #52

Closed
sandeepkdpl opened this issue Jun 15, 2017 · 31 comments
Closed

Receive message handler is not working #52

sandeepkdpl opened this issue Jun 15, 2017 · 31 comments

Comments

@sandeepkdpl
Copy link

sandeepkdpl commented Jun 15, 2017

Hi,

With the latest version sms receive event is not firing and status is changing continuously connected and disconnects. Message send successfully but received message event is not firing. When using Transmitter in place of Transceiver without handler then status connected for all time.
Using below code .

   f := func(p pdu.Body) {
	switch p.Header().ID {
	case pdu.DeliverSMID:
		f := p.Fields()
		src := f[pdufield.SourceAddr]
		dst := f[pdufield.DestinationAddr]
		txt := f[pdufield.ShortMessage]
		log.Printf("Short message from=%q to=%q: %q",
			src, dst, txt)
	}
}

tx := &smpp.Transceiver{
	Addr:   "192.168.0.103:8802",
	User:   "userid",
	Passwd: "password",
	Handler:     f,  // Handle incoming SM or delivery receipts.
}
// Create persistent connection, wait for the first status.
conn := <-tx.Bind()
if conn.Status() != smpp.Connected {
	log.Fatal(conn.Error())
}
sm, err := tx.Submit(&smpp.ShortMessage{
	Src:      "src",
	Dst:      "des",
	Text:     pdutext.Raw("sandeep"),
	Register: pdufield.NoDeliveryReceipt,
})
if err != nil {
	log.Fatal(err)
}
log.Println("Message ID:", sm.RespID())


for{
	
	time.Sleep(time.Millisecond * 1600)
}
@fiorix
Copy link
Owner

fiorix commented Jun 20, 2017

Could be a protocol mismatch? The fact that the status is changing (reconnecting) sounds like one of the peers is disconnecting upon a message on the wire. Can only help if we have logs or packet captures.

@sandeepkdpl
Copy link
Author

Please see the log.

16:40:54:129 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:40:56:133 (00000430) 192.168.0.103 <-: 38 byte packet
16:40:56:133 (00000430) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 01 &
16:40:56:133 (00000430) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:40:56:133 (00000430) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:40:56:133 (00000430) 192.168.0.103 <-: 38 byte packet
16:40:56:133 (00000430) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 01 &
16:40:56:134 (00000430) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:40:56:134 (00000430) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:40:56:134 (00000430) 192.168.0.103 ->: 28 byte packet
16:40:56:134 (00000430) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 01
16:40:56:134 (00000430) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:40:56:137 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received a submit message
16:40:56:137 (00000430) 192.168.0.103 <-: 53 byte packet
16:40:56:137 (00000430) 192.168.0.103 <-: 00 00 00 35 00 00 00 04 00 00 00 00 00 00 00 02 5
16:40:56:137 (00000430) 192.168.0.103 <-: 00 00 00 2B 39 31 39 37 31 31 31 37 34 31 36 31 +919711174161
16:40:56:137 (00000430) 192.168.0.103 <-: 00 00 00 00 00 00 00 00 00 00 00 00 00 07 73 61 sa
16:40:56:137 (00000430) 192.168.0.103 <-: 6E 64 65 65 70 ndeep
16:40:56:141 (00000430) 192.168.0.103 ->: 25 byte packet
16:40:56:141 (00000430) 192.168.0.103 ->: 00 00 00 19 80 00 00 04 00 00 00 00 00 00 00 02
16:40:56:141 (00000430) 192.168.0.103 ->: 35 39 33 45 44 38 33 36 00 593ED836
16:41:06:137 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:41:16:137 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:41:26:138 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:41:36:139 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:41:46:140 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:41:56:142 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:42:06:142 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:42:16:143 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:42:26:144 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:42:36:145 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:42:46:146 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:42:47:146 (00000430) 192.168.0.103 ->: 72 byte packet
16:42:47:146 (00000430) 192.168.0.103 ->: 00 00 00 48 00 00 01 03 00 00 00 00 00 00 00 01 H
16:42:47:146 (00000430) 192.168.0.103 ->: 00 01 01 39 31 39 37 31 31 31 37 34 31 36 31 00 919711174161
16:42:47:146 (00000430) 192.168.0.103 ->: 01 01 39 31 39 35 36 30 35 30 30 31 33 35 00 00 919560500135
16:42:47:146 (00000430) 192.168.0.103 ->: 00 00 04 24 00 12 46 72 6F 6D 20 73 61 6E 64 65 $ From sande
16:42:47:146 (00000430) 192.168.0.103 ->: 65 70 20 4B 75 6D 61 72 ep Kumar
16:42:47:147 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:42:47:147 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:42:47:147 CheckSmppServerAsyncQ: Mark deliver as complete
16:42:49:149 (00000298) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:42:49:149 (00000298) 192.168.0.103 <-: 38 byte packet
16:42:49:149 (00000298) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 0E &
16:42:49:149 (00000298) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:42:49:149 (00000298) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:42:49:149 (00000298) 192.168.0.103 <-: 38 byte packet
16:42:49:149 (00000298) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 0E &
16:42:49:150 (00000298) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:42:49:150 (00000298) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:42:49:150 (00000298) 192.168.0.103 ->: 28 byte packet
16:42:49:150 (00000298) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 0E
16:42:49:150 (00000298) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:42:49:152 (00000298) 192.168.0.103 ->: 72 byte packet
16:42:49:152 (00000298) 192.168.0.103 ->: 00 00 00 48 00 00 01 03 00 00 00 00 00 00 00 01 H
16:42:49:152 (00000298) 192.168.0.103 ->: 00 01 01 39 31 39 37 31 31 31 37 34 31 36 31 00 919711174161
16:42:49:152 (00000298) 192.168.0.103 ->: 01 01 39 31 39 35 36 30 35 30 30 31 33 35 00 00 919560500135
16:42:49:152 (00000298) 192.168.0.103 ->: 00 00 04 24 00 12 46 72 6F 6D 20 73 61 6E 64 65 $ From sande
16:42:49:152 (00000298) 192.168.0.103 ->: 65 70 20 4B 75 6D 61 72 ep Kumar
16:42:49:153 (00000298) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:42:49:153 (00000298) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:42:49:153 CheckSmppServerAsyncQ: Mark deliver as complete
16:42:51:155 (0000039C) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:42:51:155 (0000039C) 192.168.0.103 <-: 38 byte packet
16:42:51:155 (0000039C) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 0F &
16:42:51:155 (0000039C) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:42:51:155 (0000039C) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:42:51:155 (0000039C) 192.168.0.103 <-: 38 byte packet
16:42:51:155 (0000039C) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 0F &
16:42:51:155 (0000039C) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:42:51:156 (0000039C) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:42:51:156 (0000039C) 192.168.0.103 ->: 28 byte packet
16:42:51:156 (0000039C) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 0F
16:42:51:156 (0000039C) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:43:01:158 (0000039C) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:43:11:158 (0000039C) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:43:19:160 (0000039C) 192.168.0.103 ->: 72 byte packet
16:43:19:160 (0000039C) 192.168.0.103 ->: 00 00 00 48 00 00 01 03 00 00 00 00 00 00 00 01 H
16:43:19:160 (0000039C) 192.168.0.103 ->: 00 01 01 39 31 39 37 31 31 31 37 34 31 36 31 00 919711174161
16:43:19:160 (0000039C) 192.168.0.103 ->: 01 01 39 31 39 35 36 30 35 30 30 31 33 35 00 00 919560500135
16:43:19:160 (0000039C) 192.168.0.103 ->: 00 00 04 24 00 12 46 72 6F 6D 20 73 61 6E 64 65 $ From sande
16:43:19:160 (0000039C) 192.168.0.103 ->: 65 70 20 4B 75 6D 61 72 ep Kumar
16:43:19:161 (0000039C) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:43:19:161 (0000039C) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:43:19:161 CheckSmppServerAsyncQ: Mark deliver as complete
16:43:21:162 (000004B8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:43:21:162 (000004B8) 192.168.0.103 <-: 38 byte packet
16:43:21:162 (000004B8) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 12 &
16:43:21:162 (000004B8) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:43:21:162 (000004B8) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:43:21:163 (000004B8) 192.168.0.103 <-: 38 byte packet
16:43:21:163 (000004B8) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 12 &
16:43:21:163 (000004B8) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:43:21:163 (000004B8) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:43:21:163 (000004B8) 192.168.0.103 ->: 28 byte packet
16:43:21:163 (000004B8) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 12
16:43:21:163 (000004B8) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:43:31:164 (000004B8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:43:41:164 (000004B8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:43:51:166 (000004B8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:44:01:168 (000004B8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:44:11:168 (000004B8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:44:19:169 (000004B8) 192.168.0.103 ->: 72 byte packet
16:44:19:169 (000004B8) 192.168.0.103 ->: 00 00 00 48 00 00 01 03 00 00 00 00 00 00 00 01 H
16:44:19:169 (000004B8) 192.168.0.103 ->: 00 01 01 39 31 39 37 31 31 31 37 34 31 36 31 00 919711174161
16:44:19:169 (000004B8) 192.168.0.103 ->: 01 01 39 31 39 35 36 30 35 30 30 31 33 35 00 00 919560500135
16:44:19:169 (000004B8) 192.168.0.103 ->: 00 00 04 24 00 12 46 72 6F 6D 20 73 61 6E 64 65 $ From sande
16:44:19:169 (000004B8) 192.168.0.103 ->: 65 70 20 4B 75 6D 61 72 ep Kumar
16:44:19:170 (000004B8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:44:19:170 (000004B8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:44:19:170 CheckSmppServerAsyncQ: Mark deliver as complete
16:44:21:173 (000004A8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:44:21:173 (000004A8) 192.168.0.103 <-: 38 byte packet
16:44:21:173 (000004A8) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 18 &
16:44:21:173 (000004A8) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:44:21:173 (000004A8) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:44:21:173 (000004A8) 192.168.0.103 <-: 38 byte packet
16:44:21:173 (000004A8) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 18 &
16:44:21:173 (000004A8) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:44:21:173 (000004A8) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:44:21:173 (000004A8) 192.168.0.103 ->: 28 byte packet
16:44:21:173 (000004A8) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 18
16:44:21:173 (000004A8) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:44:30:052 (000004A8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:44:51:597 (000004C8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:44:51:597 (000004C8) 192.168.0.103 <-: 38 byte packet
16:44:51:597 (000004C8) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 02 &
16:44:51:597 (000004C8) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:44:51:597 (000004C8) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:44:51:597 (000004C8) 192.168.0.103 <-: 38 byte packet
16:44:51:597 (000004C8) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 02 &
16:44:51:597 (000004C8) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:44:51:597 (000004C8) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:44:51:598 (000004C8) 192.168.0.103 ->: 28 byte packet
16:44:51:598 (000004C8) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 02
16:44:51:598 (000004C8) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:44:51:599 (000004C8) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:45:52:533 (000004EC) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:45:52:533 (000004EC) 192.168.0.103 <-: 38 byte packet
16:45:52:533 (000004EC) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 01 &
16:45:52:533 (000004EC) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:45:52:533 (000004EC) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:45:52:533 (000004EC) 192.168.0.103 <-: 38 byte packet
16:45:52:533 (000004EC) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 01 &
16:45:52:533 (000004EC) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:45:52:534 (000004EC) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:45:52:534 (000004EC) 192.168.0.103 ->: 28 byte packet
16:45:52:534 (000004EC) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 01
16:45:52:534 (000004EC) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:45:52:536 (000004EC) 192.168.0.103 ->: 72 byte packet
16:45:52:536 (000004EC) 192.168.0.103 ->: 00 00 00 48 00 00 01 03 00 00 00 00 00 00 00 01 H
16:45:52:536 (000004EC) 192.168.0.103 ->: 00 01 01 39 31 39 37 31 31 31 37 34 31 36 31 00 919711174161
16:45:52:536 (000004EC) 192.168.0.103 ->: 01 01 39 31 39 35 36 30 35 30 30 31 33 35 00 00 919560500135
16:45:52:536 (000004EC) 192.168.0.103 ->: 00 00 04 24 00 12 46 72 6F 6D 20 73 61 6E 64 65 $ From sande
16:45:52:536 (000004EC) 192.168.0.103 ->: 65 70 20 4B 75 6D 61 72 ep Kumar
16:45:52:536 (000004EC) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:45:52:537 (000004EC) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:45:52:537 CheckSmppServerAsyncQ: Mark deliver as complete
16:45:54:537 (000004F0) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:45:54:537 (000004F0) 192.168.0.103 <-: 38 byte packet
16:45:54:537 (000004F0) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 02 &
16:45:54:537 (000004F0) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:45:54:538 (000004F0) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:45:54:538 (000004F0) 192.168.0.103 <-: 38 byte packet
16:45:54:538 (000004F0) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 02 &
16:45:54:538 (000004F0) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:45:54:538 (000004F0) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:45:54:538 (000004F0) 192.168.0.103 ->: 28 byte packet
16:45:54:538 (000004F0) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 02
16:45:54:538 (000004F0) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:46:04:539 (000004F0) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:46:14:539 (000004F0) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:46:20:543 (000004F0) 192.168.0.103 ->: 78 byte packet
16:46:20:543 (000004F0) 192.168.0.103 ->: 00 00 00 4E 00 00 01 03 00 00 00 00 00 00 00 01 N
16:46:20:543 (000004F0) 192.168.0.103 ->: 00 01 01 39 31 39 37 31 31 31 37 34 31 36 31 00 919711174161
16:46:20:543 (000004F0) 192.168.0.103 ->: 01 01 39 31 39 35 36 30 35 30 30 31 33 35 00 00 919560500135
16:46:20:543 (000004F0) 192.168.0.103 ->: 00 00 04 24 00 18 46 72 6F 6D 20 73 61 6E 64 65 $ From sande
16:46:20:543 (000004F0) 192.168.0.103 ->: 65 70 20 4B 75 6D 61 72 20 68 65 6C 6C 6F ep Kumar hello
16:46:20:544 (000004F0) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:46:20:544 (000004F0) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:46:20:544 CheckSmppServerAsyncQ: Mark deliver as complete
16:46:22:545 (0000039C) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:46:22:545 (0000039C) 192.168.0.103 <-: 38 byte packet
16:46:22:545 (0000039C) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 05 &
16:46:22:545 (0000039C) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:46:22:545 (0000039C) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:46:22:545 (0000039C) 192.168.0.103 <-: 38 byte packet
16:46:22:545 (0000039C) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 05 &
16:46:22:545 (0000039C) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:46:22:545 (0000039C) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:46:22:545 (0000039C) 192.168.0.103 ->: 28 byte packet
16:46:22:545 (0000039C) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 05
16:46:22:545 (0000039C) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:46:22:551 (0000039C) 192.168.0.103 ->: 78 byte packet
16:46:22:551 (0000039C) 192.168.0.103 ->: 00 00 00 4E 00 00 01 03 00 00 00 00 00 00 00 02 N
16:46:22:551 (0000039C) 192.168.0.103 ->: 00 01 01 39 31 39 37 31 31 31 37 34 31 36 31 00 919711174161
16:46:22:551 (0000039C) 192.168.0.103 ->: 01 01 39 31 39 35 36 30 35 30 30 31 33 35 00 00 919560500135
16:46:22:551 (0000039C) 192.168.0.103 ->: 00 00 04 24 00 18 46 72 6F 6D 20 73 61 6E 64 65 $ From sande
16:46:22:551 (0000039C) 192.168.0.103 ->: 65 70 20 4B 75 6D 61 72 20 68 65 6C 6C 6F ep Kumar hello
16:46:22:552 (0000039C) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:46:22:552 (0000039C) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:46:22:552 CheckSmppServerAsyncQ: Mark deliver as complete
16:46:24:553 (00000498) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:46:24:553 (00000498) 192.168.0.103 <-: 38 byte packet
16:46:24:553 (00000498) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 06 &
16:46:24:553 (00000498) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:46:24:553 (00000498) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:46:24:554 (00000498) 192.168.0.103 <-: 38 byte packet
16:46:24:554 (00000498) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 06 &
16:46:24:554 (00000498) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:46:24:554 (00000498) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:46:24:554 (00000498) 192.168.0.103 ->: 28 byte packet
16:46:24:554 (00000498) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 06
16:46:24:554 (00000498) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:46:34:555 (00000498) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:46:44:556 (00000498) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:46:52:567 (00000498) 192.168.0.103 ->: 78 byte packet
16:46:52:567 (00000498) 192.168.0.103 ->: 00 00 00 4E 00 00 01 03 00 00 00 00 00 00 00 01 N
16:46:52:567 (00000498) 192.168.0.103 ->: 00 01 01 39 31 39 37 31 31 31 37 34 31 36 31 00 919711174161
16:46:52:567 (00000498) 192.168.0.103 ->: 01 01 39 31 39 35 36 30 35 30 30 31 33 35 00 00 919560500135
16:46:52:567 (00000498) 192.168.0.103 ->: 00 00 04 24 00 18 46 72 6F 6D 20 73 61 6E 64 65 $ From sande
16:46:52:567 (00000498) 192.168.0.103 ->: 65 70 20 4B 75 6D 61 72 20 68 65 6C 6C 6F ep Kumar hello
16:46:52:567 (00000498) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:46:52:567 (00000498) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data
16:46:52:568 CheckSmppServerAsyncQ: Mark deliver as complete
16:46:54:569 (00000500) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request
16:46:54:569 (00000500) 192.168.0.103 <-: 38 byte packet
16:46:54:570 (00000500) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 09 &
16:46:54:570 (00000500) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:46:54:570 (00000500) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:46:54:570 (00000500) 192.168.0.103 <-: 38 byte packet
16:46:54:570 (00000500) 192.168.0.103 <-: 00 00 00 26 00 00 00 09 00 00 00 00 00 00 00 09 &
16:46:54:570 (00000500) 192.168.0.103 <-: 73 61 6E 64 65 65 70 00 6B 64 70 6C 40 31 32 33 sandeep kdpl@123
16:46:54:570 (00000500) 192.168.0.103 <-: 00 00 34 00 00 00 4
16:46:54:570 (00000500) 192.168.0.103 ->: 28 byte packet
16:46:54:570 (00000500) 192.168.0.103 ->: 00 00 00 1C 80 00 00 09 00 00 00 00 00 00 00 09
16:46:54:570 (00000500) 192.168.0.103 ->: 4E 6F 77 53 4D 53 00 02 10 00 01 34 NowSMS 4
16:47:04:571 (00000500) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:47:14:572 (00000500) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:47:24:572 (00000500) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging
16:47:34:572 (00000500) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received enquire_link, acknowledging

@fiorix
Copy link
Owner

fiorix commented Jul 6, 2017

Seems like something that happens right before this:

16:42:47:147 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: ioctlsocket failed, no data

is what's causing the disconnect. Can't tell which end of the connection is problematic.

@sandeepkdpl
Copy link
Author

Please send me any smsc server link by which we can test your sample in real time.

@dfilipovic39
Copy link

I can confirm this issue. there were no changes on both server and client side except for go-smpp library upgrade and the handler doesn't trigger anymore.

@fiorix
Copy link
Owner

fiorix commented Jul 22, 2017

Can one of you help bisect this to the problematic diff? Maybe @nezorflame and/or @wOvAN know about this too.

@fiorix
Copy link
Owner

fiorix commented Jul 22, 2017

@sandeepkdpl for testing I normally use http://www.seleniumsoftware.com/downloads.html but I haven't done this in a while.

@nezorflame
Copy link
Contributor

I'll test too and try to see what's wrong.

@nezorflame
Copy link
Contributor

Can't reproduce the problem with Jasmin SMPPSim (which is based on Selenium I guess):

image

@nezorflame
Copy link
Contributor

Also if you select for the ConnStatus like below, no errors are caught:

for {
		select {
		case c := <-tx.Bind():
			if c == nil {
				return
			}

			switch c.Status() {
			case smpp.Connected:
				log.Print("Gate bound")
			case smpp.ConnectionFailed:
				log.Printf("Unable to connect: %s", c.Error())
			case smpp.BindFailed:
				log.Printf("Unable to bind: %s", c.Error())
			case smpp.Disconnected:
				log.Printf("Gate disconnected: %s", c.Error())
			}
		}
	}

Only 'Gate bound' followed by SMPPSim received messages.

What OSes do you use, Go version?

@sandeepkdpl
Copy link
Author

Go Version is
go version go1.7.5 windows/amd64

@dfilipovic39
Copy link

dfilipovic39 commented Jul 24, 2017 via email

@sandeepkdpl
Copy link
Author

sandeepkdpl commented Jul 24, 2017

See error after using your code @nezorflame. I have upgraded go version also to latest version.

abc

@nezorflame
Copy link
Contributor

nezorflame commented Jul 24, 2017

OK, that is strange.
I'll try to reproduce this on my Windows and Linux machines later.
Unable to reproduce this on macOS.

@sandeepkdpl
Copy link
Author

OK, We are waiting for your response...

@nezorflame
Copy link
Contributor

@sandeepkdpl @fiorix "PDU not implemented" is fired in codec.go in Decode func.
It assumes that we can't handle this type of PDU right now, Read fails because of Decode and connection drops.

This is true for:

  • AlertNotificationID
  • CancelSMID
  • CancelSMRespID
  • DataSMID
  • DataSMRespID
  • OutbindID
  • ReplaceSMID
  • ReplaceSMRespID

I wonder what is the header for 0x44617461534d though...

@nezorflame
Copy link
Contributor

I see that you're using NowSMS, I'll try to get an account and try with it.

@sandeepkdpl
Copy link
Author

Yes, We are using NowSMS trial version, you can also get trial version for testing purpose.

@nezorflame
Copy link
Contributor

I've set up Windows in VBox, installed Go 1.7.
Installed NowSMS trial, set it up like this:
image
The connection seems stable, no drops, and your code runs absolutely fine:
image
Maybe you've set up some specific settings in NowSMS which are interfering?

@sandeepkdpl
Copy link
Author

Yes everything run fines till the sms receive event. Please cross check sms receive event.
We are configuring smsc server using usb. We have connected a device with usb. Device contains a sim card by which we are sending sms and receiving sms.

@nezorflame
Copy link
Contributor

@fiorix were you able to reproduce this?

@sandeepkdpl
Copy link
Author

Yes I am receiving this error every time... Still not received a single receive event. I can send sms from this but unable to get receive sms event.

@nezorflame
Copy link
Contributor

No problem with receiving messages either:
image

@nezorflame
Copy link
Contributor

I've played a bit with NowSMS server and still unable to reproduce the issue.
@tarqe39 please tell me, how did you reproduce it on your machine?

@fiorix
Copy link
Owner

fiorix commented Jul 25, 2017

@nezorflame I haven't tried yet

@sandeepkdpl
Copy link
Author

@nezorflame are you using the same code which I have mentioned or you have done something else because at my side its not firing receive sms event. I have tried may things which I can do but their is no success.

You can debug my case if you want we are ready for run any sample package by which you can create logs if you want....

@nezorflame
Copy link
Contributor

Yes, I am using exactly the same code as you.

package main

import (
	"log"
	"time"

	"github.com/fiorix/go-smpp/smpp"
	"github.com/fiorix/go-smpp/smpp/pdu"
	"github.com/fiorix/go-smpp/smpp/pdu/pdufield"
	"github.com/fiorix/go-smpp/smpp/pdu/pdutext"
)

func main() {
	f := func(p pdu.Body) {
		switch p.Header().ID {
		case pdu.DeliverSMID:
			f := p.Fields()
			src := f[pdufield.SourceAddr]
			dst := f[pdufield.DestinationAddr]
			txt := f[pdufield.ShortMessage]
			log.Printf("Short message from=%q to=%q: %q",
				src, dst, txt)
		}
	}

	tx := &smpp.Transceiver{
		Addr:    "localhost:4444",
		User:    "default",
		Passwd:  "password",
		Handler: f, // Handle incoming SM or delivery receipts.
	}
	// Create persistent connection, wait for the first status.
	conn := <-tx.Bind()
	if conn.Status() != smpp.Connected {
		log.Fatal(conn.Error())
	}
	sm, err := tx.Submit(&smpp.ShortMessage{
		Src:      "src",
		Dst:      "des",
		Text:     pdutext.Raw("sandeep"),
		Register: pdufield.NoDeliveryReceipt,
	})
	if err != nil {
		log.Fatal(err)
	}
	log.Println("Message ID:", sm.RespID())
	for {
		time.Sleep(time.Millisecond * 1600)
	}
}

@nezorflame
Copy link
Contributor

nezorflame commented Jul 26, 2017

@sandeepkdpl OK, you have 2 things to consider.

  1. You should really learn how to debug Go applications (https://github.com/derekparker/delve) so next time you can set breakpoints and see for yourself where's the problem.
  2. I have my fork of this lib. I've inserted Println's into the Decode func, so when the problem occurs, the program will write the name of the problematic PDU in charge.
    Checkout the test branch from my repo https://github.com/nezorflame/go-smpp/tree/test, place it in "GOPATH/src/github.com/nezorflame/go-smpp" and replace original imports in the code with mine.
    Post the result window here after you're launched the app.

@sandeepkdpl
Copy link
Author

See this
abc

@sandeepkdpl
Copy link
Author

sandeepkdpl commented Jul 27, 2017

There is a problem in our nowsms server setting which has been modified today. Data_SM PDU is checked. After uncheck that setting for user. We are able to receive message event.
Thanks for all your corporation. @nezorflame and @fiorix 👍

@fiorix
Copy link
Owner

fiorix commented Jul 27, 2017

Alright. Thanks @nezorflame for jumping in.

@fiorix fiorix closed this as completed Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants