Commit Graph

72 Commits

Author SHA1 Message Date
Mike Bradeen e8f548c155 app_macro: Remove deprecated module.
For most modules that interacted with app_macro, this change is limited
to no longer looking for the current context from the macrocontext when
set.  Additionally, the following modules are impacted:

app_dial - no longer supports M^ connected/redirecting macro
app_minivm - samples written using macro will no longer work.
The sample needs a re-write

app_queue - can no longer a macro on the called party's channel.
Use gosub which is currently supported

ccss - no callback macro, gosub only

app_voicemail - no macro support

channel  - remove macrocontext and priority, no connected line or
redirection macro options
options - stdexten is deprecated to gosub as the default and only
pbx - removed macrolock
pbx_dundi - no longer look for macro

snmp - removed macro context, exten, and priority

ASTERISK-30304

Change-Id: I830daab293117179b8d61bd4df0d971a1b3d07f6
2023-01-10 14:07:44 -06:00
Alexander Traud 9440f6ec58 main: Fix for Doxygen.
ASTERISK-29763

Change-Id: Ib8359e3590a9109eb04a5376559d040e5e21867e
2021-12-02 15:02:09 -06:00
Josh Soref f382775241 main: Spelling fixes
Correct typos of the following word families:

analysis
nuisance
converting
although
transaction
desctitle
acquire
update
evaluate
thousand
this
dissolved
management
integrity
reconstructed
decrement
further on
irrelevant
currently
constancy
anyway
unconstrained
featuregroups
right
larger
evaluated
encumbered
languages
digits
authoritative
framing
blindxfer
tolerate
traverser
exclamation
perform
permissions
rearrangement
performing
processing
declension
happily
duplicate
compound
hundred
returns
elicit
allocate
actually
paths
inheritance
atxferdropcall
earlier
synchronization
multiplier
acknowledge
across
against
thousands
joyous
manipulators
guaranteed
emulating
soundfile

ASTERISK-29714

Change-Id: I926ba4b11e9f6dd3fdd93170ab1f9b997910be70
2021-11-15 17:33:27 -06:00
Kevin Harwell 3656c42cb0 various modules: json integer overflow
There were still a few places in the code that could overflow when "packing"
a json object with a value outside the base type integer's range. For instance:

unsigned int value = INT_MAX + 1
ast_json_pack("{s: i}", value);

would result in a negative number being "packed". In those situations this patch
alters those values to a ast_json_int_t, which widens the value up to a long or
long long.

ASTERISK-28480

Change-Id: Ied530780d83e6f1772adba0e28d8938ef30c49a1
2019-08-01 15:31:48 -06:00
Joshua Colp 3077ad0c24 stasis: Add internal filtering of messages.
This change adds the ability for subscriptions to indicate
which message types they are interested in accepting. By
doing so the filtering is done before being dispatched
to the subscriber, reducing the amount of work that has
to be done.

This is optional and if a subscriber does not add
message types they wish to accept and set the subscription
to selective filtering the previous behavior is preserved
and they receive all messages.

There is also the ability to explicitly force the reception
of all messages for cases such as AMI or ARI where a large
number of messages are expected that are then generically
converted into a different format.

ASTERISK-28103

Change-Id: I99bee23895baa0a117985d51683f7963b77aa190
2018-11-18 15:08:16 -05:00
Corey Farrell 687ab7aeee
astobj2: Eliminate legacy container allocation macros.
These macros have been documented as legacy for a long time but are
still used in new code because they exist.  Remove all references to:
* ao2_container_alloc_options
* ao2_t_container_alloc_options
* ao2_t_container_alloc

These macro's are also removed.  Only ao2_container_alloc remains due to
it's use in over 100 places.

Change-Id: I1a26258b5bf3deb081aaeed11a0baa175c933c7a
2018-10-19 17:33:05 -04:00
Jenkins2 5843a19797 Merge "loader: Convert reload_classes to built-in modules." 2018-03-19 12:53:12 -05:00
Corey Farrell 89ba4d4e3d main/ccss: Use ast_cli_completion_add for core id.
Change-Id: I44b25d6d24c7d9bc1bb38a50774b38883162f98f
2018-03-15 09:19:58 -04:00
Corey Farrell 572a508ef2 loader: Convert reload_classes to built-in modules.
* acl (named_acl.c)
* cdr
* cel
* ccss
* dnsmgr
* dsp
* enum
* extconfig (config.c)
* features
* http
* indications
* logger
* manager
* plc
* sounds
* udptl

These modules are now loaded at appropriate time by the module loader.
Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so
the module loader will abort startup on failure of these modules.

Some of these modules are still initialized or shutdown from outside the
module loader.  logger.c is initialized very early and shutdown very
late, manager.c is initialized by the module loader but is shutdown by
the Asterisk core (too much uses it without holding references).

Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
2018-03-14 05:20:12 -04:00
Corey Farrell bc73337e07 core: Use macros to generate ao2_container callbacks where possible.
This uses AO2_STRING_FIELD_HASH_FN and AO2_STRING_FIELD_CMP_FN where
possible in the Asterisk core.

