Commit Graph

114 Commits

Author SHA1 Message Date
George Joseph 6f645a6d4e Merge "media: Add experimental support for RTCP feedback." 2017-01-27 07:04:52 -06:00
Richard Mudgett 2039eb8edf frame.c: Fix off-nominal format ref leaks.
* ast_frisolate() could leak frame format refs on allocation
failures.

* Similified code in ast_frisolate() and code used by
ast_frisolate().

Change-Id: I79566d4d36b3d7801bf0c8294fcd3e9a86a2ed6d
2017-01-24 14:02:51 -06:00
Lorenzo Miniero 1061539b75 media: Add experimental support for RTCP feedback.
This change adds experimental support for providing RTCP
feedback information to codec modules so they can dynamically
change themselves based on conditions.

ASTERISK-26584

Change-Id: Ifd6aa77fb4a7ff546c6025900fc2baf332c31857
2017-01-23 13:25:31 +01: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
Jacek Konieczny 8ed5f61152 frame.c: Copy the whole subclass in ast_frdup().
The problem is ast_frdup() does not copy whole frame.subclass for voice,
video and image frames, only the format is copied.  For video frames, the
subclass structure contains the .frame_ending flag used to put the RTP
marker where it needs to be.

ASTERISK-25894 #close

Change-Id: I812ca90e84ed5d4f473b997d0dd0d3c5a915fe33
2016-04-06 11:10:49 -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
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
Mark Michelson d44aefeef4 Fix stuck channel in ARI through the introduction of synchronous bridge actions.
Playing back a file to a channel in an ARI bridge would attempt to wait until
the playback concluded before returning. The method used involved signaling the
waiting thread in the ARI custom playback function.

The problem with this is that there were some corner cases that were not accounted for:
* If a bridge channel could not be found, then we never would attempt the playback but
  would still attempt to wait for the playback to complete.
* If the bridge playfile action failed to queue, we would still attempt to wait for the
  playback to complete.
* If the bridge playfile action were queued but some circumstance caused the playback
  not to occur (the bridge dies, the channel is removed from the bridge), then we would
  never be notified.

The solution to this is to move the waiting logic into the bridge code. A new bridge
API function is added to queue a synchronous action on a bridge. The waiting thread
is notified when the queued frame has been freed, either due to an error occurring
or due to successful playback. As a failsafe, the waiting thread has a 10 minute
timeout just in case there is a frame leak somewhere.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-17 17:22:12 +00:00
Scott Griepentrog 2b14601bdc pjsip: fix support for allow=all
This change adds improvements to support for allow=all in
pjsip.conf so that it functions as intended.  Previously,
the allow/disallow socery configuration would set & clear
codecs from the media.codecs and media.prefs list, but if
all was specified the prefs list was not updated.  Then a
call would fail when create_outgoing_sdp_stream() created
an SDP with no audio codecs.

A new function ast_codec_pref_append_all() is provided to
add all codecs to the prefs list - only those not already
on the list.  This enables the configuration to specify a
codec preference, but still add all codecs, and even then
remove some codecs, as shown in this example:

allow = ulaw, alaw, all, !g729, !g723

Also, the display order of allow in cli output is updated
to match the configuration by using prefs instead of caps
when generating a human readable string.

Finally, a change to create_outgoing_sdp_stream() skips a
codec when it does not have a payload code instead of the
call failing.

(closes issue ASTERISK-23018)
Reported by: xrobau
Review: https://reviewboard.asterisk.org/r/3131/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405876 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-17 21:33:26 +00:00
Matthew Jordan 4d348e853c Add pass through support for Opus and VP8; Opus format attribute negotiation
This patch adds pass through support for Opus and VP8. That includes:

* Format attribute negotiation for Opus. Note that unlike some other codecs,
  the draft RFC specifies having spaces delimiting the attributes in addition
  to ';', so you have "attra=X; attrb=Y". This broke the attribute parsing in
  chan_sip, so a small tweak was also included in this patch for that.

* A format attribute negotiation module for Opus, res_format_attr_opus

