[Home]

Summary:ASTERISK-30120: RTP Timestamp issue causes clicks & pops on calls routed via alternate Call Platforms
Reporter:Neeraj (nrjchnd)Labels:
Date Opened:2022-07-01 09:14:08Date Closed:2022-07-22 12:00:36
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_rtp_asterisk
Versions:16.25.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Centos 7; Centos 8 StreamsAttachments:
Description:Asterisk version: 16.25.2
Problem description:
RTP Timestamp issue causes clicks & pops on calls routed via alternate Call Platforms.

Cause:
This means that a short frame following a typical frame should have a timestamp that is a typical frame offset in time, it is the frame after the short frame that should have a shorter timestamp offset. However this does not seem to be the case currently.

With a shortened packet, the wrong value will be written

{code:title=res_rtp_asterisk.c}
static int rtp_raw_write(struct ast_rtp_instance *instance, struct ast_frame *frame, int codec)
{
   struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
   int pred, mark = 0;
   unsigned int ms = calc_txstamp(rtp, &frame->delivery);
   struct ast_sockaddr remote_address = { {0,} };
   int rate = ast_rtp_get_rate(frame->subclass.format) / 1000;
   unsigned int seqno;
#ifdef TEST_FRAMEWORK
   struct ast_rtp_engine_test test = ast_rtp_instance_get_test(instance);
#endif
   if (ast_format_cmp(frame->subclass.format, ast_format_g722) == AST_FORMAT_CMP_EQUAL) {
       frame->samples /= 2;
   }
   if (rtp->sending_digit) {
       return 0;
   }
#ifdef TEST_FRAMEWORK
   if (test && test->send_report) {
       test->send_report = 0;
       ast_rtcp_write(instance);
       return 0;
   }
#endif
   if (frame->frametype == AST_FRAME_VOICE) {
       pred = rtp->lastts + frame->samples;
       /* Re-calculate last TS /
       rtp->lastts = rtp->lastts + ms * rate;
       if (ast_tvzero(frame->delivery)) {
           /* If this isn’t an absolute delivery time, Check if it is close to our prediction,
            * and if so, go with our prediction */
           if (abs((int)rtp->lastts - pred) < MAX_TIMESTAMP_SKEW) {
               rtp->lastts = pred;
           } else {
               ast_debug_rtp(3, “(%p) RTP audio difference is %d, ms is %u\n”,
                   instance, abs((int)rtp->lastts - pred), ms);
               mark = 1;
           }
{code}
Comments:By: Asterisk Team (asteriskteam) 2022-07-01 09:14:10.650-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Benjamin Keith Ford (bford) 2022-07-07 08:32:29.369-0500

# Did this start happening after an upgrade? If so, what version were you on before?
# Do you have any logs or packet traces showing this happening?
# Is this happening with all calls or a specific scenario?

By: Asterisk Team (asteriskteam) 2022-07-22 12:00:35.996-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines