aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
AgeCommit message (Collapse)AuthorFilesLines
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-4516/+0
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-19suppress warnings introduced by putting states in an enumrussell1-0/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40489 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-19convert lists of constants in channel.h to enums instead of #definesrussell1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40424 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-17Merged revisions 40227 via svnmerge from russell1-1/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r40227 | russell | 2006-08-17 12:36:21 -0400 (Thu, 17 Aug 2006) | 3 lines revert bogus change to attempt to fix bug 7506 which actually causes half of the channels not to get "Newchannel" events at all (issue #7745) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40228 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-15Make tonepair generated through fixed pointmarkster1-14/+37
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39886 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-08Merge team/russell/ast_verbose_threadstoragerussell1-22/+4
- instead of defining a free() wrapper in a bunch of files, define it as ast_free() in utils.h and remove the copies from all the files. - centralize and abstract the code used for doing thread storage. The code lives in threadstorage.h, with one function being implemented in utils.c. This new API includes generic thread storage as well as special functions for handling thread local dynamic length string buffers. - update ast_inet_ntoa() to use the new threadstorage API - update ast_state2str() to use the new threadstorage API - update ast_cli() to use the new threadstorage API - Modify manager_event() to use thread storage. Instead of using a buffer of 4096 characters as the workspace for building the manager event, use a thread local dynamic string. Now there is no length limitation on the length of the body of a manager event. - Significantly simplify the handling of ast_verbose() ... - Instead of using a static char buffer and a lock to make sure only one thread can be using ast_verbose() at a time, use a thread local dynamic string as the workspace for preparing the verbose message. Instead of locking around the entire function, the only locking done now is when the message has been built and is being deliviered to the list of registered verbose message handlers. - This function was doing a strdup() on every message passed to it and keeping a queue of the last 200 messages in memory. This has been completely removed. The only place this was used was that if there were any messages in the verbose queue when a verbose handler was registered, all of the messages in the queue would be fed to it. So, I just made sure that the console verbose handler and the network verbose handler (for remote asterisk consoles) were registered before any verbose messages. pbx_gtkconsole and pbx_kdeconsole will now lose a few verbose messages at startup, but I didn't feel the performance hit of this message queue was worth saving the initial verbose output for these very rarely used modules. - I have removed the last three arguments to the verbose handlers, leaving only the string itself because they aren't needed anymore. For example, ast_verbose had some logic for telling the verbose handler to add a newline if the buffer was completely full. Now that the buffer can grow as needed, this doesn't matter anymore. - remove unused function, ast_verbose_dmesg() which was to dispatch the message queue - Convert the list of verbose handlers to use the linked list macros. - add missing newline characters to a few ast_verbose() calls - convert the list of log channels to use the linked list macros in logger.c - fix close_logger() to close all of the files it opened for logging - update ast_log() to use a thread local dynamic string for its workspace for preparing log messages instead of a buffer of size BUFSIZ (8kB on my system) allocated on the stack. The dynamic string in this case is limited to only growing to a maximum size of BUFSIZ. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39272 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-07Merged revisions 39056 via svnmerge from file1-2/+8
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r39056 | file | 2006-08-06 20:15:51 -0400 (Sun, 06 Aug 2006) | 2 lines Reset our stream and vstream pointers back to NULL so that any generator that uses them (file based MOH) will not try to close them again. (issue #7668 reported by jmls) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39057 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-05- add DIALING_OFFHOOK and PRERING to ast_state2strrussell1-1/+5
- don't include a newline character when building a response for an unknown state (issue #7645, jonty) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39032 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-05Merged revisions 38982 via svnmerge from russell1-2/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38982 | russell | 2006-08-05 05:01:37 -0400 (Sat, 05 Aug 2006) | 6 lines Always generate a Newstate event in ast_setstate() instead of making it a Newchannel event if the state was AST_STATE_DOWN. The Newchannel event will always be generated in ast_request(), so this just causes a duplicated Newchannel event in some cases. (issue #7506, repoted by capouch, fixed by me) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38994 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-05Merged revisions 38903-38904 via svnmerge from russell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38903 | russell | 2006-08-05 01:07:39 -0400 (Sat, 05 Aug 2006) | 2 lines suppress a compiler warning about the usage of a potentially uninitialized variable ........ r38904 | russell | 2006-08-05 01:08:50 -0400 (Sat, 05 Aug 2006) | 10 lines Fix an issue that would cause a NewCallerID manager event to be generated before the channel's NewChannel event. This was due to a somewhat recent change that included using ast_set_callerid() where it wasn't before. This function should not be used in the channel driver "new" functions. (issue #7654, fixed by me) Also, fix a couple minor bugs in usecount handling. chan_iax2 could have increased the usecount but then returned an error. The place where chan_sip increased the usecount did not call ast_update_usecount() ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38905 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-01Merged revisions 38686 via svnmerge from kpfleming1-4/+11
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38686 | kpfleming | 2006-08-01 18:07:06 -0500 (Tue, 01 Aug 2006) | 2 lines ensure that the 'feature digit timeout' value is taken into account when deciding how long the bridge should run (this fixes a problem report where a digit press that did not invoke a feature is never passed across the bridge) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38687 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-28add ExtenSpy variant of ChanSpykpfleming1-5/+13
implement whisper mode for ExtenSpy/ChanSpy git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38465 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-28just for fun, let's lock the whisper buffer for writing AND reading :-)kpfleming1-0/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38441 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-28move slinfactory structure definition back to header... it's just easier to ↵kpfleming1-4/+82
use this way add infrastructure for whispering onto a channel git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38422 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27more simplification, and correct a bug i introduced in the last commitkpfleming1-1/+2
fix prototype for a channel walking function to use a const input pointer use existing channel walk by name prefix instead of reproducing that code in this app git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38389 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27Merged revisions 38347 via svnmerge from kpfleming1-4/+7
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38347 | kpfleming | 2006-07-27 10:40:03 -0500 (Thu, 27 Jul 2006) | 2 lines do a better job avoiding translation path teardown/setup when not needed ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38348 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27Merged revisions 38310 via svnmerge from kpfleming1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38310 | kpfleming | 2006-07-26 21:43:49 -0500 (Wed, 26 Jul 2006) | 2 lines don't do useless translation destroy/build when the channel is already in the correct format ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38311 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27fix crashes with MALLOC_DEBUG enabled that were a result of my recent threadrussell1-1/+9
storage changes (fixes issue #7595) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38286 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23ast_malloc is sufficient here, since snprintf is called on the bufferrussell1-1/+1
immediately after it gets allocated, which will automatically NULL terminate the string git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38129 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23resolve another XXX comment by implementing proper handling of control framesrussell1-2/+2
in ast_write(), which is to call the channel's indicate function if it exists git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38117 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-21make ast_state2str thread safe by using thread local storage instead of arussell1-6/+19
static buffer for storing the result when the state value is unknown git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38060 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-19merge Russell's 'hold_handling' branch, finally implementing music-on-hold ↵kpfleming1-7/+9
handling the way it was decided at AstriDevCon Europe 2006 (and the way people really want it to be) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37988 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-12G726-32 changes:kpfleming1-1/+3
split support for G726-32 into RFC3551 and AAL2 packing orders, since both are in use change "G726-32" to be RFC3551 packing order, in spite of devices that use AAL2 order with this MIME type add ability to directly transcode between packing orders git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37494 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-10Merged revisions 37361 via svnmerge from kpfleming1-8/+28
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r37361 | kpfleming | 2006-07-10 16:01:35 -0500 (Mon, 10 Jul 2006) | 2 lines do masquerade-behind-proxy checking with better control over locks ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37362 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-06patch resolves issue with when to decide if its right time mogorman1-1/+2
to native bridge, feature redirect was not being checked. patch from bug #7296 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37223 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-05prepare Asterisk for new zaptel.h/tonezone.h installation locationskpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37027 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-24The Eurostar Commit! (it's amazing how much work you can get done on a 150 ↵kpfleming1-7/+0
minute train ride from Paris to London <G>) support the new location for zaptel.h and tonezone.h use the dependency information output by menuselect to build Makefile rules for each module for header files and libraries combine the common rules into a top-level Makefile.rules file remove all (now) unnecessary stuff from subdir Makefiles change translator API so that the newpvt() callback returns an int instead of a pointer (it no longer allocates memory) alphabetize --with-<foo> options in configure script enhance Net-SNMP support in configure script to provide a --with-netsnmp option fix support for --with-pq so that if pg-config is not found when --with-pq is specified, an error will be generated add 'optional package' usage to modules now that menuselect can output it allow res_snmp to build by default, since the new loader changes coming soon will solve the function naming problem (and users can disable it via menuselect anyway) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@35832 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-23revert my changes that converted the jb on the channel to be dynamicallyrussell1-2/+1
allocated. These changes caused crashes when using a channel type that did not support the jitterbuffer. Instead of fixing why it's crashing, I'm going to implement this in a better way next week. The way I did it caused a jitterbuffer to be allocated on every channel where the channel type supported jitterbuffers, even if they were disabled. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@35746 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-22don't blow up if a jitterbuffer is not in userussell1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@35555 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-13adds support for t38 pass through patch brought up to trunk frommogorman1-0/+4
bug 5090 by josh colp. Thanks to everyone who help get this patch through especially to the author Steven Underwood. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33890 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-12Merged revisions 33724 via svnmerge from file1-1/+14
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r33724 | file | 2006-06-12 18:34:38 -0300 (Mon, 12 Jun 2006) | 2 lines Greatly simply the mixmonitor thread, and move channel reference directly to spy structure so that the core can modify it. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33725 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07simplify autoconfig include mechanism (make tholo happy he can use lint ↵kpfleming1-5/+5
again :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32846 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-06Merge of the "sdpcleanup" branch. Thanks to John Martin for a lot of testsoej1-4/+7
and some patches (all disclaimed). - Don't change RTP properties if we reject a re-INVITE - Don't add video to an outbound channel if there's no video on the inbound channel - Don't include video in the "preferred codec" list for codec selection - Clean up and document code that parses and adds SDP attachments Since we do not transcode video, we can't handle video the same way as audio. This is a bug fix patch. In future releases, we need to work on a solution for video negotiation, not codecs but formats and framerates instead. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32597 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-06fix a channel deadlock in ast_answerrussell1-1/+3
(deadlock reported by and debuged with hads on #asterisk-dev on IRC) (probably fixes issue #7267, maybe others) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32478 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-04- 5 is the highest used debug level, so let's stay thereoej1-1/+1
- Change formatting of RTP debug to align better git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32088 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-03 Make sure DEBUG is really cranked up before we decide to flood the logs ↵bweschke1-1/+1
with messages about Internal timing when a channel has to make a decision about generating internal timing (eg - MOH) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31840 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-01Merged revisions 31520 via svnmerge from kpfleming1-0/+8
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r31520 | kpfleming | 2006-06-01 15:27:50 -0500 (Thu, 01 Jun 2006) | 2 lines handle Zap transfers behind chan_agent properly so the agent doesn't get stuck waiting for the call to hang up ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31522 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-31Add support for using a jitterbuffer for RTP on bridged calls. This includesrussell1-3/+26
a new implementation of a fixed size jitterbuffer, as well as support for the existing adaptive jitterbuffer implementation. (issue #3854, Slav Klenov) Thank you very much to Slav Klenov of Securax and all of the people involved in the testing of this feature for all of your hard work! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31052 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-31a few more control frame types that don't need to generate useless notices ↵kpfleming1-1/+6
in the log git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31044 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-25Merge in branch which gives you the ability to set the hangup causecode ↵file1-44/+57
using the Hangup application. (issue #7160 reported by kmilitzer branch by jcollie) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30390 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-16Merged revisions 27468 via svnmerge from kpfleming1-0/+3
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r27468 | kpfleming | 2006-05-16 15:05:17 -0500 (Tue, 16 May 2006) | 2 lines don't leak frames when deferring DTMF or dropping duplicate ANSWER frames (issue #7041, slightly different fix, reported/patched by clausf) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@27477 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-11use the proper method to get out of the bridge loopkpfleming1-5/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26851 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-11initialize the bridge result to 'no result', so that we can check for code ↵kpfleming1-2/+2
paths that set it to AST_BRIDGE_COMPLETE inside the loop (thanks Oskar!) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26849 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-10remove almost all of the checks of the result from ast_strdupa() or alloca().russell1-7/+2
As it turns out, all of these checks were useless, because alloca will never return NULL. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26451 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-10ensure that control frames with payload can be sent to channel drivers via ↵kpfleming1-5/+15
->indicate() update iax2_indicate to pass control frame payload to the connected channel add an API call for sending an indication with payload, and use it for control frames with payload git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26417 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-09Make sure that we don't accept an answer on an inbound call and don't permit ↵markster1-5/+14
asterisk to answer an outbound call git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26103 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-09use an enum for control frame typeskpfleming1-1/+16
support sending control frames with payload git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26093 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-09mark a couple of dubious pieces of coderizzo1-0/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25894 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-08Minor cleanup on dtmf calling (bug #7076)markster1-2/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25567 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-05 Make the "Avoided Initial Deadlock for '....', X retries!" a LOG_DEBUG msg ↵bweschke1-1/+1
instead of LOG_WARNING as this only has relevance to developers trying to resolve a possible problem. #6949 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25094 f38db490-d61c-443f-a65b-d21fe96a405b