aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-18Merged revisions 328609 via svnmerge from markm1-8/+23
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328609 | markm | 2011-07-18 08:37:53 -0400 (Mon, 18 Jul 2011) | 15 lines Merged revisions 328593 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328593 | markm | 2011-07-18 08:06:50 -0400 (Mon, 18 Jul 2011) | 8 lines Fixed invalid read and null pointer deref on asterisk shutdown. In some cases when starting asterisk with -c and hitting control-c to shutdown, there will be an invalid read and null pointer deref causing a crash. (closes issue ASTERISK-17927) Reported by: Mark Murawski Tested by: Mark Murawski, Kinsey Moore, Tilghman Lesher ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@328610 f38db490-d61c-443f-a65b-d21fe96a405b
2011-07-06Replace Berkeley DB with SQLite 3twilson1-5/+5
There were some bugs in the very ancient version of Berkeley DB that Asterisk used. Instead of spending the time tracking down the bugs in the Berkeley code we move to the much better documented SQLite 3. Conversion of the old astdb happens at runtime by running the included astdb2sqlite3 utility. The ast_db API with SQLite 3 backend should behave identically to the old Berkeley backend, but in the future we could offer a much more robust interface. We do not include the SQLite 3 library in the source tree, but instead rely upon the distribution-provided libraries. SQLite is so ubiquitous that this should not place undue burden on administrators. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@326589 f38db490-d61c-443f-a65b-d21fe96a405b
2011-06-27Merged revisions 324955 via svnmerge from tilghman1-2/+4
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r324955 | tilghman | 2011-06-27 11:30:50 -0500 (Mon, 27 Jun 2011) | 5 lines Save and restore errno from within signal handlers. This is recommended by the POSIX standard, as well as by the sigaction(2) manpage for various platforms that we support (e.g. Mac OS X). ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@324961 f38db490-d61c-443f-a65b-d21fe96a405b
2011-06-06Merged revisions 322069 via svnmerge from jrose1-1/+8
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r322069 | jrose | 2011-06-06 14:07:56 -0500 (Mon, 06 Jun 2011) | 8 lines Fixes level toggling for logger set levels since it was reversed (closes issue ASTERISK-17850) Reported by: Luke H Tested by: jrose, Luke H Review: https://reviewboard.asterisk.org/r/1244/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@322070 f38db490-d61c-443f-a65b-d21fe96a405b
2011-06-01Support routing text messages outside of a call.russell1-0/+5
Asterisk now has protocol independent support for processing text messages outside of a call. Messages are routed through the Asterisk dialplan. SIP MESSAGE and XMPP are currently supported. There are options in sip.conf and jabber.conf that enable these features. There is a new application, MessageSend(). There are two new functions, MESSAGE() and MESSAGE_DATA(). Documentation will be available on the project wiki, wiki.asterisk.org. Thanks to Terry Wilson for the assistance with development and to David Vossel for helping with some additional testing. Review: https://reviewboard.asterisk.org/r/1042/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@321546 f38db490-d61c-443f-a65b-d21fe96a405b
2011-05-05Add some new editline bindings by default, and allow for user specified ↵seanbright1-2/+20
configuration. I excluded the part of this patch that used the HOME environment variable since the built-in editline library goes to great lengths to disallow that. Instead only settings the EDITRC environment variable will use a user specified file. Also, the default environment variable use to determine the edit more is AST_EDITMODE instead of AST_EDITOR (although the latter is still supported). (closes issue #15929) Reported by: kkm Patches: astcli-editrc-v2.diff uploaded by kkm (license 888) 015929-astcli-editrc-trunk.240324.diff uploaded by kkm (license 888) Tested by: seanbright git-svn-id: http://svn.digium.com/svn/asterisk/trunk@317395 f38db490-d61c-443f-a65b-d21fe96a405b
2011-05-03Merged revisions 316265 via svnmerge from russell1-5/+4
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: http://svn.digium.com/svn/asterisk/trunk@316293 f38db490-d61c-443f-a65b-d21fe96a405b
2011-04-27Merged revisions 315810 via svnmerge from russell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r315810 | russell | 2011-04-27 10:55:48 -0500 (Wed, 27 Apr 2011) | 2 lines Set the copyright year to 2011 in the startup message. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@315811 f38db490-d61c-443f-a65b-d21fe96a405b
2011-04-01Merged revisions 312286,312288 via svnmerge from tilghman1-1/+5
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r312286 | tilghman | 2011-04-01 05:44:33 -0500 (Fri, 01 Apr 2011) | 2 lines Reload must react correctly against a possibly changed table, so dropping the conditional reload flag. ................ r312288 | tilghman | 2011-04-01 05:58:45 -0500 (Fri, 01 Apr 2011) | 21 lines Merged revisions 312287 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r312287 | tilghman | 2011-04-01 05:51:24 -0500 (Fri, 01 Apr 2011) | 14 lines Merged revisions 312285 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r312285 | tilghman | 2011-04-01 05:36:42 -0500 (Fri, 01 Apr 2011) | 7 lines Found some leaking file descriptors while looking at ast_FD_SETSIZE dead code. (issue #18969) Reported by: oej Patches: 20110315__issue18969__14.diff.txt uploaded by tilghman (license 14) ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@312289 f38db490-d61c-443f-a65b-d21fe96a405b
2011-03-05Merged revisions 309678 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r309678 | tilghman | 2011-03-05 04:29:30 -0600 (Sat, 05 Mar 2011) | 14 lines Merged revisions 309677 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r309677 | tilghman | 2011-03-05 04:28:24 -0600 (Sat, 05 Mar 2011) | 7 lines Missed part of the conversion when we started passing ppid to astcanary. (closes issue #18850) Reported by: viraptor Patches: canary_ppid.patch uploaded by viraptor (license 543) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@309679 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-22Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd ↵dvossel1-0/+3
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: http://svn.digium.com/svn/asterisk/trunk@308582 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-10Merged revisions 307536 via svnmerge from qwell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r307536 | qwell | 2011-02-10 16:39:30 -0600 (Thu, 10 Feb 2011) | 22 lines Merged revisions 307535 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r307535 | qwell | 2011-02-10 16:35:49 -0600 (Thu, 10 Feb 2011) | 15 lines Merged revisions 307534 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r307534 | qwell | 2011-02-10 16:33:09 -0600 (Thu, 10 Feb 2011) | 8 lines Remove color when executing commands via a remote console. Essentially this makes '-x' imply '-n' on rasterisk. This was done in a different and incomplete way previously, which I'm reverting here. (issue #18776) Reported by: alecdavis ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@307537 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-03Asterisk media architecture conversion - no more format bitfieldsdvossel1-0/+9
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: http://svn.digium.com/svn/asterisk/trunk@306010 f38db490-d61c-443f-a65b-d21fe96a405b
2010-12-29Remove some trailing whitespace and steal revision 300000.seanbright1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@300000 f38db490-d61c-443f-a65b-d21fe96a405b
2010-12-12Add support for several platforms to obtain the real thread ID.jpeeler1-1/+3
Already had the pthread ID which is not the same. The most obvious enhancement is in the "core show threads" output. As stated in the utils header, if the platform isn't supported -1 is reported (instead of the process ID previously). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@298137 f38db490-d61c-443f-a65b-d21fe96a405b
2010-11-30move devices from hints into an ao2_containerschmidts1-0/+1
by splitting up devices from hints into an own ao2_container the callback to get these devices for statechange handling is faster. with this changes the length of a device used in a hint isnt longer restricted to 80 characters. Tests showed that calling handle_statechange is 40 times faster if no hints are used and 25 times faster if there are any hints. (closes issue #17928) Reported by: mdu113 Tested by: schmidts Review: https://reviewboard.asterisk.org/r/1003/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@296752 f38db490-d61c-443f-a65b-d21fe96a405b
2010-11-29Merged revisions 296534 via svnmerge from tilghman1-1/+7
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r296534 | tilghman | 2010-11-29 01:28:44 -0600 (Mon, 29 Nov 2010) | 20 lines Merged revisions 296533 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r296533 | tilghman | 2010-11-29 01:27:09 -0600 (Mon, 29 Nov 2010) | 13 lines I love standards. There are so many to choose from. Except when there isn't one. Linux and *BSD disagree on the elements within the ucred structure. Detect which one is in use on the system. (closes issue #18384) Reported by: bjm Patches: cred-diffs uploaded by bjm (license 473) 20101127__issue18384__1.6.2.diff.txt uploaded by tilghman (license 14) 20101127__issue18384__1.8.diff.txt uploaded by tilghman (license 14) Tested by: tilghman, bjm ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@296535 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-08Merged revisions 290864 via svnmerge from jpeeler1-4/+5
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r290864 | jpeeler | 2010-10-07 21:56:24 -0500 (Thu, 07 Oct 2010) | 23 lines Merged revisions 290863 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r290863 | jpeeler | 2010-10-07 21:45:44 -0500 (Thu, 07 Oct 2010) | 16 lines Merged revisions 290862 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r290862 | jpeeler | 2010-10-07 21:35:29 -0500 (Thu, 07 Oct 2010) | 9 lines Ensure editline cleanup occurs when Ctrl-C is pressed at control console. A recent change was made to avoid a race condition on shutdown which only called the end functions from the console thread. However, when pressing Ctrl-C the quit handler is called from the signal handler thread. (closes issue #17698) Reported by: jmls ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@290865 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-22Merged revisions 288341 via svnmerge from russell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r288341 | russell | 2010-09-22 11:45:18 -0500 (Wed, 22 Sep 2010) | 25 lines Merged revisions 288340 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r288340 | russell | 2010-09-22 11:44:13 -0500 (Wed, 22 Sep 2010) | 18 lines Merged revisions 288339 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r288339 | russell | 2010-09-22 11:39:16 -0500 (Wed, 22 Sep 2010) | 11 lines Fix a 100% CPU consumption problem when setting console=yes in asterisk.conf. The handling of -c and console=yes should be the same, but they were not. When you specify -c, it sets both a flag for console module and for asterisk not to fork() off into the background. The handling of console=yes only set console mode, so you would end up with a background process() trying to run the Asterisk console and freaking out since it didn't have anything to read input from. Thanks to beagles for reporting and helping debug the problem! ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@288342 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-21Merged revisions 287935 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r287935 | tilghman | 2010-09-21 14:08:36 -0500 (Tue, 21 Sep 2010) | 16 lines Merged revisions 287934 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r287934 | tilghman | 2010-09-21 14:07:53 -0500 (Tue, 21 Sep 2010) | 9 lines Merged revisions 287933 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r287933 | tilghman | 2010-09-21 14:07:07 -0500 (Tue, 21 Sep 2010) | 2 lines Less than zero is an error, not any non-zero value. ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@287936 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-02Merged revisions 284597 via svnmerge from tilghman1-3/+43
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r284597 | tilghman | 2010-09-02 00:00:34 -0500 (Thu, 02 Sep 2010) | 29 lines Merged revisions 284593,284595 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r284593 | tilghman | 2010-09-01 17:59:50 -0500 (Wed, 01 Sep 2010) | 18 lines Merged revisions 284478 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r284478 | tilghman | 2010-09-01 13:49:11 -0500 (Wed, 01 Sep 2010) | 11 lines Ensure that all areas that previously used select(2) now use poll(2), with implementations that need poll(2) implemented with select(2) safe against 1024-bit overflows. This is a followup to the fix for the pthread timer in 1.6.2 and beyond, fixing a potential crash bug in all supported releases. (closes issue #17678) Reported by: russell Branch: https://origsvn.digium.com/svn/asterisk/team/tilghman/ast_select Review: https://reviewboard.asterisk.org/r/824/ ........ ................ r284595 | tilghman | 2010-09-01 22:57:43 -0500 (Wed, 01 Sep 2010) | 2 lines Failed to rerun bootstrap.sh after last commit ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@284598 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-23Merged revisions 278981 via svnmerge from tilghman1-6/+13
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r278981 | tilghman | 2010-07-23 11:42:25 -0500 (Fri, 23 Jul 2010) | 8 lines Avoid race with consolethread on shutdown (on parallel processors). (closes issue #17080) Reported by: sybasesql Patches: 20100721__issue17080.diff.txt uploaded by tilghman (license 14) Tested by: sybasesql ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278982 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-20Add load priority order, such that preload becomes unnecessary in most casestilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278132 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-28Merged revisions 272925 via svnmerge from tilghman1-4/+8
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r272925 | tilghman | 2010-06-28 16:50:02 -0500 (Mon, 28 Jun 2010) | 8 lines Don't change ownership/group/permissions on run directory, if it already exists. (closes issue #17076) Reported by: stuarth Patches: 20100324__issue17076.diff.txt uploaded by tilghman (license 14) Tested by: stuarth ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@272926 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-10Merged revisions 269635 via svnmerge from tilghman1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r269635 | tilghman | 2010-06-10 02:52:34 -0500 (Thu, 10 Jun 2010) | 9 lines Ensure restartable system calls can restart (BSD signal semantics). This eliminates the annoying <beep> on the console. (closes issue #17477) Reported by: jvandal Patches: 20100610__issue17477.diff.txt uploaded by tilghman (license 14) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@269636 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-02Generic Advice of Charge.rmudgett1-0/+3
Asterisk Generic AOC Representation - Generic AOC encode/decode routines. (Generic AOC must be encoded to be passed on the wire in the AST_CONTROL_AOC frame) - AST_CONTROL_AOC frame type to represent generic encoded AOC data - Manager events for AOC-S, AOC-D, and AOC-E messages Asterisk App Support - app_dial AOC-S pass-through support on call setup - app_queue AOC-S pass-through support on call setup AOC Unit Tests - AOC Unit Tests for encode/decode routines - AOC Unit Test for manager event representation. SIP AOC Support - Pass-through of generic AOC-D and AOC-E messages to snom phones via the snom AOC specification. - Creation of chan_sip page3 flags for the addition of the new 'snom_aoc_enabled' sip.conf option. IAX AOC Support - Natively supports AOC pass-through through the use of the new AST_CONTROL_AOC frame type DAHDI AOC Support - ETSI PRI full AOC Pass-through support - 'aoc_enable' chan_dahdi.conf option for independently enabling pass-through of AOC-S, AOC-D, AOC-E. - 'aoce_delayhangup' option for retrieving AOC-E on disconnect. - DAHDI A() dial string option for requesting AOC services. example usage: ;requests AOC-S, AOC-D, and AOC-E on call setup exten=>1111,1,Dial(DAHDI/g1/1112/A(s,d,e)) Review: https://reviewboard.asterisk.org/r/552/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@267096 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-01Merged revisions 266585 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r266585 | tilghman | 2010-06-01 10:17:46 -0500 (Tue, 01 Jun 2010) | 11 lines Prevent CLI prompt from distorting output of lines shorter than the prompt. Uses the VT100 method of clearing the line from the cursor position to the end of the line: Esc-0K (closes issue #17160) Reported by: coolmig Patches: 20100531__issue17160.diff.txt uploaded by tilghman (license 14) Tested by: coolmig ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@266592 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-28Setup environment variables for the benefit of child processes and disallow ↵tilghman1-0/+13
changing them. (closes issue #14899) Reported by: jmls Patches: 20090916__issue14899.diff.txt uploaded by tilghman (license 14) Tested by: jmls git-svn-id: http://svn.digium.com/svn/asterisk/trunk@266385 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-28Only report swap on platforms which can examine those statisticstilghman1-2/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@266337 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-26Merged revisions 266142 via svnmerge from tilghman1-18/+37
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r266142 | tilghman | 2010-05-26 16:11:44 -0500 (Wed, 26 May 2010) | 14 lines Use sigaction for signals which should persist past the initial trigger, not signal. If you call signal() in a Solaris signal handler, instead of just resetting the signal handler, it causes the signal to refire, because the signal is not marked as handled prior to the signal handler being called. This effectively causes Solaris to immediately exceed the threadstack in recursive signal handlers and crash. (closes issue #17000) Reported by: rmcgilvr Patches: 20100526__issue17000.diff.txt uploaded by tilghman (license 14) Tested by: rmcgilvr ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@266146 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-24Merge the rest of the FullyBooted patchtwilson1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@265467 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-24On systems with a LOT of RAM, a signed integer sometimes printed negative.tilghman1-10/+11
(closes issue #16837) Reported by: jlpedrosa Patches: 20100504__issue16837.diff.txt uploaded by tilghman (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@265316 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-19Fix transcode_via_sln option with SIP calls and improve PLC usage.mmichelson1-0/+1
From reviewboard: The problem here is a bit complex, so try to bear with me... It was noticed by a Digium customer that generic PLC (as configured in codecs.conf) did not appear to actually be having any sort of benefit when packet loss was introduced on an RTP stream. I reproduced this issue myself by streaming a file across an RTP stream and dropping approx. 5% of the RTP packets. I saw no real difference between when PLC was enabled or disabled when using wireshark to analyze the RTP streams. After analyzing what was going on, it became clear that one of the problems faced was that when running my tests, the translation paths were being set up in such a way that PLC could not possibly work as expected. To illustrate, if packets are lost on channel A's read stream, then we expect that PLC will be applied to channel B's write stream. The problem is that generic PLC can only be done when there is a translation path that moves from some codec to SLINEAR. When I would run my tests, I found that every single time, read and write translation paths would be set up on channel A instead of channel B. There appeared to be no real way to predict which channel the translation paths would be set up on. This is where Kevin swooped in to let me know about the transcode_via_sln option in asterisk.conf. It is supposed to work by placing a read translation path on both channels from the channel's rawreadformat to SLINEAR. It also will place a write translation path on both channels from SLINEAR to the channel's rawwriteformat. Using this option allows one to predictably set up translation paths on all channels. There are two problems with this, though. First and foremost, the transcode_via_sln option did not appear to be working properly when I was placing a SIP call between two endpoints which did not share any common formats. Second, even if this option were to work, for PLC to be applied, there had to be a write translation path that would go from some format to SLINEAR. It would not work properly if the starting format of translation was SLINEAR. The one-line change presented in this review request in chan_sip.c fixed the first issue for me. The problem was that in sip_request_call, the jointcapability of the outbound channel was being set to the format passed to sip_request_call. This is nativeformats of the inbound channel. Because of this, when ast_channel_make_compatible was called by app_dial, both channels already had compatibly read and write formats. Thus, no translation path was set up at the time. My change is to set the jointcapability of the sip_pvt created during sip_request_call to the intersection of the inbound channel's nativeformats and the configured peer capability that we determined during the earlier call to create_addr. Doing this got the translation paths set up as expected when using transcode_via_sln. The changes presented in channel.c fixed the second issue for me. First and foremost, when Asterisk is started, we'll read codecs.conf to see the value of the genericplc option. If this option is set, and ast_write is called for a frame with no data, then we will attempt to fill in the missing samples for the frame. The implementation uses a channel datastore for maintaining the PLC state and for creating a buffer to store PLC samples in. Even when we receive a frame with data, we'll call plc_rx so that the PLC state will have knowledge of the previous voice frame, which it can use as a basis for when it comes time to actually do a PLC fill-in. So, reviewers, now I ask for your help. First off, there's the one line change in chan_sip that I have put in. Is it right? By my logic it seems correct, but I'm sure someone can tell me why it is not going to work. This is probably the change I'm least concerned about, though. What concerns me much more is the set of changes in channel.c. First off, am I even doing it right? When I run tests, I can clearly see that when PLC is activated, I see a significant increase in RTP traffic where I would expect it to be. However, in my humble opinion, the audio sounds kind of crappy whenever the PLC fill-in is done. It sounds worse to me than when no PLC is used at all. I need someone to review the logic I have used to be sure that I'm not misusing anything. As far as I can see my pointer arithmetic is correct, and my use of AST_FRIENDLY_OFFSET should be correct as well, but I'm sure someone can point out somewhere where I've done something incorrectly. As I was writing this review request up, I decided to give the code a test run under valgrind, and I find that for some reason, calls to plc_rx are causing some invalid reads. Apparently I'm reading past the end of a buffer somehow. I'll have to dig around a bit to see why that is the case. If it's obvious to someone reviewing, speak up! Finally, I have one other proposal that is not reflected in my code review. Since without transcode_via_sln set, one cannot predict or control where a translation path will be up, it seems to me that the current practice of using PLC only when transcoding to SLINEAR is not useful. I recommend that once it has been determined that the method used in this code review is correct and works as expected, then the code in translate.c that invokes PLC should be removed. Review: https://reviewboard.asterisk.org/r/622/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@264452 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-22Asterisk data retrieval API.eliel1-0/+6
This module implements an abstraction for retrieving and exporting asterisk data. Developed by: Brett Bryant <brettbryant@gmail.com> Eliel C. Sardanons (LU1ALY) <eliels@gmail.com> For the Google Summer of code 2009 Project. Documentation can be found in doxygen format and inside the header include/asterisk/data.h Review: https://reviewboard.asterisk.org/r/275/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258517 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-09Merge Call completion support into trunk.mmichelson1-0/+6
From Reviewboard: CCSS stands for Call Completion Supplementary Services. An admittedly out-of-date overview of the architecture can be found in the file doc/CCSS_architecture.pdf in the CCSS branch. Off the top of my head, the big differences between what is implemented and what is in the document are as follows: 1. We did not end up modifying the Hangup application at all. 2. The document states that a single call completion monitor may be used across multiple calls to the same device. This proved to not be such a good idea when implementing protocol-specific monitors, and so we ended up using one monitor per-device per-call. 3. There are some configuration options which were conceived after the document was written. These are documented in the ccss.conf.sample that is on this review request. For some basic understanding of terminology used throughout this code, see the ccss.tex document that is on this review. This implements CCBS and CCNR in several flavors. First up is a "generic" implementation, which can work over any channel technology provided that the channel technology can accurately report device state. Call completion is requested using the dialplan application CallCompletionRequest and can be canceled using CallCompletionCancel. Device state subscriptions are used in order to monitor the state of called parties. Next, there is a SIP-specific implementation of call completion. This method uses the methods outlined in draft-ietf-bliss-call-completion-06 to implement call completion using SIP signaling. There are a few things to note here: * The agent/monitor terminology used throughout Asterisk sometimes is the reverse of what is defined in the referenced draft. * Implementation of the draft required support for SIP PUBLISH. I attempted to write this in a generic-enough fashion such that if someone were to want to write PUBLISH support for other event packages, such as dialog-state or presence, most of the effort would be in writing callbacks specific to the event package. * A subportion of supporting PUBLISH reception was that we had to implement a PIDF parser. The PIDF support added is a bit minimal. I first wrote a validation routine to ensure that the PIDF document is formatted properly. The rest of the PIDF reading is done in-line in the call-completion-specific PUBLISH-handling code. In other words, while there is PIDF support here, it is not in any state where it could easily be applied to other event packages as is. Finally, there are a variety of ISDN-related call completion protocols supported. These were written by Richard Mudgett, and as such I can't really say much about their implementation. There are notes in the CHANGES file that indicate the ISDN protocols over which call completion is supported. Review: https://reviewboard.asterisk.org/r/523 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256528 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-02Pass the PID of the Asterisk process, not the PID of the canary.tilghman1-1/+1
(closes issue #17065) Reported by: globalnetinc Patches: astcanary.patch uploaded by makoto (license 38) Tested by: frawd, globalnetinc git-svn-id: http://svn.digium.com/svn/asterisk/trunk@255952 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-23make 'core show settings' should show all settable directoriestzafrir1-0/+7
(closes issue #17086) Reported by: tzafrir Patches: asterisk_extra_settings_dirs.diff uploaded by tzafrir (license 46) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254162 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-22Initialize channels prior to loading "preload" modules.mmichelson1-2/+2
We can have bad results when a module, upon being loaded, attempts to reference the channels container if the container hasn't yet been initialized. I saw this happen by trying to preload pbx_config.so and having a hint defined which referenced a non-existent SIP peer. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253872 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-18Update comment to reflect new timeout value.russell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253378 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-18Increase CLI command output timeout for asterisk -rx to 60 seconds.russell1-1/+1
(closes issue #17049) Reported by: russell Tested by: russell Review: https://reviewboard.asterisk.org/r/573/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253357 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-15Merged revisions 252361 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r252361 | tilghman | 2010-03-14 20:33:50 -0500 (Sun, 14 Mar 2010) | 4 lines Launch Asterisk on Mac OS X with launchd. Reviewboard: https://reviewboard.asterisk.org/r/551/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252362 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-25Merged revisions 248859 via svnmerge from tilghman1-0/+12
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r248859 | tilghman | 2010-02-25 15:21:05 -0600 (Thu, 25 Feb 2010) | 15 lines Some platforms clear /var/run at boot, which makes connecting a remote console... difficult. Previously, we only created the default /var/run/asterisk directory at install time. While we could create it in the init script, that would not work for those who start asterisk manually from the command line. So the safest thing to do is to create it as part of the Asterisk boot process. This also changes the ownership of the directory, because the pid and ctl files are created after we setuid/setgid. (closes issue #16802) Reported by: Brian Patches: 20100224__issue16802.diff.txt uploaded by tilghman (license 14) Tested by: tzafrir ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@248861 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-05Merged revisions 244926 via svnmerge from seanbright1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r244926 | seanbright | 2010-02-05 12:03:35 -0500 (Fri, 05 Feb 2010) | 1 line Update main copyright date. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@244927 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-27Add new option to asterisk.conf (lockconfdir) to protect conf dir during reloadsjpeeler1-0/+2
(closes issue #16358) Reported by: raarts Patches: lockconfdir.diff uploaded by raarts (license 937) modified by me git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243551 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-15Err, oops, it was already the way I intended.tilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240629 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-15The previous attempt at using a pipe to guarantee astcanary shutdown did not ↵tilghman1-16/+4
work. We're revisiting the previous patch, albeit with a method that overcomes the prior criticism that it was not POSIX-compliant. (closes issue #16602) Reported by: frawd Patches: 20100114__issue16602.diff.txt uploaded by tilghman (license 14) Tested by: frawd git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240499 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-10It's been long enough -- make the behavior introduced in 1.6 the default.tilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239000 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-22Unit Test Framework APIdvossel1-0/+8
The Unit Test Framework is a new API that manages registration and execution of unit tests in Asterisk with the purpose of verifying the operation of C functions. The Framework consists of a single test manager accompanied by a list of registered test functions defined within the code. A test is defined, registered, and unregistered from the framework using a set of macros which allow the test code to only be compiled within asterisk when the TEST_FRAMEWORK flag is enabled in menuselect. This allows the test code to exist in the same file as the C functions it intends to verify. Registered tests may be viewed and executed via a set of new CLI commands. CLI commands are also present for generating and exporting test results into xml and txt formats. For more information and use cases please refer to the documentation provided at the beginning of the test.h file. Review: https://reviewboard.asterisk.org/r/447/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236027 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02Add an 'X' option to the asterisk application which enables #exec for ↵file1-1/+5
configuration files. This option can be used to enable #exec support in the asterisk.conf configuration file. (closes issue #16260) Reported by: atis Patches: exec_includes.patch uploaded by atis (license 242) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232510 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-26Reorder option flags. Change guidelines so that example code is consistent ↵tilghman1-55/+60
with guidelines git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231369 f38db490-d61c-443f-a65b-d21fe96a405b