-
Notifications
You must be signed in to change notification settings - Fork 104
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
Reworked PDU parsing; Delivery reports #77
Conversation
..ah, and sorry for that large commit. I usually have that strange workflow that I code everything that is in my mind and afterwards I remove the compiler issues and do only fixup commits ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..ah, and sorry for that large commit. I usually have that strange workflow that I code everything that is in my mind and afterwards I remove the compiler issues and do only fixup commits ;)
I don't think it's that strange. But it is a pain to review ;)
I don't think I got everything, I probably skimmed over most. There are some style issues, and a few things with buffers of unknown size.
(And as always: I don't own a dongle, so I tested none of it.)
6bc5f87
to
96c7543
Compare
I think I've fixed all your comments. Let's wait for the feedback from #78. |
f154bbe
to
871b788
Compare
d750544
to
99e7dbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use "static const" before:
channel_var_t vars[] =
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep parse_cmgr_text() even if it is deprecated?
Thanks for your comments. I dropped it, as I was too lazy to fully implement it (the initial version didn't parse the SCTS field). Theoretically there is no reason to use the text mode as SMs are always transmitted as PDUs. The text mode is only for users that use the modem directly via the TTY port. Does your modem work correctly (does the PDU mode work)? It would be great if you can tell me which model you use and if voice, USSD and Multi-SMS (sending and receiving) works. |
I can do that. But static won't work as the content is basically not static, right? |
Isn't vars[] just an array of constants? |
Nope, at least the payload for delivery reports is always included and not constant. |
You're right. Now I see. |
I just come to say , Good job @magcks & @wdoekes I have test the PR , there is issue let me explain it .. if you send concatenated message its will be store as 1 message , but if you send another short message after the concatenated message its will contain text from previous message "concatenated message" . my dongle.conf is ` [general] ` |
Thanks for your comment @m7mdcc . Can you please tell me the content of the PDU? You can log the content using in at_parse.c#322 Does the second SM contain the complete content from the first SM or only parts? Thanks! :) |
@magcks , do you want to add this line in 322 in file at_parse.c before compiling ? ` the second message contain only one part of first message . |
Yes, please. It will print the PDU content as a warning to the asterisk console before parsing it. |
Ok here is the log , first i receive concatenated message then i receive short message which only contain "Test" , if you see the log its say : [2020-05-04 21:58:24] VERBOSE[2164] at_response.c: [dongle0] Got SMS part from +XXXXXXXXXXXX: 'Test'; Concatenated [ref,parts,order]: 0 1 2
|
Okay, thanks. Looks like an uninitialized value. I will have a look. |
…oding and UCS-2 decoding; Implemented delivery reports; Fixed USSD generating
Could you please check now. The code at least compiles now, but I currently don't have time to test and I don't know where I put my sticks :D |
@magcks , Thanks .. I can confirm issue is solved now . |
Can you get these conflicts resolved? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Maybe you could squash that last change commit. Minor nit though. |
Hey there again :)
In this PR, I reworked the whole PDU parsing and building code. This includes:
To handle the status reports correctly, this PR creates a database row for each message part of a concatenated SM (i.e. for each single SM) including the message reference returned from the modem. Once, a status report is received, a flag is updated in the database. When all reports are received, a "report" will be issued to the dial plan. This PR also gives you the opportunity to pass a payload to each message to identify it when the delivery report is completed (useful for a Mail-to-SMS gateway).
I also included commit 3a85d35 @miopa to support sending to national numbers (e.g. 0049... instead of +49...) and 'fixed' the USSD sending functions.
Major things that changed:
I hope there are some people that can test this PR, as it changes almost the whole SMS and USSD part of the project. I only tested with an E1762 and didn't used my code in 'production' yet.
@wdoekes: Thanks for reviewing #75 :)