summaryrefslogtreecommitdiff
path: root/main/rtp_engine.c
AgeCommit message (Collapse)Author
2013-07-05Refactor RTCP events over to Stasis; associate with channelsMatthew Jordan
This patch does the following: * It merges Jaco Kroon's patch from ASTERISK-20754, which provides channel information in the RTCP events. Because Stasis provides a cache, Jaco's patch was modified to pass the channel uniqueid to the RTP layer as opposed to a pointer to the channel. This has the following benefits: (1) It keeps the RTP engine 'clean' of references back to channels (2) It prevents circular dependencies and other potential ref counting issues * The RTP engine now allows any RTP implementation to raise RTCP messages. Potentially, other implementations (such as res_rtp_multicast) could also raise RTCP information. The engine provides structs to represent RTCP headers and RTCP SR/RR reports. * Some general refactoring in res_rtp_asterisk was done to try and tame the RTCP code. It isn't perfect - that's *way* beyond the scope of this work - but it does feel marginally better. * A few random bugs were fixed in the RTCP statistics. (Example: performing an assignment of a = a is probably not correct) * We now raise RTCP events for each SR/RR sent/received. Previously we wouldn't raise an event when we sent a RR report. Note that this work will be of use to others who want to monitor call quality or build modules that report call quality statistics. Since the events are now moving across the Stasis message bus, this is far easier to accomplish. It is also a first step (though by no means the last step) towards getting Olle's pinefrog work incorporated. Again: note that the patch by Jaco Kroon was modified slightly for this work; however, he did all of the hard work in finding the right places to set the channel in the RTP engine across the channel drivers. Much thanks goes to Jaco for his hard work here. Review: https://reviewboard.asterisk.org/r/2603/ (closes issue ASTERISK-20574) Reported by: Jaco Kroon patches: asterisk-rtcp-channel.patch uploaded by jkroon (License 5671) (closes issue ASTERISK-21471) Reported by: Matt Jordan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-21Merge in the bridge_construction branch to make the system use the Bridging API.Richard Mudgett
Breaks many things until they can be reworked. A partial list: chan_agent chan_dahdi, chan_misdn, chan_iax2 native bridging app_queue COLP updates DTMF attended transfers Protocol attended transfers git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-07Add a 'secret' probation strictrtp mode to handle delayed changes in RTP sourceMatthew Jordan
Often, Asterisk may realize that a change in the source of an RTP stream is about to occur and ask that the RTP engine reset it's lock on the current RTP source. In certain scenarios, it may take awhile for the new remote system to send RTP packets, while the old remote system may continue providing RTP during that time period. This causes Asterisk to re-lock onto the old source, thereby rejecting the new source when the old source stops sending RTP and the new source begins. This patch prevents that by having a constant secondary, 'secret' probation mode enabled when an RTP source has been chosen. RTP packets from other sources are always considered, but never chosen unless the current RTP source stops sending RTP. Review: https://reviewboard.asterisk.org/r/2364 (closes issue AST-1124) Reported by: John Bigelow Tested by: John Bigelow (closes issue AST-1125) Reported by: John Bigelow Tested by: John Bigelow ........ Merged revisions 382573 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-12Do not allow native RTP bridging if packetization of media streams differs.Mark Michelson
The RTP engine will no longer allow for local and remote native RTP bridges if packetization of streams differs. Allowing native bridging in this scenario has been known to cause FAX failures. (closes ASTERISK-20650) Reported by: Maciej Krajewski Patches: ASTERISK-20659.patch uploaded by Mark Michelson (License #5049) Review: https://reviewboard.asterisk.org/r/2319 ........ Merged revisions 381281 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381306 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-09* Found some more places to use ast_channel_lock_both().Richard Mudgett
* Minor optimization in ast_rtp_instance_early_bridge(). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-09Fix end condition in ast_rtp_lookup_mime_multiple2.David M. Lee
The erroneous end condition would never include the AST_RTP_CISCO_DTMF flag in the debug output. (closes issue ASTERISK-20772) Reported by: Xavier Hienne ........ Merged revisions 378776 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378780 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07Multiple revisions 375993-375994Mark Michelson
........ r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines Fix misuses of timeouts throughout the code. Prior to this change, a common method for determining if a timeout was reached was to call a function such as ast_waitfor_n() and inspect the out parameter that told how many milliseconds were left, then use that as the input to ast_waitfor_n() on the next go-around. The problem with this is that in some cases, submillisecond timeouts can occur, resulting in the out parameter not decreasing any. When this happens thousands of times, the result is that the timeout takes much longer than intended to be reached. As an example, I had a situation where a 3 second timeout took multiple days to finally end since most wakeups from ast_waitfor_n() were under a millisecond. This patch seeks to fix this pattern throughout the code. Now we log the time when an operation began and find the difference in wall clock time between now and when the event started. This means that sub-millisecond timeouts now cannot play havoc when trying to determine if something has timed out. Part of this fix also includes changing the function ast_waitfor() so that it is possible for it to return less than zero when a negative timeout is given to it. This makes it actually possible to detect errors in ast_waitfor() when there is no timeout. (closes issue ASTERISK-20414) reported by David M. Lee Review: https://reviewboard.asterisk.org/r/2135/ ........ r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines Remove some debugging that accidentally made it in the last commit. ........ Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375995 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376014 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04Add support for applying direct media ACLs between differing channel ↵Joshua Colp
technologies. Review: https://reviewboard.asterisk.org/r/2122/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20Add support for DTLS-SRTP to res_rtp_asterisk and chan_sip.Joshua Colp
As mentioned on the review for this, WebRTC has moved towards choosing DTLS-SRTP as the mechanism for key exchange for SRTP. This commit adds support for this but makes it available for normal SIP clients as well. Testing has been done to ensure that this introduces no regressions with existing behavior and also that it functions as expected. Review: https://reviewboard.asterisk.org/r/2113/ ........ Merged revisions 373229 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05Re-fix sending unnegotiated payloads during a P2P RTP bridge.Mark Michelson
The previous fix still would look in the static_RTP_PT table, which is inappropriate since we specifically want to find a codec that has been negotiated. (closes issue ASTERISK-20296) reported by NITESH BANSAL Patches: codec_negotiation.patch Uploaded by NITESH BANSAL (License #6418) ........ Merged revisions 372311 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08Create the payload type if it does not exist when setting information based ↵Joshua Colp
on the 'm' line. An rtpmap attribute is not required for defined payload numbers. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07Payload and RTP code are must remain separate since in non-Asterisk format ↵Joshua Colp
cases they differ. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07Fix a bug uncovered by the test suite where the RTP payload number was not ↵Joshua Colp
getting set. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07Reduce memory consumption significantly for users of the RTP engine API by ↵Joshua Colp
storing only the payloads present and in use instead of every possible one. Review: https://reviewboard.asterisk.org/r/2052/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-20Add hangupcause translation supportKinsey Moore
The HANGUPCAUSE hash (trunk only) meant to replace SIP_CAUSE has now been replaced with the HANGUPCAUSE and HANGUPCAUSE_KEYS dialplan functions to better facilitate access to the AST_CAUSE translations for technology-specific cause codes. The HangupCauseClear application has also been added to remove this data from the channel. (closes issue SWP-4738) Review: https://reviewboard.asterisk.org/r/2025/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-01Add support for ICE/STUN/TURN in res_rtp_asterisk and chan_sip.Joshua Colp
Review: https://reviewboard.asterisk.org/r/1891/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-29Fix apparent copy and paste error where incorrect "glue" is used.Mark Michelson
........ Merged revisions 369511 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-19Ensure that pvt cause information does not break native bridgingKinsey Moore
Channel drivers that allow native bridging need to handle AST_CONTROL_PVT_CAUSE_CODE frames and previously did not handle them properly, usually breaking out of the native bridge. This change corrects that behavior and exposes the available cause code information to the dialplan while native bridges are in place. This required exposing the HANGUPCAUSE hash setter outside of channel.c, so additional documentation has been added. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15Multiple revisions 369001-369002Kevin P. Fleming
........ r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines Add support-level indications to many more source files. Since we now have tools that scan through the source tree looking for files with specific support levels, we need to ensure that every file that is a component of a 'core' or 'extended' module (or the main Asterisk binary) is explicitly marked with its support level. This patch adds support-level indications to many more source files in tree, but avoids adding them to third-party libraries that are included in the tree and to source files that don't end up involved in Asterisk itself. ........ r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines Add a script to enable finding source files without support-levels defined. ........ Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-24chan_sip: fix problem directmediapermit/deny uses the wrong addressJonathan Rose
When remotely bridging calls with directmedia, Asterisk would check the address of the peers/users holding directmedia ACLs (set via directmediapermit/directmediadeny) instead of the bridged peer. This is similar to r366547, but trunk specific and involves changes to the rtpengine instead of just chan_sip. (closes issue AST-876) review: https://reviewboard.asterisk.org/r/1924/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14Commit framework for HANGUPCAUSE (replacement for SIP_CAUSE)Kinsey Moore
This is the starting point for the Asterisk 11: Who Hung Up work and provides a framework which will allow channel drivers to report the types of hangup cause information available in SIP_CAUSE without incurring the overhead of the MASTER_CHANNEL dialplan function. The initial implementation only includes cause generation for chan_sip and does not include cause code translation utilities. This change deprecates SIP_CAUSE and replaces its method of reporting cause codes with the new framework. This change also deprecates the 'storesipcause' option in sip.conf. Review: https://reviewboard.asterisk.org/r/1822/ (Closes issue SWP-4221) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-20Move debug message in ast_rtp_instance_early_bridge_make_compatible().Richard Mudgett
Move debug message in ast_rtp_instance_early_bridge_make_compatible() to be output when what it states has actually happened. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-20Use ast_channel_lock_both() where it was inlined before.Richard Mudgett
The CHANNEL_DEADLOCK_AVOIDANCE() feature of preserving where the channel lock was originally obtained is overkill where ast_channel_lock_both() was inlined. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22Kill off red blobs in most of main/*Kinsey Moore
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13Finalize ast_channel opaquificationTerry Wilson
Review: https://reviewboard.asterisk.org/r/1786/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27Deprecated macro usage for connected line, redirecting, and CCSSKinsey Moore
This commit adds GoSub alternatives to connected line, redirecting, and CCSS macro hooks so that macro can finally be deprecated. This also adds deprecation warnings for those features when used and in documentation. Review: https://reviewboard.asterisk.org/r/1760/ (closes issue SWP-4256) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24Allow SRTP policies to be reloadedMatthew Jordan
Currently, when using res_srtp, once the SRTP policy has been added to the current session the policy is locked into place. Any attempt to replace an existing policy, which would be needed if the remote endpoint negotiated a new cryptographic key, is instead rejected in res_srtp. This happens in particular in transfer scenarios, where the endpoint that Asterisk is communicating with changes but uses the same RTP session. This patch modifies res_srtp to allow remote and local policies to be reloaded in the underlying SRTP library. From the perspective of users of the SRTP API, the only change is that the adding of remote and local policies are now added in a single method call, whereas they previously were added separately. This was changed to account for the differences in handling remote and local policies in libsrtp. Review: https://reviewboard.asterisk.org/r/1741/ (closes issue ASTERISK-19253) Reported by: Thomas Arimont Tested by: Thomas Arimont Patches: srtp_renew_keys_2012_02_22.diff uploaded by Matt Jordan (license 6283) (with some small modifications for this check-in) ........ Merged revisions 356604 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 356605 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24Opaquification for ast_format structs in struct ast_channelTerry Wilson
Review: https://reviewboard.asterisk.org/r/1770/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20ast_channel opaquification of pointers and integral typesTerry Wilson
Review: https://reviewboard.asterisk.org/r/1753/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-28Add 'L16-256' MIME subtype alias for slin16.Kevin P. Fleming
Asterisk has supported the 'L16' MIME subtype for 16kHz signed linear (PCM) audio for quite some time, but some endpoints refer to it as 'L16-256'. This commit adds this as an alias for the existing format. ........ Merged revisions 353126 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353127 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353128 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16Add missing code to set direct RTP setup information during dialing.Joshua Colp
........ Merged revisions 350975 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 350976 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09Replace direct access to channel name with accessor functionsTerry Wilson
There are many benefits to making the ast_channel an opaque handle, from increasing maintainability to presenting ways to kill masquerades. This patch kicks things off by taking things a field at a time, renaming the field to '__do_not_use_${fieldname}' and then writing setters/getters and converting the existing code to using them. When all fields are done, we can move ast_channel to a C file from channel.h and lop off the '__do_not_use_'. This patch sets up main/channel_interal_api.c to be the only file that actually accesses the ast_channel's fields directly. The intent would be for any API functions in channel.c to use the accessor functions. No more monkeying around with channel internals. We should use our own APIs. The interesting changes in this patch are the addition of channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to use accessor functions when ast_channel is really opaque), and some re-working of the way channel iterators/callbacks are handled so as to avoid creating fake ast_channels on the stack to pass in matching data by directly accessing fields (since "name" is a stringfield and the fake channel doesn't init the stringfields, you can't use the ast_channel_name_set() function). I went with ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a setter. The majority of the grunt-work for this change was done by writing a semantic patch using Coccinelle ( http://coccinelle.lip6.fr/ ). Review: https://reviewboard.asterisk.org/r/1655/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-29Handle AST_CONTROL_UPDATE_RTP_PEER frames in local bridge loopMatthew Jordan
Failing to handle AST_CONTROL_UPDATE_RTP_PEER frames in the local bridge loop causes the loop to exit prematurely. This causes a variety of negative side effects, depending on when the loop exits. This patch handles the frame by essentially swallowing the frame in the local loop, as the current channel drivers expect the RTP bridge to handle the frame, and, in the case of the local bridge loop, no additional action is necessary. (issue ASTERISK-19040) (issue ASTERISK-19128) (issue ASTERISK-17725) (issue ASTERISK-18340) (closes issue ASTERISK-19095) Reported by: Stefan Schmidt Tested by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1640/ ........ Merged revisions 349339 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 349340 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16Merged revisions 336307 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r336307 | jrose | 2011-09-16 16:09:20 -0500 (Fri, 16 Sep 2011) | 20 lines Merged revisions 336294 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r336294 | jrose | 2011-09-16 14:53:40 -0500 (Fri, 16 Sep 2011) | 13 lines Fix bad RTP media bridges in directmedia calls on peers separated by multiple Asterisk nodes. In a situation involving devices on separate Asterisk trunks, the remote RTP bridge would break when starting a call with directmedia. This patch queues a new type of control frame so that our RTP bridge loop can properly detect when these situations occur and check to see if peers need to be updated in order to send their media to the proper location. (Closes issue ASTERISK-18340) Reported by: Thomas Arimont (Closes issue ASTERISK-17725) Reported by: kwk Tested by: twilson, jrose ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-15Merged revisions 331894 via svnmerge from Paul Belanger
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r331894 | pabelanger | 2011-08-15 11:22:45 -0400 (Mon, 15 Aug 2011) | 12 lines Merged revisions 331886 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r331886 | pabelanger | 2011-08-15 11:21:16 -0400 (Mon, 15 Aug 2011) | 5 lines Fix noisy message when briding channels (closes issue ASTERISK-18270) Reported by: Federico Alves ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-19Merged revisions 328824 via svnmerge from Kinsey Moore
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328824 | kmoore | 2011-07-19 13:05:21 -0500 (Tue, 19 Jul 2011) | 18 lines Merged revisions 328823 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328823 | kmoore | 2011-07-19 12:57:18 -0500 (Tue, 19 Jul 2011) | 11 lines RTP bridge away with inband DTMF and feature detection When deciding whether Asterisk was allowed to bridge the call away from the core, chan_sip did not take into account the usage of features on dialed channels that require monitoring of DTMF on channels utilizing inband DTMF. This would cause Asterisk to allow the call to be locally or remotely bridged, preventing access to the data required to detect activations of such features. (closes 17237) Review: https://reviewboard.asterisk.org/r/1302/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-07Adds pass-through support for codec CELT.David Vossel
This patch adds pass-through support for CELT. CELT formats are defined in codecs.conf and can be configured to any sample rate a CELT endpoint supports. This patch also addresses a crash in channel.c resulting from a frame list being freed incorrectly. This crash was discovered while testing a CELT translator which had to split encoded audio into multiple frames. The codec translator is not a part of this patch, but may be contributed in the future. Review: https://reviewboard.asterisk.org/r/1294/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-29Merged revisions 325537 via svnmerge from Matthew Nicholson
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r325537 | mnicholson | 2011-06-29 10:34:47 -0500 (Wed, 29 Jun 2011) | 2 lines don't do native/remote bridging if a framehook is active on the channel ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@325538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-14Merged revisions 323370 via svnmerge from Terry Wilson
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r323370 | twilson | 2011-06-14 09:33:55 -0700 (Tue, 14 Jun 2011) | 10 lines Add rtpkeepalives back to 1.8 The RTP-engine conversion left out support for handling rtpkeepalives. This patch adds them back. (closes issue ASTERISK-17304) Reported by: lmadsen Review: https://reviewboard.asterisk.org/r/1226/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@323374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-26Merged revisions 321042 via svnmerge from Terry Wilson
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r321042 | twilson | 2011-05-26 10:29:54 -0700 (Thu, 26 May 2011) | 6 lines Initialize stack-allocated ast_sockaddrs before use It is important to always initialize ast_sockaddrs before use--even if they are passed to ast_sockaddr_copy as the underlying storage could be bigger than what ends up being copied--leaving part of the data unitialized. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@321043 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03Merged revisions 316265 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines Fix a bunch of compiler warnings generated by gcc 4.6.0. Most of these are -Wunused-but-set-variable, but there were a few others mixed in here, as well. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-18Merged revisions 314017 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r314017 | dvossel | 2011-04-18 08:41:06 -0500 (Mon, 18 Apr 2011) | 17 lines sip codec negotiation of dynamic rtp payloads error fix This patch fixes how chan_sip handles dynamic rtp payload types it does not understand. At the moment if a dynamic payload's mime type does not match one we understand, the payload does not get removed from our payload table. As a result of this, the payload is set to whatever dynamic codec we use internally for that payload number on outgoing INVITES. This is incorrect. This patch fixes this by properly checking the rtpmap set function's return code to make sure it was found. The function can return both -1 and -2 depending on the source of the mismatch. We were just checking -1 explicitly. Review: https://reviewboard.asterisk.org/r/1169/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-11Merged revisions 310287 via svnmerge from Alec L Davis
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r310287 | alecdavis | 2011-03-11 19:47:44 +1300 (Fri, 11 Mar 2011) | 17 lines remote_bridge_loop: prevent segfault when after transfer of IAX2 of DAHDI call If the channel condition is one of the following after breaking out of the loop, don't try to update_peer (where x = 0/1) 1). ZOMBIE 2). cx->tech_pvt != pvtx 3). gluex != ast_rtp_instance_get_glue(cx->tech->type)) (closes issue #18781) Reported by: alecdavis Patches: bug18781.diff3.txt uploaded by alecdavis (license 585) Tested by: alecdavis, ZX81 Review: https://reviewboard.asterisk.org/r/1128/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@310288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-22Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd ↵David Vossel
audio ConfBridge, and other stuff -Functional changes 1. Dynamic global format list build by codecs defined in codecs.conf 2. SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf 3. Negotiation of SILK attributes in chan_sip. 4. SPEEX 32khz with translation 5. SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation using codec_resample.c 6. Various changes to RTP code required to properly handle the dynamic format list and formats with attributes. 7. ConfBridge now dynamically jumps to the best possible sample rate. This allows for conferences to take advantage of HD audio (Which sounds awesome) 8. Audiohooks are no longer limited to 8khz audio, and most effects have been updated to take advantage of this such as Volume, DENOISE, PITCH_SHIFT. 9. codec_resample now uses its own code rather than depending on libresample. -Organizational changes Global format list is moved from frame.c to format.c Various format specific functions moved from frame.c to format.c Review: https://reviewboard.asterisk.org/r/1104/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03Asterisk media architecture conversion - no more format bitfieldsDavid Vossel
This patch is the foundation of an entire new way of looking at media in Asterisk. The code present in this patch is everything required to complete phase1 of my Media Architecture proposal. For more information about this project visit the link below. https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal The primary function of this patch is to convert all the usages of format bitfields in Asterisk to use the new format and format_cap APIs. Functionally no change in behavior should be present in this patch. Thanks to twilson and russell for all the time they spent reviewing these changes. Review: https://reviewboard.asterisk.org/r/1083/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-20Some scheduler API cleanup and improvements.Russell Bryant
Previously, I had added the ast_sched_thread stuff that was a generic scheduler thread implementation. However, if you used it, it required using different functions for modifying scheduler contents. This patch reworks how this is done and just allows you to optionally start a thread on the original scheduler context structure that has always been there. This makes it trivial to switch to the generic scheduler thread implementation without having to touch any of the other code that adds or removes scheduler entries. In passing, I made some naming tweaks to add ast_ prefixes where they were not there before. Review: https://reviewboard.asterisk.org/r/1007/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-03Merged revisions 293803 via svnmerge from Terry Wilson
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r293803 | twilson | 2010-11-03 11:05:14 -0700 (Wed, 03 Nov 2010) | 25 lines Avoid valgrind warnings for ast_rtp_instance_get_xxx_address The documentation for ast_rtp_instance_get_(local/remote)_address stated that they returned 0 for success and -1 on failure. Instead, they returned 0 if the address structure passed in was already equivalent to the address instance local/remote address or 1 otherwise. 90% of the calls to these functions completely ignored the return address and passed in an uninitialized struct, which would make valgrind complain even though the operation was technically safe. This patch fixes the documentation and converts the get_xxx_address functions to void since all they really do is copy the address and cannot fail. Additionally two new functions (ast_rtp_instance_get_and_cmp_(local/remote)_address) are created for the 3 times where the return value was actually checked. The get_and_cmp_local_address function is currently unused, but exists for the sake of symmetry. The only functional change as a result of this change is that we will not do an ast_sockaddr_cmp() on (mostly uninitialized) addresses before doing the ast_sockaddr_copy() in the get_*_address functions. So, even though it is an API change, it shouldn't have a noticeable change in behavior. Review: https://reviewboard.asterisk.org/r/995/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@293809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-02Merged revisions 289840 via svnmerge from Jeff Peeler
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r289840 | jpeeler | 2010-10-01 21:43:45 -0500 (Fri, 01 Oct 2010) | 29 lines Merged revisions 289798 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r289798 | jpeeler | 2010-10-01 18:01:31 -0500 (Fri, 01 Oct 2010) | 22 lines Merged revisions 289797 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r289797 | jpeeler | 2010-10-01 17:58:38 -0500 (Fri, 01 Oct 2010) | 15 lines Change RFC2833 DTMF event duration on end to report actual elapsed time. The scenario here is with a non P2P early media session. The reported time length of DTMF presses are coming up short when sending to the remote side. Currently the event duration is a running total that is incremented when sending continuation packets. These continuation packets are only triggered upon incoming media from the remote side, which means that the running total probably is not going to end up matching the actual length of time Asterisk received DTMF. This patch changes the end event duration to be lengthened if it is detected that the end event is going to come up short. Review: https://reviewboard.asterisk.org/r/957/ ABE-2476 ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-01Merged revisions 284477 via svnmerge from Terry Wilson
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r284477 | twilson | 2010-09-01 13:44:36 -0500 (Wed, 01 Sep 2010) | 17 lines Fix SRTP for changing SSRC and multiple a=crypto SDP lines Adding code to Asterisk that changed the SSRC during bridges and masquerades broke SRTP functionality. Also broken was handling the situation where an incoming INVITE had more than one crypto offer. This patch caches the SRTP policies the we use so that we can change the ssrc and inform libsrtp of the new streams. It also uses the first acceptable a=crypto line from the incoming INVITE. (closes issue #17563) Reported by: Alexcr Patches: srtp.diff uploaded by twilson (license 396) Tested by: twilson Review: https://reviewboard.asterisk.org/r/878/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-29Merged revisions 280391 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r280391 | russell | 2010-07-29 11:25:43 -0500 (Thu, 29 Jul 2010) | 2 lines Don't blow up if get_codec() was not provided in the RTP glue. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@280395 65c4cc65-6c06-0410-ace0-fbb531ad65f3