aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtp.c
AgeCommit message (Collapse)AuthorFilesLines
2008-05-14Add ast_assert(), which can be used to handle fatal errors. It is only compiledrussell1-4/+2
in if dev-mode is enabled, and only aborts if DO_CRASH is defined. (inspired by issue #12650) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@116463 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-22I thought I was going to be able to leave 1.4 alone, but that was not the case.russell1-4/+15
I ran into some problems with G.722 in 1.4, so I have merged in all of the fixes in this area that I have made in trunk/1.6.0, and things are happy again. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114550 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-14Don't change the SSRC when a new source comes into play, this might happen ↵file1-1/+0
quite often and depending on the remote side... they might not like this. (closes issue #12353) Reported by: dimas git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114100 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-01Disable Packet2Packet bridging when we need to feed DTMF frames into the ↵file1-3/+3
core. Some implementations do not like how we switch between things. (closes issue #12212) Reported by: bamby git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@112209 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-19Make sure that the mark bit does not incorrectly cause video frame ↵file1-2/+2
timestamps to be calculated as if they are audio frames. (closes issue #11429) Reported by: sperreault Patches: 11429-frametype.diff uploaded by qwell (license 4) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@110019 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-18Put a maximum limit on the number of payloads accepted, and also make sure a ↵file1-0/+3
given payload does not exceed our maximum value. (AST-2008-002) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@109386 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-07Properly initialize rtp->schedidtilghman1-0/+1
(Closes issue #12154) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@106606 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-05Add a control frame to indicate the source of media has changed. Depending ↵file1-2/+4
on the underlying technology it may need to change some things. (closes issue #12148) Reported by: jcomellas git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@106235 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-05Fix a bug that I just noticed in the RTP code. The calculation for setting therussell1-1/+1
len field in an ast_frame of audio was wrong when G.722 is in use. The len field represents the number of ms of audio that the frame contains. It would have set the value to be twice what it should be. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105932 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04In addition to setting the marker bit let's change our ssrc so they know for ↵file1-0/+1
sure it is a different source. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105676 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04When a new source of audio comes in (such as music on hold) make sure the ↵file1-0/+14
marker bit gets set. (closes issue #10355) Reported by: wdecarne Patches: 10355.diff uploaded by file (license 11) (closes issue #11491) Reported by: kanderson git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105674 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-18When a SIP channel is being auto-destroyed, it's possible for it to still betilghman1-0/+8
in bridge code. When that happens, we crash. Delay the RTP destruction until the bridge is ended. (closes issue #11960) Reported by: norman Patches: 20080215__bug11960__2.diff.txt uploaded by Corydon76 (license 14) Tested by: norman git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@103780 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-27When deleting a task from the scheduler, ignoring the return value couldtilghman1-18/+6
possibly cause memory to be accessed after it is freed, which causes all sorts of random memory corruption. Instead, if a deletion fails, wait a bit and try again (noting that another thread could change our taskid value). (closes issue #11386) Reported by: flujan Patches: 20080124__bug11386.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76, flujan, stuarth` git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@100465 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-16Replace current spy architecture with backport of audiohooks. This should ↵file1-2/+2
take care of current known spy issues. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98972 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-16Add two more SDP names for ulaw and alaw.file1-0/+2
(closes issue #11777) Reported by: tootai git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98958 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-15Commit a fix for some memory access errors pointed out by the valgrind2.txtrussell1-2/+2
output on issue #11698. The issue here is that it is possible for an instance of a translator to get destroyed while the frame allocated as a part of the translator is still being processed. Specifically, this is possible anywhere between a call to ast_read() and ast_frame_free(), which is _a lot_ of places in the code. The reason this happens is that the channel might get masqueraded during this time. During a masquerade, existing translation paths get destroyed. So, this patch fixes the issue in an API and ABI compatible way. (This one is for you, paravoid!) It changes an int in ast_frame to be used as flag bits. The 1 bit is still used to indicate that the frame contains timing information. Also, a second flag has been added to indicate that the frame came from a translator. When a frame with this flag gets released and has this flag, a function is called in translate.c to let it know that this frame is doing being processed. At this point, the flag gets cleared. Also, if the translator was requested to be destroyed while its internal frame still had this flag set, its destruction has been deffered until it finds out that the frame is no longer being processed. Admittedly, this feels like a hack. But, it does fix the issue, and I was not able to think of a better solution ... git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98943 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-11If the incoming RTP stream changes codec force the bridge to break if the ↵file1-0/+10
other side does not support it. (closes issue #11729) Reported by: tsearle Patches: new_codec_patch_udiff.patch uploaded by tsearle (license 373) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98325 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-10Add G729A as another possible payload name for G729. Some devices use this ↵file1-0/+1
instead of G729, which is perfectly normal since the payload number itself is defined and can't be used by anything else so the name doesn't matter that much. (closes issue #11483) Reported by: revolution Patches: rtp.diff uploaded by revolution (license 346) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@92204 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07At the end of a call, when we're reporting, RTCP may already be partially ↵tilghman1-8/+22
torn down, so check for NULL dereference Reported by: blitzrage Patch by: tilghman (Closes issue #11450) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91637 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-03Do not create a smoother for G723.1 frames, they need to be left alone to ↵file1-1/+1
their native 20/24 byte size. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90588 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27If we get a codec offer using a well-known payload type, but using it for ↵oej1-3/+16
another codec that we don't know, Asterisk did not remove that codec from the list. With this patch, we remove the codec from audio and video rtp objects and deny it ever existed. Thanks to lasse for testing. (closes issue #11376) Reported by: lasse Patches: bug11376.txt uploaded by oej (license 306) Tested by: lasse git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89630 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-15Bring both DTMF begin and end frames up through to the core for DTMF feature ↵file1-4/+4
handling. (closes issue #10826) Reported by: dimas git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@85559 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-15If Monitor or a spy was added to a P2P or native bridged channel bring the ↵file1-2/+4
channel back to the generic bridging core so the monitor or spy operations work. (closes issue #10943) Reported by: julianjm git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@85552 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-08Only update codec information if the channel has a technology private structure.file1-2/+2
(issue #10915) Reported by: ramonpeek git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@85057 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-08Update codec information as well as address when doing hold reinvites.file1-0/+5
(issue #10868) Reported by: mavince git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@85023 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-05Update the remembered RTP peer information when putting an endpoint on hold ↵file1-0/+5
or taking it off hold so that the RTP stack does not initiate a needless reinvite. (closes issue #10868) Reported by: mavince git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84818 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-03When an RFC 2833 event is sent that we don't recognize, ignore it, don't ↵tilghman1-0/+4
queue a NULL digit (closes issue #10877) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84581 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-21gcc 4.2 has a new set of warnings dealing with cosnt pointers. This set ofrussell1-9/+9
changes gets all of Asterisk (minus chan_alsa for now) to compile with gcc 4.2. (closes issue #10774, patch from qwell) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@83432 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-27(closes issue #10562)file1-1/+1
Reported by: idkpmiller Correct jitter value output in the CLI to be as expected. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@80974 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22(closes issue #10526)file1-1/+1
Reported by: sinistermidget Revert commit from issue #10355 and return timestamp skew to 640. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@80255 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-15(closes issue #10440)file1-1/+1
Reported by: irroot (closes issue #10454) Reported by: flo_turc Increase maximum timestamp skew to 120. 20 was apparently far too low. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@79553 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-06(closes issue #10355)file1-1/+1
Reported by: wdecarne Now that we pass through RTP timestamp information we need to make the allowed timestamp skew considerably less. There are situations where a source may change and due to the timestamp difference the receiver will experience an audio gap since we did not indicate by setting the marker bit that the source changed. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@78172 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-25set the sequence number in a frame for all frame typesrizzo1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@77022 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-17cast arguments to ast_log so that it builds without warnings for merussell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75447 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-17Ensure that the pointer to STUN data does not go to unaccessible memory. ↵file1-2/+2
(ASA-2007-017) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75439 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-27Only output debug information related to RTCP timestamps when RTCP debugrussell1-1/+1
is turned on (issue #10066, patch by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@72112 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-26Don't dereference a pointer that may be NULL here.qwell1-0/+3
Issue 10017. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@71915 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-21Do not Packet2Packet bridge if packetization settings do not allow it. ↵file1-0/+13
(issue #9117 reported by phsultan) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@70727 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-20Put the speex packetization values back in but disable it when setting up ↵file1-1/+1
the smoother. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@70360 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-19Merged revisions 69992 via svnmerge from file1-12/+17
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r69992 | file | 2007-06-19 13:00:58 -0400 (Tue, 19 Jun 2007) | 2 lines Handle the CC field in the RTP header. (issue #9384 reported by DoodleHu) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@70003 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-12Merged revisions 68921 via svnmerge from file1-0/+5
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r68921 | file | 2007-06-12 10:18:57 -0400 (Tue, 12 Jun 2007) | 2 lines Bring RTP back to Asterisk at the end of a native bridge no matter what. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@68922 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-06Merged revisions 67649 via svnmerge from file1-1/+6
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r67649 | file | 2007-06-06 09:28:34 -0400 (Wed, 06 Jun 2007) | 2 lines Reinvite the RTP back to the Asterisk machine when the timeout happens. (issue #9888 reported by gasparz) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67650 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-04Add a missing \n. (pointed out by jcmoore on IRC)russell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67071 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-29Handle cases where a frame may have no data. (issue #9519 reported by dmb)file1-2/+3
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@66437 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-24Make 1.4 build on my machine, too..russell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@66068 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-24don't use uninitialized variableskpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@65965 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-24I like it when the RTP stack compiles myself...file1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@65863 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-24Fix the calculation of the RTT for RTCP. The previous code would result inrussell1-19/+37
oscillating and incorrect data. Additionally, the RTT would sometimes report negative values due to incorrect calculations. (issue #9601, patch from davetroy) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@65842 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-20Avoid invalid seqno cycling detection.qwell1-1/+1
Per comment from Dave Troy: This adds back in some simple typecasting I had in an earlier version which I realize now may be breaking things. Issue #9554. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@61707 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-20Remove a stray debug message introduced by a recent commit.russell1-3/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@61697 f38db490-d61c-443f-a65b-d21fe96a405b