* Fast picture update for VP8. Since VP8 uses a different RTCP packet number
  than FIR, this really is specific to VP8 at this time.

Note that the format attribute negotiation in res_pjsip_sdp_rtp was written
by mjordan. The rest of this patch was written completely by Lorenzo Miniero.

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

(closes issue ASTERISK-21981)
Reported by: Tzafrir Cohen
patches:
  asterisk_opus+vp8_passthrough_20130718.patch uploaded by lminiero (License 6518)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 15:42:27 +00:00
Richard Mudgett 3d63833bd6 Merge in the bridge_construction branch to make the system use the Bridging API.
Breaks many things until they can be reworked.  A partial list:
chan_agent
chan_dahdi, chan_misdn, chan_iax2 native bridging
app_queue
COLP updates
DTMF attended transfers
Protocol attended transfers


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-21 18:00:22 +00:00
David M. Lee a2a53cc306 Stasis application WebSocket support
This is the API that binds the Stasis dialplan application to external
Stasis applications. It also adds the beginnings of WebSocket
application support.

This module registers a dialplan function named Stasis, which is used
to put a channel into the named Stasis app. As a channel enters and
leaves the Stasis diaplan application, the Stasis app receives a
'stasis-start' and 'stasis-end' events.

Stasis apps register themselves using the stasis_app_register and
stasis_app_unregister functions. Messages are sent to an application
using stasis_app_send.

Finally, Stasis apps control channels through the use of the
stasis_app_control object, and the family of stasis_app_control_*
functions.

Other changes along for the ride are:
 * An ast_frame_dtor function that's RAII_VAR safe
 * Some common JSON encoders for name/number, timeval, and
   context/extension/priority

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-08 13:27:45 +00:00
Richard Mudgett 32ac38ea37 Improve func FRAME_TRACE DTMF digit format.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-31 18:15:49 +00:00
Kevin P. Fleming af3ef19d00 Rewrite a comment that didn't adequately explain the code it was documenting.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-24 16:54:26 +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
Kinsey Moore bdab2763ac Add HANGUPCAUSE hash support to IAX2
Continuing with the Who Hung Up? project for Asterisk 11, this adds
support to IAX2 for the HANGUPCAUSE hash.

Additionally, this breaks out some functionality in frame.c for getting
information about frame types and subclasses.

Review: https://reviewboard.asterisk.org/r/1941/
(issue SWP-4222)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:17:12 +00:00
Kinsey Moore c5b3db1956 Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these
whitespace-only changes didn't break anything (and shouldn't have).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22 19:51:16 +00:00
Tilghman Lesher f03bccdb4d Implement the '!' negation element to negate codecs directly in the allow keyword.
This permits the list of codecs to be specified in one configuration line,
instead of two or more, generally with the aim of either allowing all codecs
with the exception of a few or disallowing most but permitting a few.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 00:54:36 +00:00
David Vossel 513c680b8c Adds pass-through support for codec CELT.
This patch adds pass-through support for CELT.  CELT
formats are defined in codecs.conf and can be configured
to any sample rate a CELT endpoint supports.  This patch also
addresses a crash in channel.c resulting from a frame list being
freed incorrectly.  This crash was discovered while testing a CELT
translator which had to split encoded audio into multiple frames.
The codec translator is not a part of this patch, but may be
contributed in the future.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-07 19:39:17 +00:00
Matthew Nicholson 82d28452ca copy all flags on asterisk frames instead of just the timing flag
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@325815 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-30 18:19:31 +00:00
David Vossel d760e81f37 Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd audio ConfBridge, and other stuff
-Functional changes
1. Dynamic global format list build by codecs defined in codecs.conf
2. SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf
3. Negotiation of SILK attributes in chan_sip.
4. SPEEX 32khz with translation
5. SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation
   using codec_resample.c
6. Various changes to RTP code required to properly handle the dynamic format list
   and formats with attributes.
7. ConfBridge now dynamically jumps to the best possible sample rate.  This allows
   for conferences to take advantage of HD audio (Which sounds awesome)
