Skip to content

app_sms.c: Fix sending and receiving SMS messages in protocol 2 #1188

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Itzanh
Copy link

@Itzanh Itzanh commented Apr 6, 2025

This fixes bugs in SMS messaging to SMS-capable analog phones that prevented app_sms.c from talking to phones using SMS protocol 2.

  • Fix MORX message reception (from phone to Asterisk) in SMS protocol 2
  • Fix MTTX message transmission (from Asterisk to phone) in SMS protocol 2

One of the bugs caused messages to have random characters and junk appended at the end up to the character limit. Another bug prevented Asterisk from sending messages from Asterisk to the phone at all. A final bug caused the transmission from Asterisk to the phone to take a long time because app_sms.c did not hang up after correctly sending the message, causing the phone to have to time out and hang up in order to complete the message transmission.

This was tested with a Linksys PAP2T and with a GrandStream HT814, sending and receiving messages with Telefónica DOMO Mensajes phones from Telefónica Spain. I had to play with both the network jitter buffer and the dB gain to get it to work. One of my phones required the gain to be set to +3dB for it to work, while another required it to be set to +6dB.

Only MORX and MTTX were tested, I did not test sending and receiving messages to a TelCo SMSC.

Copy link

sangoma-oss-cla bot commented Apr 6, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Apr 6, 2025

Workflow PRCheck completed successfully

@Itzanh
Copy link
Author

Itzanh commented Apr 6, 2025

There's a comment saying that I didn't sign the CLA. I signed the CLA a few minutes ago, I'm not sure if this is a refresh error.

@Itzanh
Copy link
Author

Itzanh commented Apr 9, 2025

Is there something else that I ought to do? If so, please let me know. Thanks!

@seanbright
Copy link
Contributor

The automated message you are referring to only updates when changes are pushed to the PR. There is nothing for you to do until this is reviewed.

@asterisk asterisk deleted a comment from Itzanh Apr 11, 2025
apps/app_sms.c Outdated
Comment on lines 111 to 113
<para>It is also important to adjust the gain dB of the ATA. In one of my Telefónica DOMO Mensajes phones,
I had to set the dB level to +3dB, and in another phone of the same model, I had to set the gain to +6dB
to get it to work.</para></note>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, rewrite this bit to avoid first-person phrasing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I was not aware that I had to do that. Would the following sentence be acceptable?

It is also important to adjust the gain dB of the ATA. Some Telefónica DOMO Mensajes phones may require the gain to be set to +3dB,
and others even up to +6dB, in order to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’d be fine

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I made a commit to fix this. This is my first time at contributing, so I'm a little lost. If there's anything else I should do, please let me know. Thanks!

Copy link

Workflow PRCheck completed successfully

@Itzanh
Copy link
Author

Itzanh commented Apr 20, 2025

I've done the changes as needed. I was wondering if there was anything else for me to do... if so, please let me know. Thanks!

@seanbright
Copy link
Contributor

There is nothing for you to do until this is reviewed.

Copy link
Member

@jcolp jcolp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclaimer: I have no ability to test this.

Copy link
Member

@gtjoseph gtjoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few housekeeping things...

  • Move the "UserNote" in both the commit message and the PR description to the end. Otherwise the whole commit message will become the user note. Strictly speaking, you don't actually need the UserNote for this commit so you could just remove it altogether if you want.
  • Squash the two commits into one using git rebase -i HEAD~2 and changing the command for the Fix the first use... commit to fixup. Then do a git push --force.

@gtjoseph
Copy link
Member

Oh, you should also cherry-pick this PR to the 20, 21 and 22 branches.

Copy link

github-actions bot commented May 1, 2025

Workflow PRCheck failed
master-pjs1: FAILED TEST: channels/pjsip/oli/uri_parameter

Copy link

github-actions bot commented May 1, 2025

Workflow PRCheck completed successfully

@Itzanh
Copy link
Author

Itzanh commented May 1, 2025

cherry-pick-to: 20
cherry-pick-to: 21
cherry-pick-to: 22

@gtjoseph
Copy link
Member

gtjoseph commented May 1, 2025

@Itzanh Still a few things you need to take care of...

  • The PR description still has "UserNote:" at the top. Since you removed it from the commit message, you need to remove it in the description as well.
  • You now have 2 cherry-pick comments in the PR. Either delete the comment you just added and replace the earlier comment with the 3 lines or just delete the earlier comment. You can edit your comments y clicking on the "3-dots" at the right of the comment.
  • You now have a merge commit which needs to be removed.

Copy link

github-actions bot commented May 1, 2025

Workflow PRCheck failed
master-pjs1: FAILED TEST: channels/pjsip/oli/uri_parameter

@seanbright
Copy link
Contributor

@Itzanh this needs to be rebased on top of the latest master branch (which involves resolving a conflict).

This fixes bugs in SMS messaging to SMS-capable analog phones that prevented app_sms.c from talking to phones using SMS protocol 2.

- Fix MORX message reception (from phone to Asterisk) in SMS protocol 2
- Fix MTTX message transmission (from Asterisk to phone) in SMS protocol 2

One of the bugs caused messages to have random characters and junk appended at the end up to the character limit. Another bug prevented Asterisk from sending messages from Asterisk to the phone at all. A final bug caused the transmission from Asterisk to the phone to take a long time because app_sms.c did not hang up after correctly sending the message, causing the phone to have to time out and hang up in order to complete the message transmission.

This was tested with a Linksys PAP2T and with a GrandStream HT814, sending and receiving messages with Telefónica DOMO Mensajes phones from Telefónica Spain. I had to play with both the network jitter buffer and the dB gain to get it to work. One of my phones required the gain to be set to +3dB for it to work, while another required it to be set to +6dB.

Only MORX and MTTX were tested, I did not test sending and receiving messages to a TelCo SMSC.
Copy link

github-actions bot commented May 1, 2025

Workflow PRCheck completed successfully

@Itzanh
Copy link
Author

Itzanh commented May 11, 2025

Hi, are there any updates on this? Is there anything else I ought to do?

@jcolp
Copy link
Member

jcolp commented May 11, 2025

There are no updates or requests that I see. If something is needed then something will comment. As it is this is pending review and approval by someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants