-
Notifications
You must be signed in to change notification settings - Fork 135
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
Comments
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. |
Please see the log. 16:40:54:129 (00000430) 192.168.0.103 --: WaitForResponseSMPP: SMPP Debug: received bind request |
Seems like something that happens right before this:
is what's causing the disconnect. Can't tell which end of the connection is problematic. |
Please send me any smsc server link by which we can test your sample in real time. |
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. |
Can one of you help bisect this to the problematic diff? Maybe @nezorflame and/or @wOvAN know about this too. |
@sandeepkdpl for testing I normally use http://www.seleniumsoftware.com/downloads.html but I haven't done this in a while. |
I'll test too and try to see what's wrong. |
Also if you select for the ConnStatus like below, no errors are caught:
Only 'Gate bound' followed by SMPPSim received messages. What OSes do you use, Go version? |
Go Version is |
Mine is go1.8rc3 linux/amd64. Ill try to upgrade to 1.8.3-1 and check if
thats the problem. But i doubt it
EDIT:
Ok, seems i was wrong :) the DeliverSM fires now.
Maybe if someone else would confirm this? It would be good to add go version requirement to README in that case.
…On Mon, 24 Jul 2017 at 07:21 sandeepkdpl ***@***.***> wrote:
Go Version is
go version go1.7.5 windows/amd64
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#52 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFNhCGjVq0ZjEduw77xlZbarjyk7moi8ks5sRCnagaJpZM4N7Bug>
.
|
See error after using your code @nezorflame. I have upgraded go version also to latest version. |
OK, that is strange. |
OK, We are waiting for your response... |
@sandeepkdpl @fiorix "PDU not implemented" is fired in codec.go in Decode func. This is true for:
I wonder what is the header for 0x44617461534d though... |
I see that you're using NowSMS, I'll try to get an account and try with it. |
Yes, We are using NowSMS trial version, you can also get trial version for testing purpose. |
Yes everything run fines till the sms receive event. Please cross check sms receive event. |
@fiorix were you able to reproduce this? |
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. |
I've played a bit with NowSMS server and still unable to reproduce the issue. |
@nezorflame I haven't tried yet |
@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.... |
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)
}
} |
@sandeepkdpl OK, you have 2 things to consider.
|
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. |
Alright. Thanks @nezorflame for jumping in. |
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 .
The text was updated successfully, but these errors were encountered: