Commit Graph

87 Commits

Author SHA1 Message Date
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Kevin P. Fleming edc78d6023 improve linked-list macros in two ways:
- the *_CURRENT macros no longer need the list head pointer argument
  - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 05:28:47 +00:00
Russell Bryant d78463be1e Corydon posted this janitor project to the bug tracker and mvanbaak provided
a patch for it.  It replaces a bunch of simple calls to snprintf with ast_copy_string

(closes issue #10843)
Reported by: Corydon76
Patches: 
      2007092900_10843.diff uploaded by mvanbaak (license 7)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 15:23:19 +00:00
Joshua Colp 5af36757cd Initialize iax_frames variable to NULL, keeps valgrind happy.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81814 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 21:01:10 +00:00
Steve Murphy b5cd67adc3 This code was in team/murf/bug8684-trunk; it should fix bug 8684 in trunk. I didn't add it to 1.4 yet, because it's not entirely clear to me if this is a bug fix or an enhancement. A lot of files were affected by small changes like ast_variable_new getting an added arg, for the file name the var was defined in; ast_category_new gets added args of filename and lineno; ast_category and ast_variable structures now record file and lineno for each entry; a list of all #include and #execs in a config file (or any of its inclusions are now kept in the ast_config struct; at save time, each entry is put back into its proper file of origin, in order. #include and #exec directives are folded in properly. Headers indicating that the file was generated, are generated also for each included file. Some changes to main/manager.c to take care of file renaming, via the UpdateConfig command. Multiple inclusions of the same file are handled by exploding these into multiple include files, uniquely named. There's probably more, but I can't remember it right now.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-29 20:55:40 +00:00
Tilghman Lesher 81bc1d7af5 Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 19:47:20 +00:00
Russell Bryant b5ff588044 Merged revisions 75445 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r75445 | russell | 2007-07-17 15:48:21 -0500 (Tue, 17 Jul 2007) | 13 lines

Merged revisions 75444 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75444 | russell | 2007-07-17 15:45:27 -0500 (Tue, 17 Jul 2007) | 5 lines

Ensure that when encoding the contents of an ast_frame into an iax_frame, that
the size of the destination buffer is known in the iax_frame so that code
won't write past the end of the allocated buffer when sending outgoing frames.
(ASA-2007-014)

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:49:09 +00:00
Joshua Colp d127d4b7e3 Merged revisions 69184 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r69184 | file | 2007-06-13 15:58:59 -0400 (Wed, 13 Jun 2007) | 2 lines

Add TXMEDIA to list so that it is properly displayed during iax2 packet output.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 20:00:56 +00:00
Tilghman Lesher 9d05ff8ed5 Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 21:20:11 +00:00
Russell Bryant b94378b5e6 Merge changes from team/russell/iax2_osp
This set of changes adds OSP support to chan_iax2.  However, I have modified
the patch a bit from what was submitted.  You now use the CHANNEL() function
to get and set the OSP token for IAX2.

(issue #8531, reported by and original patch by homesick, patch updated by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20 21:12:53 +00:00
Joshua Colp 2874a4317d Merged revisions 59076 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r59076 | file | 2007-03-20 16:42:46 -0400 (Tue, 20 Mar 2007) | 2 lines

Copy len variable as well, should fix remaining IAX2 DTMF issues.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-20 20:44:58 +00:00
Tilghman Lesher 3d91c0a0c0 IAX2 remote variables - Bug 7619
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 08:38:59 +00:00
Kevin P. Fleming c5c17a1434 Merged revisions 49536 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49536 | kpfleming | 2007-01-04 15:58:42 -0600 (Thu, 04 Jan 2007) | 2 lines

don't mark these allocations as 'cache' allocations when caching has been disabled

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 21:59:06 +00:00
Kevin P. Fleming 7f2e9cd62c Merged revisions 49523 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49523 | kpfleming | 2007-01-04 15:06:02 -0600 (Thu, 04 Jan 2007) | 2 lines

if we're going to decrement the frame count when we free a frame, we should inrement it when we create one :-)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 21:06:35 +00:00
Kevin P. Fleming d6d713c84f Merged revisions 49465 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49465 | kpfleming | 2007-01-04 12:31:55 -0600 (Thu, 04 Jan 2007) | 2 lines

only do IAX2 frame caching for voice and video frames

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 18:32:23 +00:00
Kevin P. Fleming ec2ae45651 Merged revisions 49457,49460-49461 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49457 | kpfleming | 2007-01-04 12:05:47 -0600 (Thu, 04 Jan 2007) | 2 lines

make building of codec_gsm against the system GSM library actually work

........
r49460 | kpfleming | 2007-01-04 12:16:40 -0600 (Thu, 04 Jan 2007) | 2 lines

don't define this type either if LOW_MEMORY is enabled

........
r49461 | kpfleming | 2007-01-04 12:17:01 -0600 (Thu, 04 Jan 2007) | 2 lines

don't do frame header caching in the core if LOW_MEMORY is defined

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 18:19:55 +00:00
Matt O'Gorman c6b43cf285 Merged revisions 49458 via svnmerge from
https://svn.digium.com/svn/asterisk/branches/1.4

........
r49458 | kpfleming | 2007-01-04 12:06:51 -0600 (Thu, 04 Jan 2007) | 2 lines

don't do frame caching in LOW_MEMORY mode

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 18:17:24 +00:00
Kevin P. Fleming d68c7c8ce6 Merged revisions 48987 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48987 | kpfleming | 2006-12-27 12:29:13 -0600 (Wed, 27 Dec 2006) | 2 lines

allow 'show memory' and 'show memory summary' to distinguish memory allocations that were done for caching purposes, so they don't look like memory leaks

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 18:33:44 +00:00
Russell Bryant bd53e7ee4c Extend the thread storage API such that a custom initialization function can
be called for each thread specific object after they are allocated.  Note that
there was already the ability to define a custom cleanup function.  Also, if
the custom cleanup function is used, it *MUST* call free on the thread
specific object at the end.  There is no way to have this magically done that
I can think of because the cleanup function registered with the pthread
implementation will only call the function back with a pointer to the
thread specific object, not the parent ast_threadstorage object.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19 01:00:57 +00:00
Russell Bryant 7dfc749551 there is no need for __iax_frame_free ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-31 21:50:07 +00:00
Russell Bryant 0c6932eeb4 there is no need to use iax_frame_free here, as it will actually just end up
having a bunch of erroneous messages about attempting to double free frames
spammed to the console.  Problem reported to me by file ...


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-31 20:39:12 +00:00
Joshua Colp c6977b9983 Merge in VLDTMF support with Zaptel/Core done by the ever great Darumkilla Russell Bryant and the RTP portion done by myself, Muffinlicious Joshua Colp. This has gone through so many discussions/revisions it's not funny but we finally have it!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-31 01:59:02 +00:00
Russell Bryant f7e7161607 Merge team/russell/frame_caching
There are some situations in Asterisk where ast_frame and/or iax_frame
structures are rapidly allocatted and freed (at least 50 times per second
for one call).

This code significantly improves the performance of ast_frame_header_new(), 
ast_frdup(), ast_frfree(), iax_frame_new(), and iax_frame_free() by keeping
a thread-local cache of these structures and using frames from the cache 
whenever possible instead of calling malloc/free every time.

This commit also converts the ast_frame and iax_frame structures to use the
linked list macros.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-29 20:50:36 +00:00
Russell Bryant 93682ec72e make the counting of ingress, outgress, and total frames thread-safe
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-31 17:27:42 +00:00
Russell Bryant ca9ba719b6 Merge a new implementation of ast_inet_ntoa, our thread safe replacement for
inet_ntoa, which uses thread specific data (aka thread local storage) instead
of stack allocatted buffers to store the result.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-21 17:31:28 +00:00
Mark Spencer 4c90cf59b7 Support hold/unhold in Zap, update IAX2 parser to know about modern commands, forward hold/unhold in dial, add hold device state
and implement holding in the SLA.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-08 02:24:07 +00:00
Kevin P. Fleming 472c1ca282 simplify autoconfig include mechanism (make tholo happy he can use lint again :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-07 18:54:56 +00:00
Kevin P. Fleming a16ae226b6 use string fields for some stuff in ast_channel
const-ify some more APIs
remove 'type' field from ast_channel, in favor of the one in the channel's tech structure
allow string field module users to specify the 'chunk size' for pool allocations
update chan_alsa to be compatible with recent const-ification patches


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-02-01 23:05:28 +00:00
Russell Bryant a725468381 update doxygen docs to specify authors
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-12-30 21:18:06 +00:00
Kevin P. Fleming 2c65582b66 remove extraneous svn:executable properties
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-29 18:24:39 +00:00
Kevin P. Fleming 1740d40182 issue #5693
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-10 23:42:45 +00:00
Kevin P. Fleming 033cd4d58f revert strncpy->ast_copy_string changes where the semantics are subtly different
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6914 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-31 23:28:30 +00:00
Russell Bryant 395f81d734 strncpy to ast_copy_string
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-27 02:42:05 +00:00
Russell Bryant 6324072247 more doxygenification (issue #5513)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-26 13:03:17 +00:00
Mark Spencer 8087701923 iax2 parser cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-09-21 12:47:03 +00:00
Kevin P. Fleming 5da915dcfd update MANY more files with proper copyright/license info (thanks Ian!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-09-14 20:46:50 +00:00
Russell Bryant 943e527d0a don't use a signed buffer for data that the protocol specifies as unsigned.
This fixes an issues with RSA authentication (issue #5148)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-09-09 01:07:25 +00:00
Kevin P. Fleming 6a260b78fe use unsigned char for data elements and native-signed char for strings (issue #5104)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-09-02 19:17:19 +00:00
Kevin P. Fleming 81c127758b ensure buffer is adequately sized for frames with lots of elements (issue #4974)
various minor formatting/cleanup changes


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-08-23 17:38:58 +00:00
Mark Spencer 3916b7e41b Fix IAX2 encryption (really, bug #4500 for reference)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-07-12 14:46:20 +00:00
Mark Spencer fb12b92a43 Various IAX2 fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-13 08:48:17 +00:00
Kevin P. Fleming 2b8338cb52 more file version tags
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-06 22:12:19 +00:00
Kevin P. Fleming 005e436b57 another round of version tag updates, along with 'show version files' pattern filtering
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-06 21:09:59 +00:00
Russell Bryant 9644f1dcfe various code cleanups (bug #4353)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-05-25 10:57:15 +00:00
Russell Bryant 9f9fcca6c0 print out the IAX DATETIME IE in 'iax2 debug' in human readable form
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-05-17 19:41:09 +00:00
Kevin P. Fleming 1f9ab2380a use double-quotes instead of angle-brackets for non-system include files (bug #4058)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-04-21 06:02:45 +00:00
Kevin P. Fleming bbc8c2ce6f fix breakage from slin endianness commit earlier today (sorry :-()
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-04-04 02:13:40 +00:00
Kevin P. Fleming b96ae79baa handle AST_FORMAT_SLINEAR endianness properly on big-endian systems (bug #3865)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-04-03 22:57:18 +00:00
Mark Spencer f966e5e186 Simplify endianness and fix for unaligned reads (bug #3867)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-03-29 04:49:24 +00:00
Mark Spencer f9cfe60312 Add support for Solaris/x86 (bug #3064)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-03-17 23:12:15 +00:00