Commit Graph

102 Commits

Author SHA1 Message Date
David Vossel d09f9fd00a Merge code associated with AST-2009-006
(closes issue #12912)
Reported by: rathaus
Tested by: tilghman, russell, dvossel, dbrooks


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 16:31:54 +00:00
Russell Bryant a13d62aa49 Tell the IAX2 parser about more control frame types.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198729 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01 21:03:18 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

Review: https://reviewboard.asterisk.org/r/251/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
David Vossel d9ac4bfc6f Merged revisions 194557,194685 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r194557 | dvossel | 2009-05-14 17:59:43 -0500 (Thu, 14 May 2009) | 10 lines
  
  IAX2 "Ghost" Channels
  
  There is a bug tracker issue where people are reporting "Ghost" channels in their 'iax2 show channels' output.  The confusion is caused by channels being listed as "(NONE)" with format "unknown".  These are not channels of coarse.  They are usually just pending registration or poke requests, but it is confusing output.  To help make sense of this I have added two columns to 'iax2 show channels'.  One shows the first message which started the transaction, and the second shows the last message sent by either side of the call.  This helps diagnose why the entry exists and why it may not go away.
  
  (closes issue #14207)
  Reported by: clive18
  
  Review: https://reviewboard.asterisk.org/r/246/
........
  r194685 | dvossel | 2009-05-15 10:40:37 -0500 (Fri, 15 May 2009) | 6 lines
  
  Update to previous IAX2 "Ghost" Channels patch.
  
  Fixed some comments made on reviewboard for the previous patch.
  
  (issue #14207)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-15 20:52:12 +00:00
Tilghman Lesher c8223fc957 Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 08:36:35 +00:00
Joshua Colp 135bb29ba6 Finish conversion to using ARRAY_LEN and remove it as a janitor project.
(closes issue #14032)
Reported by: bkruse
Patches:
      14032.patch uploaded by bkruse (license 132)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 01:09:06 +00:00
Tilghman Lesher 8fbee1307c Repair IAXVAR implementation so that it works again (regression?)
(closes issue #13354)
 Reported by: adomjan
 Patches: 
       20080828__bug13354.diff.txt uploaded by Corydon76 (license 14)
       20080829__bug13354__1.6.0.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, adomjan


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@143031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-13 13:54:15 +00:00
Sean Bright db1ed285c4 More RSW merges. This should do it for the channels/ dir.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-09 14:12:34 +00:00
Russell Bryant 58291bcec9 Merge changes from team/bbryant/keyrotation
This set of changes enhances IAX2 encryption support by adding key rotation
to provide enhanced security.  The key used for encryption is rotated right 
after the call gets set up, and then again every few minutes.  This was
discussed at the last AstriDevCon.  For interoperability with older versions
of Asterisk, there is an option that disables key rotation.

(closes issue #13018)
Reported by: bbryant
Patches:
      07072008__iax2_key_rotation.diff uploaded by bbryant (license 36)
Tested by: russell, bbryant


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-01 18:16:24 +00:00
Russell Bryant 6d5979ff7e fix the potential use of an uninitialized variable
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 19:39:25 +00:00
Tilghman Lesher b89ecf2407 Optimize frame cache by realloc'ing the smallest frame when the cache is full.
This ensures that we don't just keep a cache of tiny frames, continually doing
an alloc/free for each data frame, thus negating the point of having a cache.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 19:03:41 +00:00
Russell Bryant 8adc6fb4ea Merged revisions 134814 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r134814 | russell | 2008-07-31 11:45:31 -0500 (Thu, 31 Jul 2008) | 7 lines

In case we have some processing threads that free more frames than they allocate,
do not let the frame cache grow forever.

(closes issue #13160)
Reported by: tavius
Tested by: tavius, russell

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134815 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 16:50:10 +00:00
Brett Bryant 10f0255389 Fix one more file that got changed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 22:47:48 +00:00
Brett Bryant 10fdf344ed Update these files with transfer code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 22:36:02 +00:00
Michiel van Baak f1e9371da8 - revert change to ast_queue_hangup and create ast_queue_hangup_with_cause
- 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-05-22 16:29:54 +00:00
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