8. Audiohooks are no longer limited to 8khz audio, and most effects have been
   updated to take advantage of this such as Volume, DENOISE, PITCH_SHIFT.
9. codec_resample now uses its own code rather than depending on libresample.

-Organizational changes
Global format list is moved from frame.c to format.c
Various format specific functions moved from frame.c to format.c

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-22 23:04:49 +00:00
Jason Parker 7f76b3d573 Modify alignment of 'core show codecs', since the ID is no longer a huge int.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 18:37:06 +00:00
David Vossel 63f5a80a3b Fixes output of "core show codecs" to display image types correctly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 18:12:57 +00:00
David Vossel c26c190711 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 16:22:10 +00:00
David Vossel b00f58da25 adds speex 16khz audio support
(closes issue #17501)
Reported by: fabled
Patches:
      asterisk-trunk-speex-wideband-v2.patch uploaded by fabled (license 448)
Tested by: malcolmd, fabled, dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@271231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-17 17:23:43 +00:00
David Vossel fcb055fb4e addition of G.719 pass-through support
(closes issue #16293)
Reported by: malcolmd
Patches:
      g719.passthrough.patch.7 uploaded by malcolmd (license 924)
      format_g719.c uploaded by malcolmd (license 924)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-16 19:03:24 +00:00
Tilghman Lesher 479ce4351e Merged revisions 269960 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r269960 | tilghman | 2010-06-11 13:23:05 -0500 (Fri, 11 Jun 2010) | 8 lines
  
  For SpeeX, 0 bits remaining is valid and does not need an emitted warning.
  
  (closes issue #15762)
   Reported by: nblasgen
   Patches: 
         issue15672.patch uploaded by pabelanger (license 224)
   Tested by: nblasgen
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-11 18:31:14 +00:00
Julian Lyndon-Smith d85650e4aa Added MixMonitorMute manager command
Added a new manager command to mute/unmute MixMonitor audio on a channel. 
Added a new feature to audiohooks so that you can mute either read / write
(or both) types of frames - this allows for MixMonitor to mute either side
of the conversation without affecting the conversation itself.

(closes issue #16740)
Reported by: jmls

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-21 11:27:27 +00:00
Jeff Peeler 1d293d0093 Fix crash resulting from frames with invalid data pointers.
In ast_frdup the frame data union does not get set to point to malloced memory 
if the datalen is zero, so make sure to handle the same case in ast_frisolate
appropriately.

(closes issue #16058)
Reported by: atis
Patches: 
      bug16058-fix.patch uploaded by jpeeler (license 325)
Tested by: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26 18:07:57 +00:00
Tilghman Lesher 9c1b53cab4 According to POSIX, the capital L modifier applies only to floating point types.
Fixes a crash on Solaris.
(closes issue #16572)
 Reported by: crjw
 Patches: 
       frame_changes.patch uploaded by crjw (license 963)
       Plus several others found and fixed by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-10 19:37:30 +00:00
Richard Mudgett 97de30df8f Fix compiler warning gcc 4.2.4 found
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 19:53:08 +00:00
Tilghman Lesher 2e4832734a Rework codecs command to comply with the 64-bit scheme
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-05 17:26:55 +00:00
Mark Michelson 2f4b5c8bb5 Add a couple more casts so that code compiles correctly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 16:41:02 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
Russell Bryant cd10bd931a Merged revisions 224931 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224931 | russell | 2009-10-20 21:59:54 -0500 (Tue, 20 Oct 2009) | 5 lines
  
  Isolate frames returned from a DSP instance or codec translator.
  
  The reasoning for these changes are the same as what I wrote in the commit
  message for rev 222878.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 03:09:04 +00:00
Russell Bryant dd50b9e8b5 Merged revisions 222878 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222878 | russell | 2009-10-08 14:45:47 -0500 (Thu, 08 Oct 2009) | 44 lines
  
  Make filestream frame handling safer by isolating frames before returning them.
  
  This patch is related to a number of issues on the bug tracker that show
  crashes related to freeing frames that came from a filestream.  A number of
  fixes have been made over time while trying to figure out these problems, but
  there re still people seeing the crash.  (Note that some of these bug reports
  include information about other problems.  I am specifically addressing
  the filestream frame crash here.)
  
  I'm still not clear on what the exact problem is.  However, what is _very_
  clear is that we have seen quite a few problems over time related to unexpected
  behavior when we try to use embedded frames as an optimization.  In some cases,
  this optimization doesn't really provide much due to improvements made in other
  areas.
  
  In this case, the patch modifies filestream handling such that the embedded frame
  will not be returned.  ast_frisolate() is used to ensure that we end up with a
  completely mallocd frame.  In reality, though, we will not actually have to malloc
  every time.  For filestreams, the frame will almost always be allocated and freed
  in the same thread.  That means that the thread local frame cache will be used.
  So, going this route doesn't hurt.
  
  With this patch in place, some people have reported success in not seeing the
  crash anymore.
  
  (SWP-150)
  (AST-208)
  (ABE-1834)
  
  (issue #15609)
  Reported by: aragon
  Patches:
        filestream_frisolate-1.4.diff2.txt uploaded by russell (license 2)
  Tested by: aragon, russell
  
  (closes issue #15817)
  Reported by: zerohalo
  Tested by: zerohalo
  
  (closes issue #15845)
  Reported by: marhbere
  
  Review: https://reviewboard.asterisk.org/r/386/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-08 19:52:03 +00:00
Kevin P. Fleming cf0076c5f3 Ensure that frame dumps of AST_CONTROL_T38_PARAMETERS frames are properly
decoded.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-01 19:50:48 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Kevin P. Fleming 0a6e06c7ff Rework of T.38 negotiation and UDPTL API to address interoperability problems
Over the past couple of months, a number of issues with Asterisk
negotiating (and successfully completing) T.38 sessions with various
endpoints have been found. This patch attempts to address many of
them, primarily focused around ensuring that the endpoints'
MaxDatagram size is honored, and in addition by ensuring that T.38
session parameter negotiation is performed correctly according to the
ITU T.38 Recommendation.

The major changes here are:

1) T.38 applications in Asterisk (app_fax) only generate/receive IFP
packets, they do not ever work with UDPTL packets. As a result of
this, they cannot be allowed to generate packets that would overflow
the other endpoints' MaxDatagram size after the UDPTL stack adds any
error correction information. With this patch, the application is told
the maximum *IFP* size it can generate, based on a calculation using
the far end MaxDatagram size and the active error correction mode on
the T.38 session. The same is true for sending *our* MaxDatagram size
to the remote endpoint; it is computed from the value that the
application says it can accept (for a single IFP packet) combined with
the active error correction mode.

2) All treatment of T.38 session parameters as 'capabilities' in
chan_sip has been removed; these parameters are not at all like
audio/video stream capabilities. There are strict rules to follow for
computing an answer to a T.38 offer, and chan_sip now follows those
rules, using the desired parameters from the application (or channel)
that wants to accept the T.38 negotiation.

3) chan_sip now stores and forwards ast_control_t38_parameters
structures for tracking 'our' and 'their' T.38 session parameters;
this greatly simplifies negotiation, especially for pass-through
calls.

4) Since T.38 negotiation without specifying parameters or receiving
the final negotiated parameters is not very worthwhile, the
AST_CONTROL_T38 control frame has been removed. A note has been added
to UPGRADE.txt about this removal, since any out-of-tree applications
that use it will no longer function properly until they are upgraded
to use AST_CONTROL_T38_PARAMETERS.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-23 21:57:24 +00:00
Joshua Colp 59c1998d67 Improve T.38 negotiation by exchanging session parameters between application and channel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 19:27:24 +00:00
Kevin P. Fleming 4c0265664e Merged revisions 200991 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r200991 | kpfleming | 2009-06-16 12:05:38 -0500 (Tue, 16 Jun 2009) | 11 lines
  
  Improve support for media paths that can generate multiple frames at once.
  
  There are various media paths in Asterisk (codec translators and UDPTL, primarily)
  that can generate more than one frame to be generated when the application calling
  them expects only a single frame. This patch addresses a number of those cases,
  at least the primary ones to solve the known problems. In addition it removes the
  broken TRACE_FRAMES support, fixes a number of bugs in various frame-related API
  functions, and cleans up various code paths affected by these changes.
  
  https://reviewboard.asterisk.org/r/175/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16 18:54:30 +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
Joshua Colp 80bdf0f520 Merged revisions 195206 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r195206 | file | 2009-05-18 12:51:22 -0300 (Mon, 18 May 2009) | 7 lines
  
  Fix a typo which caused loss of audio when using G729 in some scenarios with a smoother present.
  
  (closes issue #15105)
  Reported by: bamby
  Patches:
        process-vad-correctly.diff uploaded by bamby (license 430)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 15:53:26 +00:00
Kevin P. Fleming 2f24689b49 Merged revisions 180372 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r180372 | kpfleming | 2009-03-05 12:22:16 -0600 (Thu, 05 Mar 2009) | 9 lines
  
  Fix problems when RTP packet frame size is changed
  
  During some code analysis, I found that calling ast_rtp_codec_setpref() on an ast_rtp session does not work as expected; it does not adjust the smoother that may on the RTP session, in fact it summarily drops it, even if it has data in it, even if the current format's framing size has not changed. This is not good.
  
  This patch changes this behavior, so that if the packetization size for the current format changes, any existing smoother is safely updated to use the new size, and if no smoother was present, one is created. A new API call for smoothers, ast_smoother_reconfigure(), was required to implement these changes.
  
  Review: http://reviewboard.digium.com/r/184/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-05 18:29:38 +00:00
Kevin P. Fleming b2d959c7fa fix two very minor bugs: if anyone ever uses SLINEAR16 as a format in RTP, ensure that the samples are byte-swapped to network order if needed. also, when a smoother is operating on a format that has a sample rate other than 8000 samples per second, use the proper sample rate for computing delivery timestamps.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18 23:09:58 +00:00
Kevin P. Fleming 2a53f2ec98 Add basic (passthrough, playback, record) support for ITU G.722.1 and G.722.1C (also known as Siren7 and Siren14)
This patch adds passthrough, file recording and file playback support for the codecs listed above, with negotiation over SIP/SDP supported. Due to Asterisk's current limitation of treating a codec/bitrate combination as a unique codec, only G.722.1 at 32 kbps and G.722.1C at 48 kbps are supported.

Along the way, some related work was done:

1) The rtpPayloadType structure definition, used as a return result for an API call in rtp.h, was moved from rtp.c to rtp.h so that the API call was actually usable. The only previous used of the API all was chan_h323.c, which had a duplicate of the structure definition instead of doing it the right way.

2) The hardcoded SDP sample rates for various codecs in chan_sip.c were removed, in favor of storing these sample rates in rtp.c along with the codec definitions there. A new API call was added to allow retrieval of the sample rate for a given codec.

3) Some basic 'a=fmtp' parsing for SDP was added to chan_sip, because chan_sip *must* decline any media streams offered for these codecs that are not at the bitrates that we support (otherwise Bad Things (TM) would result).

Review: http://reviewboard.digium.com/r/158/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-13 13:35:24 +00:00
Russell Bryant 5a5cb18f54 Make sure we handle a uint32_t payload in ast_frdup()
(closes issue #14080)
Reported by: fnordian
Patches:
      frame.patch uploaded by fnordian (license 110)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 21:53:30 +00:00
Eliel C. Sardanons 1e8e12efcf Janitor, use ARRAY_LEN() when possible.
(closes issue #13990)
Reported by: eliel
Patches:
      array_len.diff uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 10:31:25 +00:00
Tilghman Lesher 3d4c0cd421 Merged revisions 160207 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r160207 | tilghman | 2008-12-01 18:25:16 -0600 (Mon, 01 Dec 2008) | 3 lines
  
  Ensure that Asterisk builds with --enable-dev-mode, even on the latest gcc
  and glibc.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 00:37:21 +00:00