This removes CMP_STOP from the result of CMP_FN callbacks for the
following structure types:
* ast_bucket_metadata
* ast_bucket_scheme
* generic_monitor_instance_list (ccss.c)
* ast_bucket_file (media_cache.c)
* named_acl

Change-Id: Ide4c1449a894bce70dea1fef664dade9b57578f1
2017-12-30 13:20:16 -05:00
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Corey Farrell 89ccab95c2 ccss: Remove silly usage of RAII_VAR.
Change-Id: I5ce40035e0a940e4e56f6322c1dcd47fbd509b98
2017-11-20 14:26:11 -06:00
Corey Farrell 58d032112b Fix compiler warnings on Fedora 26 / GCC 7.
GCC 7 has added capability to produce warnings, this fixes most of those
warnings.  The specific warnings are disabled in a few places:

* app_voicemail.c: truncation of paths more than 4096 chars in many places.
* chan_mgcp.c: callid truncated to 80 chars.
* cdr.c: two userfields are combined to cdr copy, fix would break ABI.
* tcptls.c: ignore use of deprecated method SSLv3_client_method().

ASTERISK-27156 #close

Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88
2017-08-01 15:42:38 -06:00
Sean Bright 3f94373778 cli: Fix various CLI documentation and completion issues
* app_minivm: Use built-in completion facilities to complete optional
arguments.

* app_voicemail: Use built-in completion facilities to complete
optional arguments.

* app_confbridge: Add missing colons after 'Usage' text.

* chan_alsa: Use built-in completion facilities to complete optional
arguments.

* chan_sip: Use built-in completion facilities to complete optional
arguments. Add completions for 'load' for 'sip show user', 'sip show
peer', and 'sip qualify peer.'

* chan_skinny: Correct and extend completions for 'skinny reset' and
'skinny show line.'

* func_odbc: Correct completions for 'odbc read' and 'odbc write'

* main/astmm: Use built-in completion facilities to complete arguments
for 'memory' commands.

* main/bridge: Correct completions for 'bridge kick.'

* main/ccss: Use built-in completion facilities to complete arguments
for 'cc cancel' command.

* main/cli: Add 'all' completion for 'channel request hangup.' Correct
completions for 'core set debug channel.' Correct completions for 'core
show calls.'

* main/pbx_app: Remove redundant completions for 'core show
applications.'

* main/pbx_hangup_handler: Remove unused completions for 'core show
hanguphandlers all.'

* res_sorcery_memory_cache: Add completion for 'reload' argument of
'sorcery memory cache stale' and properly implement.

Change-Id: Iee58c7392f6fec34ad9d596109117af87697bbca
2017-02-13 11:33:15 -05:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Corey Farrell 8061d9f66f Fix naming mismatch of allocator functions.
Allocator functions that take file/line/func parameters are prefixed
with single-underscore when MALLOC_DEBUG is not defined,
double-underscore when it is defined.  This change updates all
allocators that accept file/line/func to have the same prototype in
either ABI mode.  The parameter order of __ast_vasprintf and
__ast_asprintf in utils.h have been changed to match that of astmm.h.

End-use allocator macro's have been removed from astmm.h and moved to an
unconditional part of utils.h.

Change-Id: I823bb6ce2b5675b3a4735948f10a3b420e9a023a
2016-08-19 20:16:36 -04:00
Richard Mudgett 1fb39aa8a0 ccss.c: Replace space in taskprocessor name.
The CLI "core ping taskprocessor" command does not work very
well with taskprocessor names that have spaces in them.  You
have to put quotes around the name so using tab completion
becomes awkward.

Change-Id: I29e806dd0a8a0256f4e2e0a7ab88c9e19ab0eda0
2016-01-08 21:05:16 -06:00
Mark Michelson aae45acbda Detect potential forwarding loops based on count.
A potential problem that can arise is the following:

* Bob's phone is programmed to automatically forward to Carol.
* Carol's phone is programmed to automatically forward to Bob.
* Alice calls Bob.

If left unchecked, this results in an endless loops of call forwards
that would eventually result in some sort of fiery crash.

Asterisk's method of solving this issue was to track which interfaces
had been dialed. If a destination were dialed a second time, then
the attempt to call that destination would fail since a loop was
detected.

The problem with this method is that call forwarding has evolved. Some
SIP phones allow for a user to manually forward an incoming call to an
ad-hoc destination. This can mean that:

* There are legitimate use cases where a device may be dialed multiple
times, or
* There can be human error when forwarding calls.

This change removes the old method of detecting forwarding loops in
favor of keeping a count of the number of destinations a channel has
dialed on a particular branch of a call. If the number exceeds the
set number of max forwards, then the call fails. This approach has
the following advantages over the old:

* It is much simpler.
* It can detect loops involving local channels.
* It is user configurable.

The only disadvantage it has is that in the case where there is a
legitimate forwarding loop present, it takes longer to detect it.
However, the forwarding loop is still properly detected and the
call is cleaned up as it should be.

Address review feedback on gerrit.

* Correct "mfgium" to "Digium"
* Decrement max forwards by one in the case where allocation of the
  max forwards datastore is required.
