-
Notifications
You must be signed in to change notification settings - Fork 138
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 make valid NewDeliverSM? Any example? #73
Comments
You'll likely need to take captures and compare with a working client. I cannot help much on this one. |
I think that I have found error, I generate DeliverSM with following code:
In Wireshark capture I see that output is almost identical with proper DeliverSM sent by working SMSC The problem is that pdufield.ShortMessage, pdutext.Raw("") generated by your package has proper length field, but ShortMessage is prefixed by zero byte (0x00), that corrupts further data. Output is:
that's the byte with offset 0030, just before id:12345... Without this zero byte it seems that will be OK and client will accept it Can you please advise how to patch your code to get rid of this zero byte? I'm not proficient binary protocol hacker I can even pay you some sum for your time since I'm doing commercially a part of middleware and need to get it working ASAP |
Here is how Wireshark see this part of message, please observe that message length byte is OK. Message is just prefixed with zero byte, so the last byte is cut (thats digit 2 from "err:002" part of message) Here you go with screenshot: |
As said I'm ready to pay for your time, maybe this one will help: |
Here's the layout of DeliverSM: https://github.com/fiorix/go-smpp/blob/master/smpp/pdu/types.go#L293 The immediate field before ShortMessage is GSMUserData, which was added about a year ago by @nezorflame in 24f8c59. Try commenting it out and re-run your test? |
@fiorix |
I've encountered the same problem: |
To be honest, I don't remember the specifics on why have we added it this
way since it was a while ago, but if you were to refactor and fix it, I'd
gladly review this.
…_____________________________
Best regards,
Ilya Danilkin
С уважением,
Илья Данилкин
сб, 11 янв. 2020 г., 16:08 Robert Mircea <[email protected]>:
I've encountered the same problem: pdu.NewDeliverSM() does not produce a
valid smpp pdu and the message is unparsable by other smpp clients which
are known to be working with real SMSC. The culprits are
pdufield.UDHLength and pdufield.GSMUserData which should not belong to
pdufield.List. These fields are not part of DeliverSM pdu according to
spec. If I eliminate them then everything works as expected.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#73?email_source=notifications&email_token=AA5ZZTTYYMV3HVXLINXDWUDQ5HADJA5CNFSM4FGVNOZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIWBTHY#issuecomment-573315487>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5ZZTXMWNWTVQXFVENKON3Q5HADJANCNFSM4FGVNOZQ>
.
|
Thanks robert. It worked after commenting both UDHLength and GSMUserData . May I know,why still the fix are not merged into main branch ? |
@Munmendu , This also worked with us The length of the message calculated without the null termination character the correction must be length + 1 |
I'm trying to send DLR using NewDeliverSM, but with no success. Message is sent, but not recognized as DLR
I tried with:
p := pdu.NewDeliverSM()
p.TLVFields().Set(pdutlv.TagReceiptedMessageID, pdutlv.CString("1234"))
p.TLVFields().Set(pdutlv.TagMessageStateOption, 2)
f := p.Fields()
f.Set(pdufield.SourceAddr, m.Fields()[pdufield.SourceAddr])
f.Set(pdufield.DestinationAddr, m.Fields()[pdufield.DestinationAddr])
f.Set(pdufield.ESMClass, 4)
f.Set(pdufield.ServiceType, m.Fields()[pdufield.ServiceType])
f.Set(pdufield.ProtocolID, 0)
p.Header().Status = 0
p.Header().Seq = m.Header().Seq + 1
f.Set(pdufield.ShortMessage, pdutext.Latin1("id:1234 sub:001 dlvrd:001 submit date:180625012100 done date:180625012101 stat:DELIVRD err:000 text:"))
where f are fields from original SubmitSM, "1234" message @#id
What I'm doing wrong here? Do I need to encode values like pdufield.ESMClass = 4 to other formats?
Any working example will be appreciated
The text was updated successfully, but these errors were encountered: