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

how to receive submitSMResponse while smpp binding with message listener #81

Open
Qhodok opened this issue Jan 10, 2019 · 2 comments
Open

Comments

@Qhodok
Copy link

Qhodok commented Jan 10, 2019

i bind smpp with handler, everytime i send submitSM, submitSMRespose always receive on handler that i register before not in return value of submitSM. how to get submitSMResponse from return value of submitSM even listen a message handler?

@Qhodok
Copy link
Author

Qhodok commented Jan 10, 2019

tx := &smpp.Transceiver{
Addr: "addr,
User: "user",
Passwd: "password",
Handler: func(p pdu.Body) {
switch p.Header().ID {
case pdu.DeliverSMID:
//incoming message or delivery report
case pdu.SubmitSMRespID:
//always receive on this line ,
}
conn := tx.Bind()

sm, err := tx.Submit(&smpp.ShortMessage{
Src: r.FormValue("source"),
Dst: r.FormValue("msisdn"),
Text: pdutext.Raw(r.FormValue("")),
Register: pdufield.NoDeliveryReceipt,
TLVFields: pdutlv.Fields{
pdutlv.TagReceiptedMessageID: pdutlv.CString("hutch"),
pdutlv.TagMessagePayload: pdutlv.CString(r.FormValue("msg")),
},
})

sm is always nil, how to get sm.RespID on this line?

@alexanderomnix
Copy link

you need to call sm.RespID() to get it.

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

2 participants