* Remove irrelevant code change from pjsip_global_headers.c

ASTERISK-24958 #close

Change-Id: Ia7e4b7cd3bccfbd34d9a859838356931bba56c23
2015-04-17 15:58:07 -05:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:

* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
  remove passing the version in with the macro. Other facilities
  than 'core show file version' make use of the file names, such as
  setting a debug level only on a specific file. As such, the act of
  registering source files with the Asterisk core still has use. The
  macro rename now reflects the new macro purpose.

* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Remove the "core show file version" CLI command. Without the file
    version, it is no longer useful.
  - Remove the ast_file_version_find function. The file version is no
    longer tracked.
  - Rename ast_register_file_version/ast_unregister_file_version to
    ast_register_file/ast_unregister_file, respectively.

* main/manager: Remove value from the Version key of the ModuleCheck
  Action. The actual key itself has not been removed, as doing so would
  absolutely constitute a backwards incompatible change. However, since
  the file version is no longer tracked, there is no need to attempt to
  include it in the Version key.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action
  - Removal of the "core show file version" CLI command

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
George Joseph e48f2e7897 build: Fixes for gcc 5 compilation
These are fixes for compilation under gcc 5.0...

chan_sip.c:    In parse_request needed to make 'lim' unsigned.
inline_api.h:  Needed to add a check for '__GNUC_STDC_INLINE__' to detect C99 
               inline semantics (same as clang).
ccss.c:        In ast_cc_set_parm, needed to fix weird comparison.
dsp.c:         Needed to work around a possible compiler bug.  It was throwing 
               an array-bounds error but neither
               sgriepentrog, rmudgett nor I could figure out why.
manager.c:     In action_atxfer, needed to correct an array allocation.

This patch will go to 11, 13, trunk.

Review: https://reviewboard.asterisk.org/r/4581/
Reported-by: Jeffrey Ollie
Tested-by: George Joseph
ASTERISK-24932 #close
........

Merged revisions 434113 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434114 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 19:04:32 +00:00
Corey Farrell 3ddd92902a Replace most uses of ast_register_atexit with ast_register_cleanup.
Since 'core stop now' and 'core restart now' do not stop modules,
it is unsafe for most of the core to run cleanups.  Originally all
cleanups used ast_register_atexit, and were only changed when it
was shown to be unsafe.  ast_register_atexit is now used only when
absolutely required to prevent corruption and close child processes.

Exceptions that need to use ast_register_atexit:
* CDR: Flush records.
* res_musiconhold: Kill external applications.
* AstDB: Close the DB.
* canary_exit: Kill canary process.

ASTERISK-24142 #close
Reported by: David Brillert

ASTERISK-24683 #close
Reported by: Peter Katzmann

ASTERISK-24805 #close
Reported by: Badalian Vyacheslav

ASTERISK-24881 #close
Reported by: Corey Farrell

Review: https://reviewboard.asterisk.org/r/4500/
Review: https://reviewboard.asterisk.org/r/4501/
........

Merged revisions 433495 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433497 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-26 22:24:26 +00:00
Kinsey Moore f1036f40dc Stasis: Allow message types to be blocked
This introduces stasis.conf and a mechanism to prevent certain message
types from being published. Internally, this works by preventing the
chosen message types from being created which ensures that those
message types can never be published. This patch also adjusts message
publishers such that message payloads are not created if the related
message type is not available.

ASTERISK-23943 #close
Review: https://reviewboard.asterisk.org/r/3823/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-06 12:55:28 +00:00
Matthew Jordan a2c912e997 media formats: re-architect handling of media for performance improvements
In the old times media formats were represented using a bit field. This was
fast but had a few limitations.
 1. Asterisk was limited in how many formats it could handle.
 2. Formats, being a bit field, could not include any attribute information.
    A format was strictly its type, e.g., "this is ulaw".
This was changed in Asterisk 10 (see
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal for
notes on that work) which led to the creation of the ast_format structure.
This structure allowed Asterisk to handle attributes and bundle information
with a format.

Additionally, ast_format_cap was created to act as a container for multiple
formats that, together, formed the capability of some entity. Another
mechanism was added to allow logic to be registered which performed format
attribute negotiation. Everywhere throughout the codebase Asterisk was
changed to use this strategy.

Unfortunately, in software, there is no free lunch. These new capabilities
came at a cost.

Performance analysis and profiling showed that we spend an inordinate
amount of time comparing, copying, and generally manipulating formats and
their related structures. Basic prototyping has shown that a reasonably
large performance improvement could be made in this area. This patch is the
result of that project, which overhauled the media format architecture
and its usage in Asterisk to improve performance.

