-
Notifications
You must be signed in to change notification settings - Fork 6
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
Linphone fixes #13
base: master
Are you sure you want to change the base?
Linphone fixes #13
Conversation
When testing this lib with linphone, it was discovered that linphone uses CRLF Keep-Alive as described in: https://www.rfc-editor.org/rfc/rfc5626#section-3.5.1 This adds detection of them and debug-logs the detection to ignore it. Otherwise this caused some false-positive errors in the logs, creating confusion.
There where two sets of CRLF between the headers and the body, which causes issues when linphone parses the sip message. This uses some minimal trickery to ensure that there's only one set of CRLF between the headers and the body in sip answers.
linphone tries to send STUN Binding Requests, which causes a fatal exception. Just ignore these and linphone works with voip-utils.
With these 3 fixes, I have gotten as far as I hear the "There's a problem with the current voice assistant settings"... which is a completely different issue on my side. I think this gets us far enough to make the linphone softphone usable. |
Any news on this one? |
@glance- glad to see you put effort into making linphone work with voip-utils. What would be the easiest way for me to test these changes on my HA setup? |
Depends quite heavily on what your HA setup is, but generally, just applying the changes to the relevant files in your virtual-env or container, is the quickest and dirtiest approach. Cloning the repo, checking out the pr and installing it in your venv or extending the base container "upgraded" with this package is another one. |
Thank you for the hints! I am running HA OS and have successfully installed your patched version with: docker exec -it homeassistant bash
pip install git+https://github.com/glance-/voip-utils.git@linphone-fixes However I still get the same error when trying to make a call from linphone: Unexpected error handling SIP INVITE
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/voip_utils/sip.py", line 63, in datagram_received
method, ruri, headers, body = self._parse_sip(message)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voip_utils/sip.py", line 224, in _parse_sip
method = line_parts[0]
~~~~~~~~~~^^^
IndexError: list index out of range |
Aha! I needed to disable media encryption in linphone. And now it works! But it works with both, latest code from All in all I did the following in linphone to make it work:
|
@glance- sorry this PR got stuck. We are not looking that much into voip right now. Have you tested this with a grandstream ht801 to ensure that this keeps working? Also, since I have some VoIP enthusiasts in this PR: I've opened a bounty to make outbound calls work. |
I don't have access to any grandstream ht801, but i doubt that these changes would break anything. It's basically just more actual sip compatibility. |
This fixes two issues I found when testing linphone against voip-utils in home-assistant.