asterisk/asterisk.git
5 years agoPSJIP - sip.conf to res_sip.conf script
Kevin Harwell [Fri, 23 Aug 2013 17:45:05 +0000 (17:45 +0000)]
PSJIP - sip.conf to res_sip.conf script

Most, if not all, of the backing features of a conf file should now be
implemented (e.g. multi-line comments, includes, templates, etc...).  A
few of the options still need to be mapped.  Those are currently listed
in the 'sip_to_res_sip.py' file.

Things to do:

(1) There is more work to do here, at least for the sip.conf items that
aren't currently parsed. An issue will be created for that.
(2) All of the scripts should probably be passed through pylint and have
as many PEP8 issues fixed as possible.
(3) A public review is probably warranted at that point of the entire script.

Reported by: Matt Jordan

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397567 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoARI: Correct error codes for bridge operations
David M. Lee [Fri, 23 Aug 2013 17:19:02 +0000 (17:19 +0000)]
ARI: Correct error codes for bridge operations

This patch adds error checking to ARI bridge operations, when
adding/removing channels to/from bridges.

In general, the error codes fall out as follows:
 * Bridge not found - 404 Not Found
 * Bridge not in Stasis - 409 Conflict
 * Channel not found - 400 Bad Request
 * Channel not in Stasis - 422 Unprocessable Entity
 * Channel not in this bridge (on remove) - 422 Unprocessable Entity

(closes issue ASTERISK-22036)
Review: https://reviewboard.asterisk.org/r/2769/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397565 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoUpdate CHANGES file to reflect pass through support for Opus/VP8
Matthew Jordan [Fri, 23 Aug 2013 15:49:50 +0000 (15:49 +0000)]
Update CHANGES file to reflect pass through support for Opus/VP8

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397527 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAdd pass through support for Opus and VP8; Opus format attribute negotiation
Matthew Jordan [Fri, 23 Aug 2013 15:42:27 +0000 (15:42 +0000)]
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

5 years agoUpdate config framework/sorcery with types/options without documentation
Matthew Jordan [Fri, 23 Aug 2013 15:21:40 +0000 (15:21 +0000)]
Update config framework/sorcery with types/options without documentation

There are times when a configuration option should not have documentation.

1. Some options are registered with a particular object merely as a warning to
   users. These options aren't even really 'deprecated' - which has its own
   separate API call - they are actually provided by a different configuration
   file. The options are merely registered so that the user gets a warning that
   a different configuration file provides the item.

2. Some object types - most notably some used by modules that use sorcery - are
   completely internal and should never be shown to the user.

3. Sorcery itself has several 'hidden' fields that should never be shown to a
   user.

This patch updates the configuration framework and sorcery with additional API
calls that allow a module to register types as internal and options as not
requiring documentation. This bypasses the XML documentation checking.

This patch also re-enables the strict XML documentation checking in trunk, as
well as updates some documentation that was missing.

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

(closes issue ASTERISK-22359)
Reported by: Matt Jordan

(closes issue ASTERISK-22112)
Reported by: Rusty Newton

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397524 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix crash when answering after a transport error occurs.
Joshua Colp [Fri, 23 Aug 2013 13:58:08 +0000 (13:58 +0000)]
Fix crash when answering after a transport error occurs.

If a response to an initial incoming INVITE results in a transport error
the INVITE transaction is removed from the INVITE session. Any attempts
to answer the INVITE session after this results in a crash as it requires
the INVITE transaction to exist. This change explicitly locks the dialog
and checks to ensure that the INVITE transaction exists before answering.

(closes issue AST-1203)
Reported by: John Bigelow

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397515 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoUpdate CEL sample config
Kinsey Moore [Fri, 23 Aug 2013 13:18:51 +0000 (13:18 +0000)]
Update CEL sample config

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397514 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoARI: Music on Hold/Background Music for bridges
Jonathan Rose [Fri, 23 Aug 2013 00:26:19 +0000 (00:26 +0000)]
ARI: Music on Hold/Background Music for bridges

Adds ARI functions to be able to turn on/off music on hold in a
bridge. It actually functions more as a background music without
further actions on the bridge since if the rest of the channels
in the bridge aren't explicitly muted, they will still be able
to communicate.

(closes issue ASTERISK-21974)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2688/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397505 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoMinor tweaks with ast_moh_start() callers.
Richard Mudgett [Thu, 22 Aug 2013 23:15:14 +0000 (23:15 +0000)]
Minor tweaks with ast_moh_start() callers.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397494 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAdd SayAlphaCase and similar functionality for AGI
Kinsey Moore [Thu, 22 Aug 2013 22:33:48 +0000 (22:33 +0000)]
Add SayAlphaCase and similar functionality for AGI

This adds a new dialplan application, SayAlphaCase, that performs much
the same function as SayAlpha except that it takes additional options
which allow the user to specify whether the case of each letter should
be announced for uppercase, lowercase, or all letters. Similar
functionality has been added to the SAY ALPHA AGI command via an
optional parameter.

Original Patch by: Kevin Scott Adams
Reported by: Kevin Scott Adams
Review: https://reviewboard.asterisk.org/r/2725/
(closes issue ASTERISK-20782)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397493 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agores_sip_dtmf_info: Support sending of 'raw' DTMF
Kevin Harwell [Thu, 22 Aug 2013 22:09:16 +0000 (22:09 +0000)]
res_sip_dtmf_info: Support sending of 'raw' DTMF

Added the ability to handle 'raw' DTMF within the body of an INFO message.
Also made it so values 10-16 are mapped to valid DTMF values.

(closes issue ASTERISK-22144)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2776/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397484 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAdd missing configOption close tags
Kinsey Moore [Thu, 22 Aug 2013 21:39:10 +0000 (21:39 +0000)]
Add missing configOption close tags

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397483 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoUpdate MOH start/stop routine doxygen.
Richard Mudgett [Thu, 22 Aug 2013 21:29:16 +0000 (21:29 +0000)]
Update MOH start/stop routine doxygen.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397482 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix missing xml doc configOption 'type' for for both 'system' and 'global' configObjects
Rusty Newton [Thu, 22 Aug 2013 21:21:25 +0000 (21:21 +0000)]
Fix missing xml doc configOption 'type' for for both 'system' and 'global' configObjects