Generally, the new philosophy for handling formats is as follows:
 * The ast_format structure is reference counted. This removed a large amount
   of the memory allocations and copying that was done in prior versions.
 * In order to prevent race conditions while keeping things performant, the
   ast_format structure is immutable by convention and lock-free. Violate this
   tenet at your peril!
 * Because formats are reference counted, codecs are also reference counted.
   The Asterisk core generally provides built-in codecs and caches the
   ast_format structures created to represent them. Generally, to prevent
   inordinate amounts of module reference bumping, codecs and formats can be
   added at run-time but cannot be removed.
 * All compatibility with the bit field representation of codecs/formats has
   been moved to a compatibility API. The primary user of this representation
   is chan_iax2, which must continue to maintain its bit-field usage of formats
   for interoperability concerns.
 * When a format is negotiated with attributes, or when a format cannot be
   represented by one of the cached formats, a new format object is created or
   cloned from an existing format. That format may have the same codec
   underlying it, but is a different format than a version of the format with
   different attributes or without attributes.
 * While formats are reference counted objects, the reference count maintained
   on the format should be manipulated with care. Formats are generally cached
   and will persist for the lifetime of Asterisk and do not explicitly need
   to have their lifetime modified. An exception to this is when the user of a
   format does not know where the format came from *and* the user may outlive
   the provider of the format. This occurs, for example, when a format is read
   from a channel: the channel may have a format with attributes (hence,
   non-cached) and the user of the format may last longer than the channel (if
   the reference to the channel is released prior to the format's reference).

For more information on this work, see the API design notes:
  https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite

Finally, this work was the culmination of a large number of developer's
efforts. Extra thanks goes to Corey Farrell, who took on a large amount of the
work in the Asterisk core, chan_sip, and was an invaluable resource in peer
reviews throughout this project.

There were a substantial number of patches contributed during this work; the
following issues/patch names simply reflect some of the work (and will cause
the release scripts to give attribution to the individuals who work on them).

Reviews:
 https://reviewboard.asterisk.org/r/3814
 https://reviewboard.asterisk.org/r/3808
 https://reviewboard.asterisk.org/r/3805
 https://reviewboard.asterisk.org/r/3803
 https://reviewboard.asterisk.org/r/3801
 https://reviewboard.asterisk.org/r/3798
 https://reviewboard.asterisk.org/r/3800
 https://reviewboard.asterisk.org/r/3794
 https://reviewboard.asterisk.org/r/3793
 https://reviewboard.asterisk.org/r/3792
 https://reviewboard.asterisk.org/r/3791
 https://reviewboard.asterisk.org/r/3790
 https://reviewboard.asterisk.org/r/3789
 https://reviewboard.asterisk.org/r/3788
 https://reviewboard.asterisk.org/r/3787
 https://reviewboard.asterisk.org/r/3786
 https://reviewboard.asterisk.org/r/3784
 https://reviewboard.asterisk.org/r/3783
 https://reviewboard.asterisk.org/r/3778
 https://reviewboard.asterisk.org/r/3774
 https://reviewboard.asterisk.org/r/3775
 https://reviewboard.asterisk.org/r/3772
 https://reviewboard.asterisk.org/r/3761
 https://reviewboard.asterisk.org/r/3754
 https://reviewboard.asterisk.org/r/3753
 https://reviewboard.asterisk.org/r/3751
 https://reviewboard.asterisk.org/r/3750
 https://reviewboard.asterisk.org/r/3748
 https://reviewboard.asterisk.org/r/3747
 https://reviewboard.asterisk.org/r/3746
 https://reviewboard.asterisk.org/r/3742
 https://reviewboard.asterisk.org/r/3740
 https://reviewboard.asterisk.org/r/3739
 https://reviewboard.asterisk.org/r/3738
 https://reviewboard.asterisk.org/r/3737
 https://reviewboard.asterisk.org/r/3736
 https://reviewboard.asterisk.org/r/3734
 https://reviewboard.asterisk.org/r/3722
 https://reviewboard.asterisk.org/r/3713
 https://reviewboard.asterisk.org/r/3703
 https://reviewboard.asterisk.org/r/3689
 https://reviewboard.asterisk.org/r/3687
 https://reviewboard.asterisk.org/r/3674
 https://reviewboard.asterisk.org/r/3671
 https://reviewboard.asterisk.org/r/3667
 https://reviewboard.asterisk.org/r/3665
 https://reviewboard.asterisk.org/r/3625
 https://reviewboard.asterisk.org/r/3602
 https://reviewboard.asterisk.org/r/3519
 https://reviewboard.asterisk.org/r/3518
 https://reviewboard.asterisk.org/r/3516
 https://reviewboard.asterisk.org/r/3515
 https://reviewboard.asterisk.org/r/3512
 https://reviewboard.asterisk.org/r/3506
 https://reviewboard.asterisk.org/r/3413
 https://reviewboard.asterisk.org/r/3410
 https://reviewboard.asterisk.org/r/3387
 https://reviewboard.asterisk.org/r/3388
 https://reviewboard.asterisk.org/r/3389
 https://reviewboard.asterisk.org/r/3390
 https://reviewboard.asterisk.org/r/3321
 https://reviewboard.asterisk.org/r/3320
 https://reviewboard.asterisk.org/r/3319
 https://reviewboard.asterisk.org/r/3318
 https://reviewboard.asterisk.org/r/3266
 https://reviewboard.asterisk.org/r/3265
 https://reviewboard.asterisk.org/r/3234
 https://reviewboard.asterisk.org/r/3178

ASTERISK-23114 #close
Reported by: mjordan
  media_formats_translation_core.diff uploaded by kharwell (License 6464)
  rb3506.diff uploaded by mjordan (License 6283)
  media_format_app_file.diff uploaded by kharwell (License 6464) 
  misc-2.diff uploaded by file (License 5000)
  chan_mild-3.diff uploaded by file (License 5000) 
  chan_obscure.diff uploaded by file (License 5000) 
  jingle.diff uploaded by file (License 5000) 
  funcs.diff uploaded by file (License 5000) 
  formats.diff uploaded by file (License 5000) 
  core.diff uploaded by file (License 5000) 
  bridges.diff uploaded by file (License 5000) 
  mf-codecs-2.diff uploaded by file (License 5000) 
  mf-app_fax.diff uploaded by file (License 5000) 
  mf-apps-3.diff uploaded by file (License 5000) 
  media-formats-3.diff uploaded by file (License 5000) 

ASTERISK-23715
  rb3713.patch uploaded by coreyfarrell (License 5909)
  rb3689.patch uploaded by mjordan (License 6283)
  
ASTERISK-23957
  rb3722.patch uploaded by mjordan (License 6283) 
  mf-attributes-3.diff uploaded by file (License 5000) 

ASTERISK-23958
Tested by: jrose
  rb3822.patch uploaded by coreyfarrell (License 5909) 
  rb3800.patch uploaded by jrose (License 6182)
  chan_sip.diff uploaded by mjordan (License 6283) 
  rb3747.patch uploaded by jrose (License 6182)

ASTERISK-23959 #close
Tested by: sgriepentrog, mjordan, coreyfarrell
  sip_cleanup.diff uploaded by opticron (License 6273)
  chan_sip_caps.diff uploaded by mjordan (License 6283) 
  rb3751.patch uploaded by coreyfarrell (License 5909) 
  chan_sip-3.diff uploaded by file (License 5000) 

ASTERISK-23960 #close
Tested by: opticron
  direct_media.diff uploaded by opticron (License 6273) 
  pjsip-direct-media.diff uploaded by file (License 5000) 
  format_cap_remove.diff uploaded by opticron (License 6273) 
  media_format_fixes.diff uploaded by opticron (License 6273) 
  chan_pjsip-2.diff uploaded by file (License 5000) 

ASTERISK-23966 #close
Tested by: rmudgett
  rb3803.patch uploaded by rmudgetti (License 5621)
  chan_dahdi.diff uploaded by file (License 5000) 
  
ASTERISK-24064 #close
Tested by: coreyfarrell, mjordan, opticron, file, rmudgett, sgriepentrog, jrose
  rb3814.patch uploaded by rmudgett (License 5621) 
  moh_cleanup.diff uploaded by opticron (License 6273) 
  bridge_leak.diff uploaded by opticron (License 6273) 
  translate.diff uploaded by file (License 5000) 
  rb3795.patch uploaded by rmudgett (License 5621) 
  tls_fix.diff uploaded by mjordan (License 6283) 
  fax-mf-fix-2.diff uploaded by file (License 5000) 
  rtp_transfer_stuff uploaded by mjordan (License 6283) 
  rb3787.patch uploaded by rmudgett (License 5621) 
  media-formats-explicit-translate-format-3.diff uploaded by file (License 5000) 
  format_cache_case_fix.diff uploaded by opticron (License 6273) 
  rb3774.patch uploaded by rmudgett (License 5621) 
  rb3775.patch uploaded by rmudgett (License 5621) 
  rtp_engine_fix.diff uploaded by opticron (License 6273) 
  rtp_crash_fix.diff uploaded by opticron (License 6273) 
  rb3753.patch uploaded by mjordan (License 6283) 
  rb3750.patch uploaded by mjordan (License 6283) 
  rb3748.patch uploaded by rmudgett (License 5621) 
  media_format_fixes.diff uploaded by opticron (License 6273) 
  rb3740.patch uploaded by mjordan (License 6283) 
  rb3739.patch uploaded by mjordan (License 6283) 
  rb3734.patch uploaded by mjordan (License 6283) 
  rb3689.patch uploaded by mjordan (License 6283) 
  rb3674.patch uploaded by coreyfarrell (License 5909) 
  rb3671.patch uploaded by coreyfarrell (License 5909) 
  rb3667.patch uploaded by coreyfarrell (License 5909) 
  rb3665.patch uploaded by mjordan (License 6283) 
  rb3625.patch uploaded by coreyfarrell (License 5909) 
  rb3602.patch uploaded by coreyfarrell (License 5909) 
  format_compatibility-2.diff uploaded by file (License 5000) 
  core.diff uploaded by file (License 5000) 
  


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-20 22:06:33 +00:00
Kinsey Moore abd3e4040b Allow Asterisk to compile under GCC 4.10
This resolves a large number of compiler warnings from GCC 4.10 which
cause the build to fail under dev mode. The vast majority are
signed/unsigned mismatches in printf-style format strings.
........

Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09 22:49:26 +00:00
Scott Griepentrog 80ef9a21b9 uniqueid: channel linkedid, ami, ari object creation with id's
Much needed was a way to assign id to objects on creation, and
much change was necessary to accomplish it.  Channel uniqueids
and linkedids are split into separate string and creation time
components without breaking linkedid propgation.  This allowed
the uniqueid to be specified by the user interface - and those
values are now carried through to channel creation, adding the
assignedids value to every function in the chain including the
channel drivers. For local channels, the second channel can be
specified or left to default to a ;2 suffix of first.  In ARI,
bridge, playback, and snoop objects can also be created with a
specified uniqueid.

Along the way, the args order to allocating channels was fixed
in chan_mgcp and chan_gtalk, and linkedid is no longer lost as
masquerade occurs.

(closes issue ASTERISK-23120)
Review: https://reviewboard.asterisk.org/r/3191/
........

Merged revisions 410157 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 15:47:55 +00:00
Mark Michelson ee21eee7e0 Cache string values of formats on ast_format_cap() to save processing.
Channel snapshots have string representations of the channel's native formats.
Prior to this change, the format strings were re-created on ever channel snapshot
creation. Since channel native formats rarely change, this was very wasteful.
Now, string representations of formats may optionally be stored on the ast_format_cap
for cases where string representations may be requested frequently. When formats
are altered, the string cache is marked as invalid. When strings are requested, the
cache validity is checked. If the cache is valid, then the cached strings are copied.
If the cache is invalid, then the string cache is rebuilt and copied, and the cache
is marked as being valid again.

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

Merged revisions 400356 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 14:58:16 +00:00
David M. Lee 2de42c2a25 Multiple revisions 399887,400138,400178,400180-400181
........
  r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
  
  Minor performance bump by not allocate manager variable struct if we don't need it
........
  r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines
  
  Stasis performance improvements
  
  This patch addresses several performance problems that were found in
  the initial performance testing of Asterisk 12.
  
  The Stasis dispatch object was allocated as an AO2 object, even though
  it has a very confined lifecycle. This was replaced with a straight
  ast_malloc().
  
  The Stasis message router was spending an inordinate amount of time
  searching hash tables. In this case, most of our routers had 6 or
  fewer routes in them to begin with. This was replaced with an array
  that's searched linearly for the route.
  
  We more heavily rely on AO2 objects in Asterisk 12, and the memset()
  in ao2_ref() actually became noticeable on the profile. This was
  #ifdef'ed to only run when AO2_DEBUG was enabled.
  
  After being misled by an erroneous comment in taskprocessor.c during
  profiling, the wrong comment was removed.
  
  Review: https://reviewboard.asterisk.org/r/2873/
........
  r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines
  
  Taskprocessor optimization; switch Stasis to use taskprocessors
  
  This patch optimizes taskprocessor to use a semaphore for signaling,
  which the OS can do a better job at managing contention and waiting
  that we can with a mutex and condition.
  
  The taskprocessor execution was also slightly optimized to reduce the
  number of locks taken.
  
  The only observable difference in the taskprocessor implementation is
  that when the final reference to the taskprocessor goes away, it will
  execute all tasks to completion instead of discarding the unexecuted
  tasks.
  
  For systems where unnamed semaphores are not supported, a really
  simple semaphore implementation is provided. (Which gives identical
  performance as the original taskprocessor implementation).
  
  The way we ended up implementing Stasis caused the threadpool to be a
  burden instead of a boost to performance. This was switched to just
  use taskprocessors directly for subscriptions.
  
  Review: https://reviewboard.asterisk.org/r/2881/
........
  r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines
  
  Optimize how Stasis forwards are dispatched
  
  This patch optimizes how forwards are dispatched in Stasis.
  
  Originally, forwards were dispatched as subscriptions that are invoked
  on the publishing thread. This did not account for the vast number of
  forwards we would end up having in the system, and the amount of work it
  would take to walk though the forward subscriptions.
  
  This patch modifies Stasis so that rather than walking the tree of
  forwards on every dispatch, when forwards and subscriptions are changed,
  the subscriber list for every topic in the tree is changed.
  
  This has a couple of benefits. First, this reduces the workload of
  dispatching messages. It also reduces contention when dispatching to
  different topics that happen to forward to the same aggregation topic
  (as happens with all of the channel, bridge and endpoint topics).
  
  Since forwards are no longer subscriptions, the bulk of this patch is
  simply changing stasis_subscription objects to stasis_forward objects
  (which, admittedly, I should have done in the first place.)
  
  Since this required me to yet again put in a growing array, I finally
  abstracted that out into a set of ast_vector macros in
  asterisk/vector.h.
  
  Review: https://reviewboard.asterisk.org/r/2883/
........
  r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines
  
  Remove dispatch object allocation from Stasis publishing
  
  While looking for areas for performance improvement, I realized that an
  unused feature in Stasis was negatively impacting performance.
  
  When a message is sent to a subscriber, a dispatch object is allocated
  for the dispatch, containing the topic the message was published to, the
  subscriber the message is being sent to, and the message itself.
  
  The topic is actually unused by any subscriber in Asterisk today. And
  the subscriber is associated with the taskprocessor the message is being
  dispatched to.
  
  First, this patch removes the unused topic parameter from Stasis
  subscription callbacks.
  
  Second, this patch introduces the concept of taskprocessor local data,
  data that may be set on a taskprocessor and provided along with the data
  pointer when a task is pushed using the ast_taskprocessor_push_local()
  call. This allows the task to have both data specific to that
  taskprocessor, in addition to data specific to that invocation.
  
  With those two changes, the dispatch object can be removed completely,
  and the message is simply refcounted and sent directly to the
  taskprocessor.
  
  Review: https://reviewboard.asterisk.org/r/2884/
........

Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:55:27 +00:00
Kinsey Moore 59753b1ea1 Strip down the old event system
This removes unused code, event types, IE pltypes, and event IE types
where possible and makes several functions private that were once
public. This includes a renumbering of the remaining event and IE types
which breaks binary compatibility with previous versions. The last
remaining consumers of the old event system (or parts thereof) are
main/security_events.c, res/res_security_log.c, tests/test_cel.c,
tests/test_event.c, main/cel.c, and the CEL backends.

Review: https://reviewboard.asterisk.org/r/2703/
(closes issue ASTERISK-22139)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17 14:39:27 +00:00
Jason Parker 900714beb9 Convert CCSS manager events to stasis.
(closes issue ASTERISK-21473)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-19 18:00:35 +00:00
Kinsey Moore 191cf99ae1 Move device state distribution to Stasis-core
In the move from Asterisk's event system to Stasis, this makes
distributed device state aggregation always-on, removes unnecessary
task processors where possible, and collapses aggregate and
non-aggregate states into a single cache for ease of retrieval. This
also removes an intermediary step in device state aggregation.

Review: https://reviewboard.asterisk.org/r/2389/
(closes issue ASTERISK-21101)
Patch-by: Kinsey Moore <kmoore@digium.com>


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16 15:33:59 +00:00
Matthew Jordan 8fb5bdce9a Prevent exhaustion of system resources through exploitation of event cache
Asterisk maintains an internal cache for devices in the event subsystem. The
device state cache holds the state of each device known to Asterisk, such that
consumers of device state information can query for the last known state for
a particular device, even if it is not part of an active call. The concept of
a device in Asterisk can include entities that do not have a physical
representation. One way that this occurred was when anonymous calls are allowed
in Asterisk. A device was automatically created and stored in the cache for
each anonymous call that occurred; this was possible in the SIP and IAX2
channel drivers and through channel drivers that utilized the
res_jabber/res_xmpp resource modules (Gtalk, Jingle, and Motif). These devices
are never removed from the system, allowing anonymous calls to potentially
exhaust a system's resources.

This patch changes the event cache subsystem and device state management to
no longer cache devices that are not associated with a physical entity.

(issue ASTERISK-20175)
Reported by: Russell Bryant, Leif Madsen, Joshua Colp
Tested by: kmoore
patches:
  event-cachability-3.diff uploaded by jcolp (license 5000)
........

Merged revisions 378303 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 378320 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 378321 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 18:11:59 +00:00
Richard Mudgett a36f73447d Fix CCSS CLI commands and logger level not unregistered.
(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      ccss-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
........

Merged revisions 377037 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377038 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 377039 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 17:10:40 +00:00
Richard Mudgett f85db0e34d Things don't need to be that const.
........

Merged revisions 375658 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375659 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375661 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-02 21:01:33 +00:00
Andrew Latham 6c20cf2d8a Doxygen Updates - Title update
Update and extend the configuration_file group and enable linking. Commit other cleanups from multi-version Doxygen testing.  Update title that was left behind many years ago.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-18 14:17:40 +00:00
Mark Michelson e9ab568f88 Fix some potential misuses of ast_str in the code.
Passing an ast_str pointer by value that then calls
ast_str_set(), ast_str_set_va(), ast_str_append(), or
ast_str_append_va() can result in the pointer originally
passed by value being invalidated if the ast_str had
to be reallocated.

This fixes places in the code that do this. Only the
example in ccss.c could result in pointer invalidation
though since the other cases use a stack-allocated ast_str
and cannot be reallocated.

I've also updated the doxygen in strings.h to include
notes about potential misuse of the functions mentioned
previously.

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

Merged revisions 375025 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375026 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375027 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-15 21:25:29 +00:00
Matthew Jordan 9367893cff Destroy the generic_monitors container after the core_instances in ccss
For each item in core_instances disposed of in the shutdown of ccss, any
generic monitor instances referenced by the objects will be removed from
generic_monitors during their destruction.  Hilarity ensues if
generic_monitors no longer exists.

Thanks to the Asterisk Test Suite's generic_ccss test for complaining loudly
when it ran into this.
........

Merged revisions 374300 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374301 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-03 17:27:53 +00:00
Matthew Jordan a094707d51 Fix a variety of ref counting issues
This patch resolves a number of ref leaks that occur primarily on Asterisk
shutdown.  It adds a variety of shutdown routines to core portions of
Asterisk such that they can reclaim resources allocate duringd initialization.

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

Merged revisions 374177 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374178 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374196 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 01:47:16 +00:00
Andrew Latham fd98835f1f Doxygen Updates Janitor Work
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
* Add cleanup to Makefile for the Doxygen configuration update
* Start updating Doxygen configuration for cleaner output
* Enable inclusion of configuration files into documentation
* remove mantisworkflow...
* update documentation README
* Add markup to Tilghman's email and talk with him about updating his email, he knows...
* no code changes on this commit other than the mentioned Makefile change

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22 20:43:30 +00:00
Andrew Latham 6f61cb50c5 Doxygen Updates - janitor work
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style.  Some missing txt file links are removed but their content or essense will be included in some later updates.  A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen.

Further updates coming.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 17:14:59 +00:00
Kevin P. Fleming 79087cbbd5 Ensure that all ast_datastore_info structures are 'const'.
While addressing a bug, I came across a instance of 'struct ast_datastore_info'
that was not declared 'const'. Since the API already expects them to be
'const', this patch changes the declarations of all existing instances
that were not already declared that way.
........

Merged revisions 370183 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 370184 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-18 17:18:20 +00:00
Richard Mudgett f3bf3acbfd Check if PBX was started for generic CCSS recall.
........

Merged revisions 369238 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369239 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-22 21:06:36 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Richard Mudgett f8746d0009 Allow non-normal execution routines to be able to run on hungup channels.
* Make non-normal dialplan execution routines be able to run on a hung up
channel.  This is preparation work for hangup handler routines.

* Fixed ability to support relative non-normal dialplan execution
routines.  (i.e., The context and exten are optional for the specified
dialplan location.) Predial routines are the only non-normal routines that
it makes sense to optionally omit the context and exten.  Setting a hangup
handler also needs this ability.

* Fix Return application being able to restore a dialplan location
exactly.  Channels without a PBX may not have context or exten set.

* Fixes non-normal execution routines like connected line interception and
predial leaving the dialplan execution stack unbalanced.  Errors like
missing Return statements, popping too many stack frames using StackPop,
or an application returning non-zero could leave the dialplan stack
unbalanced.

* Fixed the AGI gosub application so it cleans up the dialplan execution
stack and handles the autoloop priority increments correctly.

* Eliminated the need for the gosub_virtual_context return location.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-14 23:22:53 +00:00
Kinsey Moore 8d1bde49a9 Fix case-sensitivity for device-specific event subscriptions and CCSS
This change fixes case-sensitivity for device-specific subscriptions such that
the technology identifier is case-insensitive while the remainder of the device
string is still case-sensitive.  This should also preserve the original case of
the device string as passed in to the event system.  CCSS is the only feature
affected as it is the only consumer of device-specific event subscriptions.

The second part of this patch addresses similar case-sensitivity issues within
CCSS itself that prevented it from functioning correctly after the fix to the
events system.

This adds a unit test to verify that the event system works as expected.

(closes issue ASTERISK-19422)
Review: https://reviewboard.asterisk.org/r/1780/
........

Merged revisions 357940 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 357941 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 21:06:12 +00:00
Terry Wilson a9d607a357 Opaquify ast_channel structs and lists
Review: https://reviewboard.asterisk.org/r/1773/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29 16:52:47 +00:00
Kinsey Moore 1fac2fba4b Deprecated macro usage for connected line, redirecting, and CCSS
This commit adds GoSub alternatives to connected line, redirecting, and CCSS
macro hooks so that macro can finally be deprecated.  This also adds
deprecation warnings for those features when used and in documentation.

Review: https://reviewboard.asterisk.org/r/1760/
(closes issue SWP-4256)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 16:50:19 +00:00
Kinsey Moore 4585ec1bbf Add missing newline to ccss state change notification
Move along, nothing to see here...
........

Merged revisions 356074 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-21 04:31:19 +00:00
Terry Wilson 57f42bd74f ast_channel opaquification of pointers and integral types
Review: https://reviewboard.asterisk.org/r/1753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 23:43:27 +00:00
Terry Wilson 34c55e8e7c Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 17:27:06 +00:00
Terry Wilson 04da92c379 Replace direct access to channel name with accessor functions
There are many benefits to making the ast_channel an opaque handle, from
increasing maintainability to presenting ways to kill masquerades. This patch
kicks things off by taking things a field at a time, renaming the field to
'__do_not_use_${fieldname}' and then writing setters/getters and converting the
existing code to using them. When all fields are done, we can move ast_channel
to a C file from channel.h and lop off the '__do_not_use_'.

This patch sets up main/channel_interal_api.c to be the only file that actually
accesses the ast_channel's fields directly. The intent would be for any API
functions in channel.c to use the accessor functions. No more monkeying around
with channel internals. We should use our own APIs.

The interesting changes in this patch are the addition of
channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
use accessor functions when ast_channel is really opaque), and some re-working
of the way channel iterators/callbacks are handled so as to avoid creating fake
ast_channels on the stack to pass in matching data by directly accessing fields
(since "name" is a stringfield and the fake channel doesn't init the
stringfields, you can't use the ast_channel_name_set() function). I went with
ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
setter.

The majority of the grunt-work for this change was done by writing a semantic
patch using Coccinelle ( http://coccinelle.lip6.fr/ ).

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 22:15:50 +00:00