summaryrefslogtreecommitdiff
path: root/channels/chan_console.c
AgeCommit message (Collapse)Author
2008-08-29Merged revisions 140488 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r140488 | mmichelson | 2008-08-29 12:34:17 -0500 (Fri, 29 Aug 2008) | 22 lines After working on the ao2_containers branch, I noticed something a bit strange. In all cases where we provide a callback function to ao2_container_alloc, the callback function would only return 0 or CMP_MATCH. After inspecting the ao2_callback() code carefully, I found that if you're only looking for one specific item, then you should return CMP_MATCH | CMP_STOP. Otherwise, astobj2 will continue traversing the current bucket until the end searching for more matches. In cases like chan_iax2 where in 1.4, all the peers are shoved into a single bucket, this makes for potentially terrible performance since the entire bucket will be traversed even if the peer is one of the first ones come across in the bucket. All the changes I have made were for cases where the callback function defined was passed to ao2_container_alloc so that calls to ao2_find could find a unique instance of whatever object was being stored in the container. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-09Merge more changes from the resolve-shadow-warnings branch (henceforth knownSean Bright
as RSW since i am too lazy to keep typing it all out). This time a few of the channels. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-04Be explicit that we don't want a result from this callback. The callback wouldRussell Bryant
never indicate a match, so nothing would have been returned anyway, but it was still a poor example of proper usage. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-08This was accidentally reverted.Jeff Peeler
Fixes a bug where if a stream monitor thread was not created (caused from failure of opening or starting the stream) pthread_cancel was called with an invalid thread ID. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22chan_console fixes because of ast_frame.data => ast_frame.data.ptrMichiel van Baak
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22- revert change to ast_queue_hangup and create ast_queue_hangup_with_causeMichiel van Baak
- make data member of the ast_frame struct a named union instead of a void Recently the ast_queue_hangup function got a new parameter, the hangupcause Feedback came in that this is no good and that instead a new function should be created. This I did. The hangupcause was stored in the seqno member of the ast_frame struct. This is not very elegant, and since there's already a data member that one should be used. Problem is, this member was a void *. Now it's a named union so it can hold a pointer, an uint32 and there's a padding in case someone wants to store another type in there in the future. This commit is so massive, because all ast_frame.data uses have to be altered to ast_frame.data.data Thanks russellb and kpfleming for the feedback. (closes issue #12674) Reported by: mvanbaak git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30Merged revisions 114891 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114891 | russell | 2008-04-30 11:30:01 -0500 (Wed, 30 Apr 2008) | 28 lines Merge changes from team/russell/iax2_find_callno and iax2_find_callno_1.4 These changes address a critical performance issue introduced in the latest release. The fix for the latest security issue included a change that made Asterisk randomly choose call numbers to make them more difficult to guess by attackers. However, due to some inefficient (this is by far, an understatement) code, when Asterisk chose high call numbers, chan_iax2 became unusable after just a small number of calls. On a small embedded platform, it would not be able to handle a single call. On my Intel Core 2 Duo @ 2.33 GHz, I couldn't run more than about 16 IAX2 channels. Ouch. These changes address some performance issues of the find_callno() function that have bothered me for a very long time. On every incoming media frame, it iterated through every possible call number trying to find a matching active call. This involved a mutex lock and unlock for each call number checked. So, if the random call number chosen was 20000, then every media frame would cause 20000 locks and unlocks. Previously, this problem was not as obvious since Asterisk always chose the lowest call number it could. A second container for IAX2 pvt structs has been added. It is an astobj2 hash table. When we know the remote side's call number, the pvt goes into the hash table with a hash value of the remote side's call number. Then, lookups for incoming media frames are a very fast hash lookup instead of an absolutely insane array traversal. In a quick test, I was able to get more than 3600% more IAX2 channels on my machine with these changes. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114892 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30Fixes a bug where if a stream monitor thread was not created (caused from ↵Jeff Peeler
failure of opening or starting the stream) pthread_cancel was called with an invalid thread ID. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25Speaking of building...Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-21(closes issue #6113)Jeff Peeler
Reported by: oej Tested by: jpeeler This patch implements multiple parking lots for parked calls. The default parkinglot is used by default, however setting the channel variable PARKINGLOT in the dialplan will allow use of any other configured parkinglot. See configs/features.conf.sample for more details on setting up another non-default parkinglot. Also, one can (currently) set the default parkinglot to use in the driver configuration file via the parkinglot option. Patch initially written by oej, brought up to date and finalized by mvanbaak, and then stabilized and converted to astobj2 by me. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05Merged revisions 106235 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r106235 | file | 2008-03-05 18:32:10 -0400 (Wed, 05 Mar 2008) | 4 lines Add a control frame to indicate the source of media has changed. Depending on the underlying technology it may need to change some things. (closes issue #12148) Reported by: jcomellas ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-21Remove compiler warning for uninitialized variableOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-20Add a "console active" CLI command, which lets you find out which console deviceRussell Bryant
is currently active for the Asterisk CLI, or to set it. Also, knock multiple device support off of the to-do list. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-20Merge changes from team/russell/console_devicesRussell Bryant
- Add support for multiple devices. All devices are configured in console.conf. - Add "console list devices" CLI command to show configured devices. Also, changed the old "list devices" to be "list available", which queries PortAudio for all audio devices that are available for use. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-17Make the output of "console list devices" a bit prettier.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-17List which devices are inputs and outputs in "console list devices"Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08Change reference to external library so it appears on the extref listingOlle Johansson
http://www.asterisk.org/doxygen/trunk/extref.html git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-05Add the URL to the home page for portaudio. Also add the location of theRussell Bryant
svn repository to check out portaudio v19. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02Add support for generating a ringing sound on an incoming call. This is a bitRussell Bryant
of a hack. It just asks the core to generate the same tone that it would when you hear ringback when making an outbound call. But hey, it works, and you get the localized ring tone for the appropriate language set on the channel. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02Note that this module doesn't actually play a ringing sound for an incoming callRussell Bryant
... oops git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02Show the correct CLI command to answer the callRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-31Update chan_console to natively use a 16 kHz sample rate. If it is talkingRussell Bryant
to an 8 kHz endpoint, then codec_resample will automatically be used to properly resample the audio before sending it to/from chan_console. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@95527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-31Merge the main set of changes from team/russell/chan_console.Russell Bryant
Add a new console channel driver, chan_console, which is a console channel driver that uses portaudio as a cross platform audio interface. It was written to provide a console channel driver that works with Mac CoreAudio, but it supports a number of other audio interfaces, as well, including OSS and ALSA. It could one day be the single console channel driver, but does not yet have as many features as chan_oss. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@95412 65c4cc65-6c06-0410-ace0-fbb531ad65f3