(issue ASTERISK-22344)
(closes issue ASTERISK-22344)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397481 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoBridge API: Set a cause code on a channel when it is ejected from a bridge.
Richard Mudgett [Thu, 22 Aug 2013 21:09:52 +0000 (21:09 +0000)]
Bridge API: Set a cause code on a channel when it is ejected from a bridge.

The cause code needs to be passed from the disconnecting channel to the
bridge peers if the disconnecting channel dissolves the bridge.

* Made the call to an app_agent_pool agent disconnect with the busy cause
code if the agent does not ack the call in time or hangs up before acking
the call.

(closes issue ASTERISK-22042)
Reported by: Matt Jordan

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397472 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoEnsure CEL creates a default config if it isn't provided with one
Kinsey Moore [Thu, 22 Aug 2013 20:29:15 +0000 (20:29 +0000)]
Ensure CEL creates a default config if it isn't provided with one

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397471 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoRemove set but unused variable 'meid'.
Mark Michelson [Thu, 22 Aug 2013 20:18:27 +0000 (20:18 +0000)]
Remove set but unused variable 'meid'.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397466 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix crash when getting CEL config
Kinsey Moore [Thu, 22 Aug 2013 19:52:59 +0000 (19:52 +0000)]
Fix crash when getting CEL config

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397461 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoMassively clean up app_queue.
Mark Michelson [Thu, 22 Aug 2013 18:52:41 +0000 (18:52 +0000)]
Massively clean up app_queue.

This essentially makes app_queue usable again. From reviewboard:

* Reporting of transfers and call completion is done by creating stasis
  subscriptions and listening for specific events in order to determine
  when the call is finished (either via a transfer or hangup).
* Dial end messages have been added where they were previously missing.
* Queue stats are properly being updated again once calls have finished.
* AgentComplete stasis messages and AMI events are now occurring again.
* Mixmonitor starting has been factored into its own function and uses the
  Mixmonitor API now instead of using ast_pbx_run()

In addition to the changes in app_queue, there are several supplementary changes as well:

* Queue logging now differentiates between attended and blind transfers. A
  note about this is in the CHANGES file.
* Local channel optimization events now report more information. This
  includes which of the two local channels involved is the destination of
  the optimization, the channel that is replacing the destination local channel,
  and an identifier so that begin and end events can be matched to each other.
  The end events are now sent whether the optimization was successful or not and
  includes an indicator of whether the optimization was successful.
* Changes were made to features and bridging_basic so that additional flags may
  be set on a bridge. This is necessary because the queue requires that its
  bridge only allows move-swap local channel optimizations into the bridge.

(closes issue ASTERISK-21517)
Reported by Matt Jordan

(closes issue ASTERISK-21943)
Reported by Matt Jordan

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397451 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoHandle default body types for SIP event packages in res_pjsip_pubsub
Mark Michelson [Thu, 22 Aug 2013 17:42:37 +0000 (17:42 +0000)]
Handle default body types for SIP event packages in res_pjsip_pubsub

Prior to this change, we would reject SUBSCRIBE requests that had no Accept
headers. Now event package handlers that handle the default type for the
event package indicate that they do so. Therefore, if we have a handler that
can handle the default type, we can allow SUBSCRIBEs for the handler's event
package that have no Accept headers.

(closes issue ASTERISK-22067)
reported by Mark Michelson

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397441 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoMade the abstract jitter buffer resync on some more control frames.
Richard Mudgett [Thu, 22 Aug 2013 17:34:46 +0000 (17:34 +0000)]
Made the abstract jitter buffer resync on some more control frames.

Resync the abstract jitter buffer on the following additional control
frames:
AST_CONTROL_HOLD
AST_CONTROL_UNHOLD
AST_CONTROL_T38_PARAMETERS

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397440 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoMake CEL behavior conform to the documentation
Kinsey Moore [Thu, 22 Aug 2013 17:13:16 +0000 (17:13 +0000)]
Make CEL behavior conform to the documentation

This modifies the behavior of the CEL engine to conform to documented
behavior for Asterisk 12 as defined on the wiki
https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+CEL+Specification

The primary changes deal with removal of the peer field from function
calls since it is no longer directly relevant to the bridging system
and removal of the layer of CDR-like business logic that was providing
a partial emulation of Asterisk 11 CEL functionality. With this change,
there is no longer a distinction between "bridges" and "conferences"
and all participation changes are denoted with bridge enter and bridge
exit messages.

This updates the CEL unit tests to handle these changes and simplifies
some of the macros used in the process.

This also fixes a segfault when attempting to ref a configuration that
failed to load.

Review: https://reviewboard.asterisk.org/r/2788/
(issue ASTERISK-21567)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397431 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoUpdate BUGBUG comment.
Richard Mudgett [Thu, 22 Aug 2013 16:46:01 +0000 (16:46 +0000)]
Update BUGBUG comment.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397426 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoDon't store repeated commands in the editline history buffer.
Walter Doekes [Thu, 22 Aug 2013 12:28:33 +0000 (12:28 +0000)]
Don't store repeated commands in the editline history buffer.

The equivalent of bash HISTCONTROL=ignoredups.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397415 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAdd _IO_stdin_used in version-script to fix SIGBUSes on Sparc.
Walter Doekes [Thu, 22 Aug 2013 08:26:55 +0000 (08:26 +0000)]
Add _IO_stdin_used in version-script to fix SIGBUSes on Sparc.

The --version-script,asterisk.exports linker flag (and the module
exports) didn't provide _IO_stdin_used in the list of exported symbols.
That causes some kind of libc compatibility mode to kick in, where
stdio file structures (stdout/stderr) land somewhere else. In the
case of the Sparc, they landed on misaligned memory.

This became apparent first after r376428 (Reorder startup sequence)
when a lot of ast_log's were replaced with fprintf's. Writing to
stderr triggered a SIGBUS. (Compared to x86 and amd64 architectures,
the Sparc is very picky about memory alignment.)

(issue ASTERISK-21763)
(issue ASTERISK-21665)

Reported by: Jeremy Kister
Review: https://reviewboard.asterisk.org/r/2760/
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397379 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoUDPTL: Fix a regression where UDPTL won't load default settings
Jonathan Rose [Wed, 21 Aug 2013 23:09:14 +0000 (23:09 +0000)]
UDPTL: Fix a regression where UDPTL won't load default settings

If the file udptl.conf is unavailable at startup, UDPTL will fail to
initialize and while it makes some noise, it isn't immediately
obvious why consumers start to fail when using it. This patch makes
UDPTL load as though an empty config was provided  when udptl is
unavailable at startup.

(closes issue ASTERISK-22349)
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/2773/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397366 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years ago* Move ast_bridge_channel_setup_features() into bridge_basic.c.
Richard Mudgett [Wed, 21 Aug 2013 20:02:24 +0000 (20:02 +0000)]
* Move ast_bridge_channel_setup_features() into bridge_basic.c.

* Made application map hooks be removed on a basic bridge personality
change.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397355 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoDeferred some more BUGBUG comments to a JIRA issue or XXX comment.
Richard Mudgett [Wed, 21 Aug 2013 18:58:28 +0000 (18:58 +0000)]
Deferred some more BUGBUG comments to a JIRA issue or XXX comment.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397346 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoComplete http_shutdown.
David M. Lee [Wed, 21 Aug 2013 17:12:30 +0000 (17:12 +0000)]
Complete http_shutdown.

This patch frees up some resources allocated in http.c.
 * tcp listeners stopped
 * tls settings freed
 * uri redirects freed
 * unregister internal http.c uri's

(closes issue ASTERISK-22237)
Reported by: Corey Farrell

Patches:
    http.patch uploaded by Corey Farrell (license 5909)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397310 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoSet 14400 as the default max bit rate if T38MaxBitRate is not specified
Matthew Jordan [Wed, 21 Aug 2013 16:31:58 +0000 (16:31 +0000)]
Set 14400 as the default max bit rate if T38MaxBitRate is not specified

If an endpoint fails to include the T38MaxBitRate attribute during negotiation,
Asterisk will negotiate a bit rate of 2400 instead of the ITU recommended
bit rate of 14400. This patch fixes this by making AST_T38_RATE_14400 the
'default' value of the enum by assigning it a value of 0, such that if an
endpoint fails to include the attribute, the default will be 14400.

Note that Walter Doekes included the nice comment in frame.h about why we are
purposefully assigning AST_T38_RATE_14400 a value of 0.

(closes issue ASTERISK-22275)
Reported by: Andreas Steinmetz
patches:
  fax-fix.patch uploaded by anstein (License 6523)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397307 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoARI: Correct segfault with /variable calls are missing ?variable parameter.
David M. Lee [Wed, 21 Aug 2013 16:23:59 +0000 (16:23 +0000)]
ARI: Correct segfault with /variable calls are missing ?variable parameter.

Both /asterisk/variable and /channel/{channelId}/variable requires a
?variable parameter to be passed into the query. But we weren't checking
for the parameter being missing, which caused a segfault.

All calls now properly return 400 Bad Request errors when the parameter
is missing. The Swagger api-docs were updated accordingly.

(closes issue ASTERISK-22273)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397306 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoARI: Remove the 'channel:' scheme from endpoint's channel list.
David M. Lee [Wed, 21 Aug 2013 16:09:09 +0000 (16:09 +0000)]
ARI: Remove the 'channel:' scheme from endpoint's channel list.

For times when a reference in ARI might be ambiguous, the reference is
built as an URI (such as channel:1376341790.3).

An endpoint's channel list is not ambiguous, and in fact the field is
named 'channel_ids', but it had channel URI's instead of channel id's.
This patch changes the list to be the raw id instead of the URI.

(closes issue ASTERISK-22291)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397297 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agores_stasis: remove call to missing function control_continue.
David M. Lee [Wed, 21 Aug 2013 16:00:10 +0000 (16:00 +0000)]
res_stasis: remove call to missing function control_continue.

In the shuffling around of res_stasis, control_continue was renamed to
stasis_app_control_continue, but the call in res_stasis wasn't updated.
In looking into it, it turns out it wasn't really the right thing to do
in res_stasis anyways.

This patch changes the handling of received a AST_CONTROL_HANGUP frame
to be the same as receiving a NULL frame, and removed the declaration of
control_continue(), since it doesn't exist any more.

(closes issue ASTERISK-22292)
Reported by: Denis Smirnov

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397295 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix several interrelated issues dealing with the holding bridge technology.
Richard Mudgett [Wed, 21 Aug 2013 15:51:19 +0000 (15:51 +0000)]
Fix several interrelated issues dealing with the holding bridge technology.

* Added an option flags parameter to interval hooks.  Interval hooks now
can specify if the callback will affect the media path or not.

* Added an option flags parameter to the bridge action custom callback.
The action callback now can specify if the callback will affect the media
path or not.

* Made the holding bridge technology reexamine the participant idle mode
option whenever the entertainment is restarted.

* Fixed app_agent_pool waiting agents needlessly starting and stopping MOH
every second by specifying the heartbeat interval hook as not affecting
the media path.

* Fixed app_agent_pool agent alert from restarting the MOH after the alert
beep.  The agent entertainment is now changed from MOH to silence after
the alert beep.

* Fixed holding bridge technology to defer starting the entertainment.  It
was previously a mixture of immediate and deferred.

* Fixed holding bridge technology to immediately stop the entertainment.
It was previously a mixture of immediate and deferred.  If the channel
left the bridging system, any deferred stopping was discarded before
taking effect.

* Miscellaneous holding bridge technology rework coding improvements.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397294 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoPrevent a crash on outbound SIP MESSAGE requests.
Mark Michelson [Wed, 21 Aug 2013 14:39:17 +0000 (14:39 +0000)]
Prevent a crash on outbound SIP MESSAGE requests.

If a From header on an outbound out-of-call SIP MESSAGE were
malformed, the result could crash Asterisk.

In addition, if a From header on an incoming out-of-call SIP
MESSAGE request were malformed, the message was happily accepted
rather than being rejected up front. The incoming message path
would not result in a crash, but the behavior was bad nonetheless.

(closes issue ASTERISK-22185)
reported by Zhang Lei
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397255 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAllow channels in app_stasis to hangup properly
Kinsey Moore [Wed, 21 Aug 2013 14:08:23 +0000 (14:08 +0000)]
Allow channels in app_stasis to hangup properly

This detects hangups that occur while bridged to allow channels to exit
app_stasis even if the hangup frame was absorbed by the bridge the
channel was in.

Reported by: David Lee
(closes issue ASTERISK-22297)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397244 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAllow the SIP_CODEC family of variables to specify more than one codec
Matthew Jordan [Wed, 21 Aug 2013 13:41:05 +0000 (13:41 +0000)]
Allow the SIP_CODEC family of variables to specify more than one codec

The SIP_CODEC family of variables let you set the preferred codec to be
offered on an outbound INVITE request. However, for video calls, you need to
be able to set both the audio and video codecs to be offered. This patch lets
the SIP_CODEC variables accept a comma delineated list of codecs. The first
codec in the list is set as the preferred codec; additional codecs are still
offered however.

This lets a dialplan writer set both audio and video codecs, e.g.,
Set(SIP_CODEC=ulaw,h264)

Note that this feature was written by both Dennis Guse and Frank Haase

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

(closes issue ASTERISK-21976)
Reported by: Denis Guse
Tested by: mjordan, sysreq
patches:
  patch-channels-chan__sip.c-393919 uploaded by dennis.guse (license 6513)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397243 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix Not Storing Current Incoming Recv Address
Michael L. Young [Wed, 21 Aug 2013 02:15:16 +0000 (02:15 +0000)]
Fix Not Storing Current Incoming Recv Address

In 1.8, r384779 introduced a regression by retrieving an old dialog and keeping
the old recv address since recv was already set.  This has caused a problem when
a proxy is involved since responses to incoming requests from the proxy server,
after an outbound call is established, are never sent to the correct recv
address.

In 11, r382322 introduced this regression.

The fix is to revert that change and always store the recv address on incoming
requests.

Thank you Walter Doekes for helping to point out this error and Mark Michelson
for your input/review of the fix.

(closes issue ASTERISK-22071)
Reported by: Alex Zarubin
Tested by: Alex Zarubin, Karsten Wemheuer
Patches:
    asterisk-22071-store-recvd-address.diff by Michael L. Young (license 5026)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397206 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoLocalize and rename ACL configuration.
Mark Michelson [Tue, 20 Aug 2013 21:01:59 +0000 (21:01 +0000)]
Localize and rename ACL configuration.

This is more-or-less a reversion of previous ACL behavior so that
it is more self-contained. ACL sections are now only parsed if res_pjsip_acl.so
is loaded. Moreover, the configuration section is now "type=acl" instead of
"type=security".

The original reason for having ACLs configured in a "type=security" section
was to lump ACLs and other security-related items into the same section. The
problem is that ACLs really should be in their own sections and there are
no other security-related options implemented anyways.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397193 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoRemove REF_DEBUG definition.
Mark Michelson [Tue, 20 Aug 2013 17:42:11 +0000 (17:42 +0000)]
Remove REF_DEBUG definition.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397158 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix refcounting of sip_pvt in test_sip_rtpqos test and unlink it from the list of...
Mark Michelson [Tue, 20 Aug 2013 16:25:33 +0000 (16:25 +0000)]
Fix refcounting of sip_pvt in test_sip_rtpqos test and unlink it from the list of pvts.

