Introduces support for real-time text conversation over RTP (RFC 4103).#1128
Introduces support for real-time text conversation over RTP (RFC 4103).#1128xkaraman wants to merge 11 commits into
Conversation
|
REMINDER: If this PR applies to other branches, please add a comment with the appropriate "cherry-pick-to" headers as per the Create a Pull Request process. If you don't want it cherry-picked, please add a comment with If, after adding "cherry-pick-to" comments, you change your mind, please edit the comment to DELETE the header lines and add The currently active branches are now 20, 21, 22 and master. |
|
Workflow PRCheck failed |
|
Hi, tried new patches, as @henningw requested, now * crashes immediately after initiating call: note however I'm trying patch with 20.11.1, as it's the last release I'm able to build on my test env (centos7). I'll prepare newer test env to check whether this changes things. |
|
Thanks for the feedback @nikolaciprich, we will have a look. Which client do you use for testing, also the tipcon1? |
NP. yes, tipcon1, wasn't able to find anything else freely available.. if you have a tip for another client, please let me know. |
|
Ok, I see. Yes, the client situation for tests is not so good. Can you please share your settings to easier reproduce it? E.g.:
|
|
cherry-pick-to: 23 |
|
I was looking through this patch a bit and how red works in asterisk in general when I came across: asterisk/res/res_rtp_asterisk.c Line 9184 in 2d7948f According to the
So I think it should be |
|
Yeah, we also wondered why it was done like this in our internal review. It was already present in the original patch, but its probably a bug. We will test tomorrow again for that. |
|
I've confirmed that it is a bug introduced when the RTP engine was modularized (split out into Line 4845 in 08971ce I am going to open a separate PR to address that since it is a bug fix. |
Found while reviewing asterisk#1128
Found while reviewing asterisk#1128
|
@seanbright just to give an update - we were able to reproduce the crash with another (commercial) client. My colleague added additional locking to the PR and its now not crashing anymore. We will do another review tomorrow morning and push an updated version also for you to test. |
There was a problem hiding this comment.
Please follow the requirements for code contribution and formatting commit messages...
- Squash the commits into one.
- Don't put any non-standard headers after the standard ones.
- You need to add a UserNote announcing the new functionality.
- You need to add an UpgradeNote announcing a database schema change.
- The PR description must have the
Fixesheader or the related issue won't be closed.
See:
https://docs.asterisk.org/Development/Policies-and-Procedures/Code-Contribution/
https://docs.asterisk.org/Development/Policies-and-Procedures/Commit-Messages/
|
Workflow PRCheck completed successfully |
|
@seanbright With the addition of 4538db6 it does not crash anymore in our tests, maybe you can give it a try as well. Regarding the other comments from your side and others, we will review and address them. |
…debugging statement to path
|
Workflow Check failed |
|
New changes as requested from the different reviews were added as individual commits. To give a summary about the testing status, things are looking now much better in our opinion. Below the details.
If you like please give it another test from your side. Test clients were tipcon1 v1.5.1, pjsua 2.17, ectouch is not free available. |
The python bindings for pjsua have been problematic for the testsuite and we no longer build it in the workflows. It may take a bit of effort to get it working again but we can cross that bridge when we come to it. |
Thanks. We used the linux application, to be precise, so it should be fine. |
|
@gtjoseph your requested changes should be addressed now. |
|
Workflow Check failed |
Thinking further, I'd prefer just not removing the code, Asterisk 20 receives full support until October of this year and security fixes until October 2027. Since this PR touches many files, not putting it into 20 could make cherry-picking other PRs into 20 fail and require manual intervention. |
The red_write(..) scheduler code does nothing after the initial change set. So you suggested to remove it, which we have done. This removal also fixed a error log, that always came at shutdown related to this, as I noticed. I don't think it makes sense to add a compatibility layer for chan_sip to the branch 20 to this PR. I would be also not in a position to spend significant time in this area, as its an obselete SIP stack (and deprecated since asterisk 17). Naturally we never tested this PR with chan_sip, so it will probably not work. So the options I see after finalising this PR:
My preference would be 1 or alternatively 2, if affecting RTT for chan_sip is not accetable for the project team. |
|
I know you're frustrated and I'm sorry for the churn but this PR touches so many things that not including it in all active branches will make life difficult for years down the road. Basically, anyone who adds pjsip options or touches anything near any of your changes will need to create multiple pull requests until October 2029 when Asterisk 22 goes EOL. It's also not acceptable to break something that currently works. You're not being asked to spend "significant" time on this. In rtp_red_init for instance, you could simply get the ast_rtp_glue from the instance and only start the timer if the glue was registered by chan_sip. |
Thanks for the hint. I am not frustrated, just it seems from the outside that the requirements from your side keep changing. I will look into the suggested approach. |
|
@gtjoseph Unless I made a stupid mistake, I think that during the time when the scheduler is started the chan_pjsip glue is unfortunately not initialized yet. Does chan_sip works different in this regards? |
Excellent question but it's one I don't have an answer for. :( Alternatively, you could do the following... const char *chanid = ast_rtp_instance_get_channel_id(instance);
if (!ast_strlen_zero(chanid)) {
struct ast_channel *chan = ast_channel_get_by_uniqueid(chanid);
if (chan && ast_strings_equal(ast_channel_tech(chan)->type, "SIP")) {
rtp->red->schedid = ast_sched_add(rtp->sched, buffer_time, red_write, instance);
}
ao2_cleanup(chan);
} |
…scheduling for it" This reverts commit ee36b26.
…o add back actual write, not scheduled for chan_pjsip
|
Thanks. I spend some hours to setup a chan_sip test with asterisk 20. Your proposed second solution seems to work there, see below. As a note, asterisk 20 with chan_sip seems to be not working correctly anyhow for real-time text, as the pjsua does not display any received text messages. This was on a unmodified (besides some added logging) asterisk 20 (73daa96). The previous dicusssed removal was reverted and the proposed solution was added as another commit, also restoring the write for chan_sip in red_write(..). |
|
Workflow Check failed |
|
@mariefischer Maybe you want to give it a try with the new version pushed last week. If there are some traces you want to share, feel free to send me an email (visible in my github profile). @gtjoseph If you are satisified with the chan_sip related changes suggested from your side, please remove the "changes requested" flag, thank you. @seanbright Can you also review the state from your side? You are also having the "changes requested" flag set, thanks as well. |
|
Presentation with current status and further background from a conference link |
Based on a PR from Bharat Ramaswamy Nandakumar bharat@bramsoft.com
Previous changes from PR #998
issue
New additions:
UserNote: This introduces support for real-time text conversation over RTP (RFC 4103).
To enable it you need to add t140 and preferable also red as supported codecs.
You can configure this functionality by three new parameters in the endpoint
section of pjsip.conf: tos_text, cos_text and max_text_streams. If you are
using a database, please have a look to the upgrade notes.
UpgradeNote: This change introduce a schema modification for the ps_endpoint table by
alembic. If you don't use the scripts to update your database, please
adapt the table manually to the new structure. New fields were tos_text,
cos_text and max_text_streams.
Resolves: #997
Resolves: #1128