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
Please add STUN server username and password support #87
Comments
Wait...isn't the actual username and its password used? |
If stunuser and/or stunpass are not given, then looks like uri user (not auth user) and auth_pass are used:
I can add stun user and stun pass when I get the time. |
I've tried entering stunuser/stunpass but they get rejected. Maybe I am doing something wrong, but the help text (lines 82-84 of app/src/main/res/values/strings.xml) says they are not supported.
|
Yes, they are not yet supported. It should work if you can configure your stun server to accept uri userpart as username and authentication password as password. |
And would it also be possible to add "TURN" to media nat options? The turn module is already enabled so it probably is just a matter of adding turn/TURN to the arrays on lines 81-82 of app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt. |
I'll add TURN option too. New API functions need to be first added to baresip lib for setting STUN username and password (baresip/baresip#1015). |
Ok, many thanks. Watch out, the turn module needs the stun server uri to start with "turn:", not "stun:", see cherck on lines 188-189 of libbaresip-android/baresip/modules/turn/turn.c
Also ICE uses the scheme to decide whether to operate in STUN or TURN mode (lines 482-500 of libbaresip-android/baresip/modules/ice/ice.c)
|
I've tried it and it works but the TURN module works only if I quit the application then restart it. I've traced it to the fact that when it starts up, account_alloc calls stunsrv_decode which calls stunuri_decode and therefore stunuri.scheme gets set correctly. When changing it from the gui without restarting instead, account_set_stun_host only calls stunuri_set_host which does not update stunuri.scheme. As a result the TURN module fails with ENOTSUP. Perhaps account_set_stun_host needs to call stunuri_decode too? |
How about this (not tested)?
|
It works but after the app is restarted, the STUN server in the gui loses the "turn:"/"stun:" prefix. I think this is because it gets populated by account_stun_host which only returns the host part after the prefix and it ignores the scheme. |
Yes, I noticed it too and I'm now in the process of adding two new API functions: account[_set]_stun_uri, since there is currently no way of getting the scheme of STUN server URI. |
Master branch is now using account[_set]_stun_uri API functions. Please try again. |
It works. Many thanks for your very prompt reaction. |
Thanks for testing. |
This would be greatly appreciated, thanks.
The text was updated successfully, but these errors were encountered: