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
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
Earlier versions of the codec_opus samples_count callback can return
negative error values on undecodable frames. This resulted in a divide by
zero exception.
* Added a defensive check in ast_codec_samples_count() for a "negative"
samples count return value. Log the event and set the count to zero.
ASTERISK-27194
Change-Id: Icf69350307ecbbc80a3d74de46af9bd80ea17819
The gist of this work ensures that when a remote SDP is received, it is
merged properly with the local capabilities. The remote SDP is converted
into a stream topology. That topology is then merged with the current
local topology on the SDP state. That new merged topology is then used
to create an SDP. Finally, adjustments are made to RTP instances based
on knowledge gained from the remote SDP.
There are also a battery of tests in this commit that ensure that some
basic SDP merges work as expected.
While this may not sound like a big change, it has the property that it
caused lots of ancillary changes.
* The remote SDP is no longer stored on the SDP state. Biggest reason:
there's no need for it. The remote SDP is used at the time it is being
set and nowhere else.
* Some new SDP APIs were added in order to find attributes and convert
generic SDP attributes into rtpmap structures.
* Writing tests made me realize that retrieving a value from an SDP
options structure, the SDP options needs to be made const.
* The SDP state machine was essentially gutted by a previous commit.
Initially, I attempted to reinstate it, but I found that as it had
been defined, it was not all that useful. What was more useful was
knowing the role we play in SDP negotiation, so the SDP state machine
has been transformed into an indicator of role.
* Rather than storing separate local and joint stream state
capabilities, it makes more sense to keep track of current stream
state and update it as things change.
Change-Id: I5938c2be3c6f0a003aa88a39a59e0880f8b2df3d
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
Adding format_name even to the end of ast_codec caused issued with
binary codec modules because the pointer would be garbage in asterisk
when they registered. So, the ast_codec structure was reverted and an
internal_ast_codec structure was created just for use in codec.c. A new
internal-only API was also added (__ast_codec_register_with_format) so
that codec_builtin could register codecs with the format_name in a
separate parameter rather than in the ast_codec structure.
ASTERISK-26144 #close
Reported-by: Alexei Gradinari
Change-Id: I6df1b08f6a6ae089db23adfe1ebc8636330265ba
If you create a local channel and don't specify an originator channel
to take capabilities from, we automatically add all audio formats to
the new channel's capabilities. When we try to make the channel
compatible with another, the "best format" functions pick the best
format available, which in this case will be slin192. While this is
great for preserving quality, it's the worst for performance and
overkill for the vast majority of applications.
In the absense of any other information, adding all formats is the
correct thing to do and it's not always possible to supply an
originator so a new parameter 'formats' has been added to the channel
create/originate functions. It's just a comma separated list of formats
to make availalble for the channel. Example: "ulaw,slin,slin16".
'formats' and 'originator' are mutually exclusive.
To facilitate determination of format names, the format name has been
added to "core show codecs".
ASTERISK-26070 #close
Change-Id: I091b23ecd41c1b4128d85028209772ee139f604b
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
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
When shutting down Asterisk the codecs are cleaned up. As a result anything
attempting to get a codec based on ID or details will find that no codec
exists. This currently occurs when determining the sample count of a frame.
This code did not take this situation into account.
This change fixes this by getting the codec directly from the format and
eliminates the lookup. This is both faster and also provides a guarantee
that the codec will exist and will be valid.
ASTERISK-24604 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4260/
........
Merged revisions 429497 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429498 65c4cc65-6c06-0410-ace0-fbb531ad65f3