[asterisk-bugs] [JIRA] (ASTERISK-21920) IAX trunk timestamps set to zero when it's bridged SIP channel wraps RTP timestamps

Alec Davis (JIRA) noreply at issues.asterisk.org
Wed Jul 10 04:55:03 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-21920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=207892#comment-207892 ] 

Alec Davis commented on ASTERISK-21920:
---------------------------------------

What I'm missing here is what is the symptom?

If I'm on the right track, the RTP RFC 3550 says that the initial value for RTP 'SHOULD' be random. So could at times start close to the max.
Thus the wrap around time for an audio call at 160 samples at 20ms rate, could be from 6.21 days (if initial timestamp = 0) down to seconds or less.

Two approaches I can see;
   1). At the source, limit the upper random value of the initial RTP timestamp to 0x7FFFFFFF, that will allow an audio call 3 days long as the minimum.
   2). On our side, we need to work in modular arithmetic (refer RFC3550 and NTP wrap around), record the initial timestamp, then work with the difference of the delivered timestamp and the initial timestamp. I think....
   
                
> IAX trunk timestamps set to zero when it's bridged SIP channel wraps RTP timestamps
> -----------------------------------------------------------------------------------
>
>                 Key: ASTERISK-21920
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21920
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_iax2
>    Affects Versions: 1.8.22.0
>            Reporter: Gerhard
>         Attachments: iax.conf, issue_21920_full_log, rtpwrapiaxissue-bothrtpandiaxstreams.pcap, rtpwrapiaxissue_logB.pcap, sip.conf
>
>
> I have a Asterisk 1.8.22.0 box, with a SIP trunk to a Voip provider, and an IAX trunk (trunked, trunktimestamps enabled) to a client's PBX.
> The client places a call that arrives at Asterisk via IAX, and then the call goes via SIP to the telco. A RTP stream is now being received from the telco. 
> When this RTP stream's (from the telco) timestamp wraps (at 4 294 967 295), the IAX trunk timestamp transmitted from Asterisk is ZERO from then on, until the end of the call.
> I suspect this is done by the following code lines, which tries to prevent timestamps with negative values from being inserted in the IAX tx stream, without checking for RTP timestamp wrapping:
> chan_iax2.c :
> {noformat}
> Line 5940:
> 		if (ms < 0) {
> 			ms = 0;
> 		}
> Line 5947
> 		if (ms < 0)
> 			ms = 0;
> {noformat}
> See the tcpdump capture file supplied (the 1.8.22.0 Asterisk box has IP 192.168.200.222, the telco has IP 192.168.200.10, and the client has IP 192.168.200.5):
> At 12.854s into the capture, the RTP timestamp wraps. 
> Correspondingly in the IAX trunk packet at 12.867s into the capture, the trunk timestamp is 0, and stays 0 (in the previous trunk packet the timestamp was still 10132)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list