(closes issue ASTERISK-22248)
reported by Corey Farrell
patches:
test_sip_rtpqos.patch uploaded by Corey Farrell (license #5909)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397142 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoClarify documentation for the "identify_by" option for SIP endpoints.
Mark Michelson [Tue, 20 Aug 2013 15:39:38 +0000 (15:39 +0000)]
Clarify documentation for the "identify_by" option for SIP endpoints.

This also removes documentation for the options that no longer exist.

(closes issue ASTERISK-22306)
reported by Rusty Newton

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397111 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoUnregister CLI commands on exit
Kinsey Moore [Tue, 20 Aug 2013 15:36:10 +0000 (15:36 +0000)]
Unregister CLI commands on exit

This patch ensures that CLI commands enabled by DEBUG_FD_LEAKS and
DEBUG_THREADLOCALS are cleaned up properly on exit.

(closes issue ASTERISK-22238)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
    debug_cli_unregister.patch uploaded by Corey Farrell
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397110 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAdd debug message to res_pjsip_endpoint_identifier_ip to indicate when an endpoint...
Mark Michelson [Tue, 20 Aug 2013 15:32:20 +0000 (15:32 +0000)]
Add debug message to res_pjsip_endpoint_identifier_ip to indicate when an endpoint is successfully retrieved.

(closes issue ASTERISK-22101)
reported by Rusty Newton

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397109 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAdd warning messages for registration failure paths.
Mark Michelson [Tue, 20 Aug 2013 15:27:48 +0000 (15:27 +0000)]
Add warning messages for registration failure paths.

(closes issue ASTERISK-22089)
reported by Rusty Newton
patches:
patch1.txt uploaded by John Bigelow (License #5091)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397108 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAdd note to transport configuration that a restart is required to change transports.
Mark Michelson [Tue, 20 Aug 2013 14:43:56 +0000 (14:43 +0000)]
Add note to transport configuration that a restart is required to change transports.

(closes issue ASTERISK-22094)
reported by Rusty Newton

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397073 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoRecorded merge of revisions 397067 from http://svn.asterisk.org/svn/asterisk/branches/11
Kinsey Moore [Tue, 20 Aug 2013 14:26:20 +0000 (14:26 +0000)]
Recorded merge of revisions 397067 from svn.asterisk.org/svn/asterisk/branches/11

........
Fix xmldoc memory leak

This fixes a single-attribute memory leak that was occurring when the
"required" attribute was not true.

(closes issue ASTERISK-22249)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
    xmldoc-free_attr_required.patch uploaded by Corey Farrell
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397072 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoBlocked revisions 397034
Kinsey Moore [Tue, 20 Aug 2013 14:08:37 +0000 (14:08 +0000)]
Blocked revisions 397034

........
Protect CEL from an invalid config on reload

This patch fixes CEL to properly handle an invalid config on reload.

(closes issue ASTERISK-22259)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
    cel-config.patch uploaded by Corey Farrell
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397035 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAdd "autoframing" option to sip.conf.sample and h323.conf.sample.
Walter Doekes [Tue, 20 Aug 2013 11:48:57 +0000 (11:48 +0000)]
Add "autoframing" option to sip.conf.sample and h323.conf.sample.

The autoframing option was added to chan_sip.c in r43243 (mogorman,
2006-09-19 01:32:57), but never made its way into the sample configs.

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396996 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoRemove assumption in res_pjsip_dtmf_info that all INFO messages will contain a body.
Joshua Colp [Tue, 20 Aug 2013 11:33:43 +0000 (11:33 +0000)]
Remove assumption in res_pjsip_dtmf_info that all INFO messages will contain a body.

(closes issue ASTERISK-22320)
Reported by: Matt Jordan

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396993 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoLet Queue wrap up time influence member availability
Matthew Jordan [Tue, 20 Aug 2013 00:08:33 +0000 (00:08 +0000)]
Let Queue wrap up time influence member availability

Queue members who happen to be in multiple queues at the same time may not
have any wrap up time. This problem occurred due to a code change in Asterisk
11.3.0 that unified device state tracking of Queue members in multiple
Queues (which fixed some other problems, but unfortunately caused this one).

This patch fixes the behavior by having the is_member_available function
check the queue's wrap up time and the time of the member's last call, such
that for a particular queue, the member won't be considered available if their
last call is within the wrap up time.

(closes issue ASTERISK-22189)
Reported by: Tony Lewis
Tested by: Tony Lewis
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396949 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoResolve conflicts between CONFFLAG_DONT_DENOISE and CONFFLAG_INTROUSER_VMREC
Matthew Jordan [Mon, 19 Aug 2013 23:58:47 +0000 (23:58 +0000)]
Resolve conflicts between CONFFLAG_DONT_DENOISE and CONFFLAG_INTROUSER_VMREC

When r382230 added an option to not denoise the MeetMe conference (if a user
had a channel whose format's sample rate changed frequently, for example),
the value added was the maximum allowed value for the constants that define
the options for MeetMe in 1.8. Not so in 11 - unfortunately, the option
CONFFLAG_DONT_DENOISE conflicts with CONFFLAG_INTROUESR_VMREC. This patch
fixes that, and also tweaks one of the way in which the constants was
declared for consistency.

Thanks to Tony Mountifield for pointing out the problem and solution.

(closes issue ASTERISK-22269)
Reported by: Tony Mountifield
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396946 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoUpdate BUGBUG comment.
Richard Mudgett [Mon, 19 Aug 2013 16:10:41 +0000 (16:10 +0000)]
Update BUGBUG comment.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396930 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoattended transfers: Fix a bug affecting external blond transfers
Jonathan Rose [Mon, 19 Aug 2013 14:54:08 +0000 (14:54 +0000)]
attended transfers: Fix a bug affecting external blond transfers

Performing a blond transfer (attended transfer that is completed
before the transfer recipient picks up) externally through chan_sip
or chan_pjsip would result in lost references to the channels
involved with the transfer as well as their bridge.

(closes issue ASTERISK-22092)
Reported by: mmichelson
Review: https://reviewboard.asterisk.org/r/2766/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396923 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoWhitespace cleanup
Matthew Jordan [Mon, 19 Aug 2013 14:53:49 +0000 (14:53 +0000)]
Whitespace cleanup

Remove some extraneous blobs

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396922 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix invalid access to disposed memory in main/data unit test
Matthew Jordan [Sun, 18 Aug 2013 21:26:37 +0000 (21:26 +0000)]
Fix invalid access to disposed memory in main/data unit test

It is not safe to iterate over a macro'd list of ao2 objects, deref them such
that the item's destructor is called, and leave them in the list. The list
macro to iterate over items requires the item to be a valid allocated object
in order to proceed to the next item; with MALLOC_DEBUG on the corruption of
the linked list is caught in the crash.

This patch fixes the invalid access to free'd memory by removing the ao2 item
from the list before de-refing it.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396915 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoUpdate chan_mgcp to the modified parking API
Kinsey Moore [Sun, 18 Aug 2013 03:05:23 +0000 (03:05 +0000)]
Update chan_mgcp to the modified parking API

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396909 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoDisable build of res_corosync until it is back in a compiling state
Kinsey Moore [Sun, 18 Aug 2013 02:55:54 +0000 (02:55 +0000)]
Disable build of res_corosync until it is back in a compiling state

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396908 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoxml doc changes for 'aor' config object and a few of its options
Rusty Newton [Sat, 17 Aug 2013 18:13:11 +0000 (18:13 +0000)]
xml doc changes for 'aor' config object and a few of its options

Added or modified text in the xml doc for the 'aor' config object to address a few issues:
* help for the 'mailboxes' option didn't make it clear how the "list" should be formatted.
* AoR object's involvement in inbound registration wasn't mentioned.
* help for the 'contact' option didn't describe how to specify multiple contacts.
* help for the 'max_contacts' option didn't tell whether it limited the amount of contacts defined through static configuration.

(issue ASTERISK-22118)
(closes issue ASTERISK-22118)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396902 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years ago'domain_alias' config object XML help doesn't make it clear that the name used for...
Rusty Newton [Sat, 17 Aug 2013 17:47:34 +0000 (17:47 +0000)]
'domain_alias' config object XML help doesn't make it clear that the name used for the object is the domain alias

(issue ASTERISK-22114)
(closes issue ASTERISK-22114)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396901 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoxml doc changes for clarity - 'auth' config object and auth's 'auth_type' config...
Rusty Newton [Sat, 17 Aug 2013 17:40:34 +0000 (17:40 +0000)]
xml doc changes for clarity - 'auth' config object and auth's 'auth_type' config option

(issue ASTERISK-22108)
(closes issue ASTERISK-22108)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396900 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoxml doc change for transport config object - remove non-applicable warning and add...
Rusty Newton [Sat, 17 Aug 2013 17:27:40 +0000 (17:27 +0000)]
xml doc change for transport config object - remove non-applicable warning and add text regarding Asterisk restart

(closes issue ASTERISK-22105)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396899 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAllow res_parking to be unloadable
Kinsey Moore [Sat, 17 Aug 2013 15:01:54 +0000 (15:01 +0000)]
Allow res_parking to be unloadable

This change protects accesses of res_parking such that it can unload
safely once transient uses of its registered functions are complete.
The parking API has been restructured such that its consumers do not
have access to the vtable exposed by the parking provider, but instead
route through stubs to prevent consumers from holding on to function
pointers.

This adds calls to all the parking unload functions and moves
application loading and unloading into functions in
parking_applications.c similar to the rest of the parts of res_parking.

Review: https://reviewboard.asterisk.org/r/2763/
(closes issue ASTERISK-22142)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396890 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoRefactor CEL to avoid using the event system core
Kinsey Moore [Sat, 17 Aug 2013 14:46:44 +0000 (14:46 +0000)]
Refactor CEL to avoid using the event system core

This removes usage of the event system for CEL backend data
distribution and strips unused pieces out of the event system.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396888 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoStrip down the old event system
Kinsey Moore [Sat, 17 Aug 2013 14:39:27 +0000 (14:39 +0000)]
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

5 years agoFix CLI "bridge kick <bridge> <channel>" to check if the bridge needs dissolving.
Richard Mudgett [Fri, 16 Aug 2013 20:48:13 +0000 (20:48 +0000)]
Fix CLI "bridge kick <bridge> <channel>" to check if the bridge needs dissolving.

SIP/foo -- Local;1==Local;2 -- .... -- Local;1==Local;2 -- SIP/bar
Kick a ;1 channel and the chain toward SIP/foo goes away.
Kick a ;2 channel and the chain toward SIP/bar goes away.

This can leave a local channel chain between the kicked ;1 and ;2 channels
that are orphaned until you manually request one of those channels to
hangup or request the bridge to dissolve.

* Added ast_bridge_kick() as a companion to ast_bridge_remove().  The
functional difference is that ast_bridge_kick() may dissolve the bridge as
a result of the channel leaving the bridge.

* Made CLI "bridge kick <bridge> <channel>" use ast_bridge_kick() instead
of ast_bridge_remove() so the bridge can dissolve if needed.

* Renamed bridge_channel_handle_hangup() to ast_bridge_channel_kick() and
made it accessible to other files.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396877 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix some doxygen bridging file references.
Richard Mudgett [Fri, 16 Aug 2013 18:34:31 +0000 (18:34 +0000)]
Fix some doxygen bridging file references.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396867 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoDoxygen comment tweaks.
Richard Mudgett [Fri, 16 Aug 2013 17:33:21 +0000 (17:33 +0000)]
Doxygen comment tweaks.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396857 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix utilities compilation/linking.
Richard Mudgett [Fri, 16 Aug 2013 16:26:11 +0000 (16:26 +0000)]
Fix utilities compilation/linking.

The horrid structure of the source in the utils directory strikes again.
Moved the _ast_mem_backtrace_buffer[] definition from the logical location
in utils.c to hashtab.c so the aelparse and conf2ael utilities can link.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396850 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoutils.h: Minor formatting tweaks.
Richard Mudgett [Fri, 16 Aug 2013 16:22:26 +0000 (16:22 +0000)]
utils.h: Minor formatting tweaks.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396849 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoStasis: address refcount races; implementation comments
David M. Lee [Fri, 16 Aug 2013 16:03:34 +0000 (16:03 +0000)]
Stasis: address refcount races; implementation comments

Change r395954 reordered some stasis object destruction, which should
have been fine. Unfortunately, it caused some hard to reproduce issues
related to objects being accessed after they had been destroyed. The
patch in r396329 fixed the destruction order problem; this patch
addresses the underlying issue. A few other stasis-related fixes were
also added.

 * Add ref-bumps around areas where objects may get transitively
   destroyed. (For example, where we lock a topic, unref a subscription,
   which unrefs the topic, which explodes the topic when we try to
   unlock it.)

 * Wrote an extensive doxygen page about Stasis implementation,
   relationships between objects, lifecycles of objects, how the
   refcounting works, etc. Many other comments were added, corrected, or
   cleaned up.

 * Added an assert to the topic dtor to catch extra ref decrements.

 * Fixed type used after destruction errors for graceful shutdown in
   stasis_channels.c.

 * I added two unit tests in an attempt to catch destruction order
   issues. Since the underlying cause is a race condition, though, the
   tests rarely failed even when the code was wrong.

 * Fixed a leak in stasis_cache_pattern.c.

(closes issue ASTERISK-22243)
Review: https://reviewboard.asterisk.org/r/2746/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396842 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoImprove sounds indexer CLI commands
Kinsey Moore [Fri, 16 Aug 2013 12:20:59 +0000 (12:20 +0000)]
Improve sounds indexer CLI commands

This reworks the CLI commands used to access sounds information from
"sounds show[ soundid]" to "core show sounds" and
"core show sound <soundid>". This also reworks the "sounds reload" CLI
command to fall under normal module reloading ("module reload sounds").

Also, make trunk build when DEBUG_MALLOC is not enabled.

Review: https://reviewboard.asterisk.org/r/2745/
(closes issue ASTERISK-22141)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396829 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoPrevent heap alloc functions from running out of stack space.
Walter Doekes [Fri, 16 Aug 2013 07:18:51 +0000 (07:18 +0000)]
Prevent heap alloc functions from running out of stack space.

When asterisk has run out of memory (for whatever reason), the alloc
function logs a message. Logging requires memory. A recipe for
infinite recursion.

Stop the recursion by comparing the function call depth for sane values
before attempting another OOM log message.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396822 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoBridge: Don't suspend/unspend the channel for interception routines.
Richard Mudgett [Thu, 15 Aug 2013 22:10:20 +0000 (22:10 +0000)]
Bridge: Don't suspend/unspend the channel for interception routines.

By their nature, the connected line and redirecting interception routines
are not supposed to affect the channel's media.  Therefore, they should
not suspend and unsuspend the channel while running.  The
suspend/unsuspend operations could be expensive depending upon the bridge
and channel technology involved.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396814 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoMinor parking cleanup.
Richard Mudgett [Thu, 15 Aug 2013 21:52:01 +0000 (21:52 +0000)]
Minor parking cleanup.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396812 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoParking: Eliminate local channel name hack to get peer channel.
Richard Mudgett [Thu, 15 Aug 2013 20:09:10 +0000 (20:09 +0000)]
Parking: Eliminate local channel name hack to get peer channel.

(closes issue ASTERISK-22034)
Reported by: Matt Jordan

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396802 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoRemove early bridge BUGBUG comments. Remove some unneeded features.c comments.
Richard Mudgett [Thu, 15 Aug 2013 19:14:43 +0000 (19:14 +0000)]
Remove early bridge BUGBUG comments.  Remove some unneeded features.c comments.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396794 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoUpdate features.conf.sample atxferdropcall option.
Richard Mudgett [Thu, 15 Aug 2013 19:13:34 +0000 (19:13 +0000)]
Update features.conf.sample atxferdropcall option.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396793 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoChanged some BUGBUG tags to associated JIRA issue tags.
Richard Mudgett [Thu, 15 Aug 2013 18:20:52 +0000 (18:20 +0000)]
Changed some BUGBUG tags to associated JIRA issue tags.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396792 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoResolve some BUGBUG comments.
Richard Mudgett [Thu, 15 Aug 2013 17:57:33 +0000 (17:57 +0000)]
Resolve some BUGBUG comments.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396783 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoRemove leading spaces from the CLI command before parsing
Kinsey Moore [Thu, 15 Aug 2013 16:37:06 +0000 (16:37 +0000)]
Remove leading spaces from the CLI command before parsing

If you've mistakenly put a space before typing in a command, the
leading space will be included as part of the command, and the command
parser will not find the corresponding command. This patch rectifies
that situation by stripping the leading spaces on commands.

Review: https://reviewboard.asterisk.org/r/2709/
Patch-by: Tilghman Lesher
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396747 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoRemove some dead code dealing with: AST_BRIDGE_REC_CHANNEL_0, AST_BRIDGE_REC_CHANNEL_...
Richard Mudgett [Thu, 15 Aug 2013 15:12:16 +0000 (15:12 +0000)]
Remove some dead code dealing with: AST_BRIDGE_REC_CHANNEL_0, AST_BRIDGE_REC_CHANNEL_1, and AST_BRIDGE_IGNORE_SIGS.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396734 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix Bridge API DTMF hook matching for begin and end DTMF events.
Richard Mudgett [Thu, 15 Aug 2013 14:20:59 +0000 (14:20 +0000)]
Fix Bridge API DTMF hook matching for begin and end DTMF events.

The Bridge API DTMF hook matching would not deal with DTMF end events
only.  It required a DTMF begin event to start matching the DTMF hooks.
There are many places in Asterisk where code only generates DTMF end
events without the corresponding begin event.  One such place is the AMI
action Atxfer.

* Fixed DTMF hook matching if there is a string of DTMF frames in the read
queue.  We could potentially miss some of them before.

* Fixed AMI Atxfer action documentation.

(closes issue ASTERISK-22037)
Reported by: Matt Jordan

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396732 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix feature_attended_transfer test
Kinsey Moore [Thu, 15 Aug 2013 12:17:41 +0000 (12:17 +0000)]
Fix feature_attended_transfer test

The feature_attended_transfer test is failing due to Asterisk not
passing DTMF in the bridges created for internal attended transfers.
This sets the features initialization routine to set this flag by
default and adjusts the basic bridge and confbridge's use of the
bridging system accordingly as per Richard's suggestion instead of
adjusting this individual case. This change allows the necessary DTMF
to pass through the attended transfer bridge and complete the test
successfully.

Review: https://reviewboard.asterisk.org/r/2759/
(closes issue ASTERISK-22222)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396724 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix deadlocks in chan_sip in REFER and BYE handling
Kinsey Moore [Thu, 15 Aug 2013 12:12:26 +0000 (12:12 +0000)]
Fix deadlocks in chan_sip in REFER and BYE handling

This resolves several deadlocks in chan_sip relating to usage of
ast_channel_bridge_peer and improves accessibility of lock debugging
function calls.

Review: https://reviewboard.asterisk.org/r/2756/
(closes issue ASTERISK-22215)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396723 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoPrevent automagic things from happening to Stasis application bridges
Kinsey Moore [Thu, 15 Aug 2013 12:05:41 +0000 (12:05 +0000)]
Prevent automagic things from happening to Stasis application bridges

This prevents swap optimization, merges, and transfers involving Stasis
application bridges. It wouldn't be nice if the bridge you thought you
owned disappeared from under you.

Reported-by: Richard Mudgett

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396722 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoRemove unsupported channel technology callbacks.
Richard Mudgett [Thu, 15 Aug 2013 00:16:39 +0000 (00:16 +0000)]
Remove unsupported channel technology callbacks.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396713 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agochan_vpb: Effectively remove native support. Left enough bread crumbs to be able...
Richard Mudgett [Wed, 14 Aug 2013 23:35:08 +0000 (23:35 +0000)]
chan_vpb: Effectively remove native support.  Left enough bread crumbs to be able to convert later if needed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396712 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agochan_iax2: Conditionally remove native support for now.
Richard Mudgett [Wed, 14 Aug 2013 23:20:02 +0000 (23:20 +0000)]
chan_iax2: Conditionally remove native support for now.

(issue ASTERISK-21944)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396710 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agochan_misdn: Effectively remove native support. Left enough bread crumbs to be able...
Richard Mudgett [Wed, 14 Aug 2013 22:53:27 +0000 (22:53 +0000)]
chan_misdn: Effectively remove native support.  Left enough bread crumbs to be able to convert later if needed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396703 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoapp_bridgewait: Inhibit local channel optimizations to the bridge.
Richard Mudgett [Wed, 14 Aug 2013 21:28:21 +0000 (21:28 +0000)]
app_bridgewait: Inhibit local channel optimizations to the bridge.

Holding bridges can allow local channel move/swap optimization to the
bridge.  However, we cannot allow it for the BridgeWait holding bridge
because the call will lose the channel roles and dialplan location as a
result.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396695 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoTweak comment for why usleep is used.
Joshua Colp [Wed, 14 Aug 2013 19:06:59 +0000 (19:06 +0000)]
Tweak comment for why usleep is used.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396658 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoTweak test_hashtab_thrash test to allow the critical threads to execute.
Joshua Colp [Wed, 14 Aug 2013 18:10:08 +0000 (18:10 +0000)]
Tweak test_hashtab_thrash test to allow the critical threads to execute.

Depending on certain conditions it was possible for the hashtab counting thread
to starve other threads, preventing them from executing in the expected fashion.
This change adds a sleep to allow the others to do what they need to do. While
this doesn't thrash the hashtab as much as previously, it at least works.

(closes issue ASTERISK-22276)
Reported by: Matt Jordan
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396621 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agochan_sip: Convert 'just did sched_add waitid...' from warning to debug message.
Walter Doekes [Tue, 13 Aug 2013 18:47:58 +0000 (18:47 +0000)]
chan_sip: Convert 'just did sched_add waitid...' from warning to debug message.

Patches:
    reviewboard-2377.patch uploaded by Paul Belanger
Review: https://reviewboard.asterisk.org/r/2377/
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396584 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agochan_sip: Fix IP-addr in warning when rejecting a contact ACL.
Walter Doekes [Tue, 13 Aug 2013 18:36:27 +0000 (18:36 +0000)]
chan_sip: Fix IP-addr in warning when rejecting a contact ACL.

Patches:
    reviewboard-2155.patch uploaded by Paul Belanger
Review: https://reviewboard.asterisk.org/r/2155/
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396581 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoARI: allow other operations to happen while bridged
David M. Lee [Tue, 13 Aug 2013 15:27:32 +0000 (15:27 +0000)]
ARI: allow other operations to happen while bridged

This patch changes ARI bridging to allow other channel operations to
happen while the channel is bridged.

ARI channel operations are designed to queue up and execute
sequentially. This meant, though, that while a channel was bridged,
any other channel operations would queue up and execute only after the
channel left the bridge.

This patch changes ARI bridging so that channel commands can execute
while the channel is bridged. For most operations, things simply work
as expected. The one thing that ended up being a bit odd is recording.

The current recording implementation will fail when one attempts to
record a channel that's in a bridge. Note that the bridge itself may
be recording; it's recording a specific channel in the bridge that
fails. While this is an annoying limitation, channel recording is
still very useful for use cases such as voice mail, and bridge
recording makes up much of the difference for other use cases.

(closes issue ASTERISK-22084)
Review: https://reviewboard.asterisk.org/r/2726/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396568 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoMissed a spot in r396559
David M. Lee [Tue, 13 Aug 2013 15:11:44 +0000 (15:11 +0000)]
Missed a spot in r396559

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396560 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix build warnings when printf a tv_usec.
David M. Lee [Tue, 13 Aug 2013 14:57:34 +0000 (14:57 +0000)]
Fix build warnings when printf a tv_usec.

The debug logs added in r396528 neglected to account for suseconds_t
being an int.

See r392076 for more info.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396559 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoAdd test suite events for when contacts are added or removed from an AOR
John Bigelow [Mon, 12 Aug 2013 22:05:18 +0000 (22:05 +0000)]
Add test suite events for when contacts are added or removed from an AOR

These are needed by the pjsip inbound registration test suite tests.

(issue ASTERISK-21833)
(issue ASTERISK-21834)
(issue ASTERISK-21835)
(issue ASTERISK-21837)

Review: https://reviewboard.asterisk.org/r/2700/
Review: https://reviewboard.asterisk.org/r/2739/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396552 65c4cc65-6c06-0410-ace0-fbb531ad65f3

5 years agoFix two race conditions and ref counting issue when joining a bridge
Matthew Jordan [Mon, 12 Aug 2013 15:59:19 +0000 (15:59 +0000)]
Fix two race conditions and ref counting issue when joining a bridge

These problems were all caught by a test in the Asterisk Test Suite that
originated some Local channels and attempted to move the ;2 half of the Local
channel into a bridge using the Bridge AMI action.

(1) When originating a channel, the Newchannel event is emitted quickly;
    however, the ;2 channel will not have a pbx thread assigned to it until
    after the outbound 'dialing' for the ;1 is complete. Thus, there is a period
    of time where the outside world "knows" of the channel's existence and can
    influence it but Asterisk has not yet started the dialplan execution thread.
    If a Bridge AMI action is taken on the channel, the channel appears to be a
    Dialed channel with no PBX thread; hence, the channel will be imparted into
    the Bridge by first 'yanking' the channel. At the same time, a race condition
    can occur after the yank (but before entering the bridge) when ;1 answers
    and starts a PBX on the ;2. The end result currently is an assertion failure
    in the Bridging API, as a channel with a PBX is imparted into the Bridge.

    There's no way to prevent AMI from attempting to Bridge a channel
    immediately after creation; likewise, holding the channel lock through the
    entire Dial operation is unwise (and impossible). Instead of treating the
    presence of a PBX thread as an error, we simply bail out of the adding the
    channel to the bridge through ast_bridge_impart. The Bridge action will
    then fail - but we avoid a situation where the channel is both executing
    a PBX thread and simultaneously being given a separate thread in the
    bridging system (which would be a "bad thing"). Since imparting a channel
    with a PBX *can* occur and is not a programming error, the asserts have been
    removed.

(2) When the first condition occurs, we have to take one of two actions: either
    hangup the yanked channel as it did not enter the bridge, or deref it
    because we don't own it. We can determine if we own it or not by testing
    for the presence of the PBX thread. If we hung it up directly, we'd crash.

(3) bridge_find_channel does not increase the reference count of the
    ast_bridge_channel object. The RAII_VAR usage in ast_bridge_add_channel
    thus created a ticking time bomb in whatever bridge the channel moved into,
    as the destructor for the ast_bridge_channel object would be called.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396543 65c4cc65-6c06-0410-ace0-fbb531ad65f3