Commit Graph

1075 Commits

Author SHA1 Message Date
Richard Mudgett 5cf98e2459 app_queue.c: Fix error checking in QUEUE_MEMBER() read.
Change-Id: I7294e13d27875851c2f4ef6818adba507509d224
2015-08-17 19:15:21 -05:00
Rodrigo Ramírez Norambuena eec010829a AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro.
Change-Id: Icf88f9f861c6b2a16e5f626ff25795218a6f2723
2015-05-13 16:34:23 -05:00
Ivan Poddubny 90bfc02e84 app_queue: Fix queue_log EXITWITHTIMEOUT containing only 1 parameter
This patch fixes EXITWITHTIMEOUT queue_log entry to always come with 3
parameters: position, original position and waiting time.

ASTERISK-25038 #close
Reported by: Etienne Lessard

Change-Id: I0c62045922e26bee2125e93aee1dee17eee79618
2015-05-05 15:38:34 -05:00
Corey Farrell 5c1d07baf0 Astobj2: Allow reference debugging to be enabled/disabled by config.
* The REF_DEBUG compiler flag no longer has any effect on code that uses
  Astobj2.  It is used to determine if reference debugging is enabled by
  default.  Reference debugging can be enabled or disabled in asterisk.conf.
* Caller information is provided in logger errors for ao2 bad magic numbers.
* Optimizes AO2 by merging internal functions with the public counterpart.
  This was possible now that we no longer require a dual ABI.

ASTERISK-24974 #close
Reported by: Corey Farrell

Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
2015-04-27 18:37:26 -04:00
Mark Michelson aae45acbda Detect potential forwarding loops based on count.
A potential problem that can arise is the following:

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

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

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

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

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

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

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

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

Address review feedback on gerrit.

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

ASTERISK-24958 #close

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

Specifically, it does the following:

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

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

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

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

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
Matthew Jordan 2201e27340 apps/app_queue: Prevent possible crash when evaluating queue penalty rules
Although it only occurred once, a crash occurred when a queue attempted to
evaluate a queue penalty rule that appeared to have already been destroyed.
In many locations in app_queue, a test is done to see if qe->pr is NULL;
however, when we dispose of a queue's penalty rules, we don't set the pointer
to NULL after free'ing it. This patch does that to prevent any dangling
pointers from lingering on the queue object.

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

ASTERISK-23319 #close
Reported by: Vadim
patches:
  rb4552.patch submitted by Stefan Engström (License 6691)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-09 02:05:26 +00:00
Matthew Jordan b8fa8aa775 clang compiler warnings: Fix pointer-bool-converesion warnings
This patch fixes several warnings pointed out by the clang compiler.
* chan_pjsip: Removed check for data->text, as it will always be non-NULL.
* app_minivm: Fixed evaluation of etemplate->locale, which will always
  evaluate to 'true'. This patch changes the evaluation to use
  ast_strlen_zero.
* app_queue:
  - Fixed evaluation of qe->parent->monfmt, which always evaluates to
    true. Instead, we just check to see if the dereferenced pointer
    evaluates to true.
  - Fixed evaluation of mem->state_interface, wrapping it with a call to
    ast_strlen_zero.
* res_smdi: Wrapped search_msg->mesg_desk_term with calls to ast_strlen_zero.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4541.patch submitted by dkdegroot (License 6600)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 11:45:05 +00:00
Matthew Jordan 7bc2345fb1 clang compiler warnings: Fix -Wabsolute-value warnings
This patch fixes several warnings caught by clang - in this case, usage of the
abs function on non-integer values. This patch uses labs and fabs, as
appropriate, in the various affected files.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4525.patch submitted by dkdegroot (License 6600)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-30 02:45:29 +00:00
Matthew Jordan d2776d4d45 clang compiler warnings: Fix a variety of "unused" warnings
This patch fixes the -Wunused-value -Wunused-variable -Wunused-const-variable
errors caught by clang. Specifically:

* apps/app_queue.c: removed unused qpm_cmd_usage[], qum_cmd_usage[],
                    qsmp_cmd_usage[]
* cel/cel_sqlite3_custom.c: removed unused name[] = "cel_sqlite3_custom"
* channels/chan_pjsip.c: removed unused desc[] = "PJSIP Channel"
* codecs/gsm/src/gsm_create.c: removed unused ident[] = "$Header$"
* funcs/func_env.c:729: Fixed ast_str_append_substr.
* main/editline/np/strlcat.c: removed unused rcsid variable
* main/editline/np/strlcpy.c: removed unused rcsid variable
* main/security_events.c: removed unused TIMESTAMP_STR_LEN
* utils/conf2ael.c: removed unused cfextension_states
* utils/extconf.c: removed unused cfextension_states

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4526.patch submitted by dkdegroot (License 6600)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-28 12:56:43 +00:00
Matthew Jordan 60f01520e7 Fix compilations errors on 64-bit OpenBSD systems
In versiong 5.5, OpenBSD went to 64-bit time values. This requires a cast to
(long) when printing members of certain time structs.

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

ASTERISK-24879 #close
Reported by: snuffy
Tested by: snuffy
patches:
  openbsd-time64.diff uploaded by snuffy (License 5024)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-23 00:05:48 +00:00
Richard Mudgett c7ea108e02 Revert -r430452 It needs to be redone for the next major AMI version change instead.
ASTERISK-24049


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-12 18:09:27 +00:00
Richard Mudgett ef34a05f21 AMI: Remove no longer used parameter from astman_send_listack().
Follow-up issue to -r430435 from reviewboard review.

ASTERISK-24049
Review: https://reviewboard.asterisk.org/r/4315/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 18:53:49 +00:00
Richard Mudgett 52a7cdb101 AMI: Make AMI actions that generate event lists consistent.
* Made the following AMI actions use list API calls for consistency:
Agents
BridgeInfo
BridgeList
BridgeTechnologyList
ConfbridgeLIst
ConfbridgeLIstRooms
CoreShowChannels
DAHDIShowChannels
DBGet
DeviceStateList
ExtensionStateList
FAXSessions
Hangup
IAXpeerlist
IAXpeers
IAXregistry
MeetmeList
MeetmeListRooms
MWIGet
ParkedCalls
Parkinglots
PJSIPShowEndpoint
PJSIPShowEndpoints
PJSIPShowRegistrationsInbound
PJSIPShowRegistrationsOutbound
PJSIPShowResourceLists
PJSIPShowSubscriptionsInbound
PJSIPShowSubscriptionsOutbound
PresenceStateList
PRIShowSpans
QueueStatus
QueueSummary
ShowDialPlan
SIPpeers
SIPpeerstatus
SIPshowregistry
SKINNYdevices
SKINNYlines
Status
VoicemailUsersList

* Incremented the AMI version to 2.7.0.

* Changed astman_send_listack() to not use the listflag parameter and
always set the value to "Start" so the start capitalization is consistent.
i.e., The FAXSessions used "Start" while the rest of the system used
"start".  The corresponding complete event always used "Complete".

* Fixed ami_show_resource_lists() "PJSIPShowResourceLists" to output the
AMI ActionID for all of its list events.

* Fixed off-nominal AMI protocol error in manager_bridge_info(),
manager_parking_status_single_lot(), and
manager_parking_status_all_lots().  Use of astman_send_error() after
responding to the original AMI action request violates the action response
pattern by sending two responses.

* Fixed minor protocol error in action_getconfig() when no requested
categories are found.  Each line needs to be formatted as "Header: text".

* Fixed off-nominal memory leak in manager_build_parked_call_string().

* Eliminated unnecessary use of RAII_VAR() in ami_subscription_detail().

ASTERISK-24049 #close
Reported by: Jonathan Rose

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 18:16:54 +00:00
Matthew Jordan 1106e8fd0f main/stasis: Allow subscriptions to use a threadpool for message delivery
Prior to this patch, all Stasis subscriptions would receive a dedicated
thread for servicing published messages. In contrast, prior to r400178
(see review https://reviewboard.asterisk.org/r/2881/), the subscriptions
shared a thread pool. It was discovered during some initial work on Stasis
that, for a low subscription count with high message throughput, the
threadpool was not as performant as simply having a dedicated thread per
subscriber.

For situations where a subscriber receives a substantial number of messages
and is always present, the model of having a dedicated thread per subscriber
makes sense. While we still have plenty of subscriptions that would follow
this model, e.g., AMI, CDRs, CEL, etc., there are plenty that also fall into
the following two categories:
* Large number of subscriptions, specifically those tied to endpoints/peers.
* Low number of messages. Some subscriptions exist specifically to coordinate
  a single message - the subscription is created, a message is published, the
  delivery is synchronized, and the subscription is destroyed.
In both of the latter two cases, creating a dedicated thread is wasteful (and
in the case of a large number of peers/endpoints, harmful). In those cases,
having shared delivery threads is far more performant.

This patch adds the ability of a subscriber to Stasis to choose whether or not
their messages are dispatched on a dedicated thread or on a threadpool. The
threadpool is configurable through stasis.conf.

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

ASTERISK-24533 #close
Reported by: xrobau
Tested by: xrobau
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-01 17:59:21 +00:00
Mark Michelson 2d9471ab1f Fix race condition that could result in ARI transfer messages not being sent.
From reviewboard:

"During blind transfer testing, it was noticed that tests were failing
occasionally because the ARI blind transfer event was not being sent.
After investigating, I detected a race condition in the blind transfer
code. When blind transferring a single channel, the actual transfer
operation (i.e. removing the transferee from the bridge and directing
them to the proper dialplan location) is queued onto the transferee
bridge channel. After queuing the transfer operation, the blind transfer
Stasis message is published. At the time of publication, snapshots of
the channels and bridge involved are created. The ARI subscriber to the
blind transfer Stasis message then attempts to determine if the bridge
or any of the involved channels are subscribed to by ARI applications.
If so, then the blind transfer message is sent to the applications. The
way that the ARI blind transfer message handler works is to first see
if the transferer channel is subscribed to. If not, then iterate over
all the channel IDs in the bridge snapshot and determine if any of
those are subscribed to. In the test we were running, the lone
transferee channel was subscribed to, so an ARI event should have been
sent to our application. Occasionally, though, the bridge snapshot did
not have any channels IDs on it at all. Why?

The problem is that since the blind transfer operation is handled by a
separate thread, it is possible that the transfer will have completed and
the channels removed from the bridge before we publish the blind transfer
Stasis message. Since the blind transfer has completed, the bridge on
which the transfer occurred no longer has any channels on it, so the
resulting bridge snapshot has no channels on it. Through investigation of
the code, I found that attended transfers can have this issue too for the
case where a transferee is transferred to an application."

The fix employed here is to decouple the creation of snapshots for the transfer
messages from the publication of the transfer messages. This way, snapshots
can be created to reflect what they are at the time of the transfer operation.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-14 15:28:42 +00:00
Corey Farrell e4374a3abe app_queue: fix a couple leaks to struct call_queue in set_member_value
set_member_value has a couple leaks to references in the variable q
found through testsuite tests/queues/set_penalty.  Also remove the
REF_DEBUG_ONLY_QUEUES compiler declaration, this is no longer possible
with the updated REF_DEBUG code.

ASTERISK-24466 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4125/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 23:56:39 +00:00
Corey Farrell 2290393273 app_queue: Cleanup ao2_iterator
Clean ao2_iterator, resolving reference leak to queue members.

ASTERISK-24454 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4111/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-28 11:22:55 +00:00
Richard Mudgett cc11a78869 app_queue: Add dialplan function to get the channel name at the specified position in a queue.
The QUEUE_GET_CHANNEL function returns the caller's channel name at the
specified position in a queue.

QUEUE_GET_CHANNEL(<queuename>[,<position>])

The queue position parameter defaults to 1 if not specified.

Noop(${QUEUE_GET_CHANNEL(queuename, 2)})
"SIP/peer-00000002", if queue exist and have at least 2 callers

Noop(${QUEUE_GET_CHANNEL(queuename, 1)})
Noop(${QUEUE_GET_CHANNEL(queuename)})
"SIP/peer-00000000", if queue exist and have at least 1 caller

ASTERISK-24365 #close
Reported by: Kristian Hogh
Patches:
      queue_get_firstchannel.patch (license #6639) patch uploaded by Kristian Hogh
      rb4035.patch (license #6639) patch uploaded by Kristian Hogh
      Patch morphed from QUEUE_GET_FIRSTCHANEL to the more general QUEUE_GET_CHANNEL
      on reviewbord.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-03 18:54:53 +00:00
Walter Doekes 37179a2b1f core: Don't allow free to mean ast_free (and malloc, etc..).
This gets rid of most old libc free/malloc/realloc and replaces them
with ast_free and friends. When compiling with MALLOC_DEBUG you'll
notice it when you're mistakenly using one of the libc variants. For
the legacy cases you can define WRAP_LIBC_MALLOC before including
asterisk.h.

Even better would be if the errors were also enabled when compiling
without MALLOC_DEBUG, but that's a slightly more invasive header
file change.

Those compiling addons/format_mp3 will need to rerun
./contrib/scripts/get_mp3_source.sh.

ASTERISK-24348 #related
Review: https://reviewboard.asterisk.org/r/4015/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-26 14:41:38 +00:00
Matthew Jordan add46fd27c app_queue: Add RealTime support for queue rules
This patch gives the optional ability to keep queue rules in RealTime. It is
important to note that with this patch:
 (a) Queue rules in RealTime are only examined on module load/reload
 (b) Queue rules are loaded both from the queuerules.conf file as well as the
     RealTime backend
To inform app_queue to examine RealTime for queue rules, a new setting has been
added to queuerules.conf's general section "realtime_rules". RealTime queue
rules will only be used when this setting is set to "yes".

The schema for the database table supports a rule_name, time, min_penalty, and
max_penalty columns. min_penalty and max_penalty can be relative, if a '-' or
'+' literal is provided. Otherwise, the penalties are treated as constants.

For example:
rule_name, time, min_penalty, max_penalty
'default', '10', '20', '30'
'test2', '20', '30', '55'
'test2', '25', '-11', '+1111'
'test2', '400', '112', '333'
'test3', '0', '4564', '46546'
'test_rule', '40', '15', '50'

which would result in :

Rule: default
 - After 10 seconds, adjust QUEUE_MAX_PENALTY to 30 and adjust
   QUEUE_MIN_PENALTY to 20
Rule: test2
 - After 20 seconds, adjust QUEUE_MAX_PENALTY to 55 and adjust
   QUEUE_MIN_PENALTY to 30
 - After 25 seconds, adjust QUEUE_MAX_PENALTY by 1111 and adjust
   QUEUE_MIN_PENALTY by -11
 - After 400 seconds, adjust QUEUE_MAX_PENALTY to 333 and adjust
   QUEUE_MIN_PENALTY to 112
Rule: test3
 - After 0 seconds, adjust QUEUE_MAX_PENALTY to 46546 and adjust
   QUEUE_MIN_PENALTY to 4564
Rule: test_rule
 - After 40 seconds, adjust QUEUE_MAX_PENALTY to 50 and adjust
   QUEUE_MIN_PENALTY to 15

If you use RealTime, the queue rules will be always reloaded on a module
reload, even if the underlying file did not change. With the option disabled,
the rules will only be reloaded if the file was modified.

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

ASTERISK-23823 #close
Reported by: Michael K
patches:
  app_queue.c_realtime_trunk.patch uploaded by Michael K (License 6621)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-11 00:14:53 +00:00
Kinsey Moore 0ac7f96057 Stasis: Convey transfer information to applications
This fixes a class of issues where Stasis applications were not made
aware that their channels were being manipulated or replaced by
external entitiessuch as transfers, AMI commands, or dialplan
applications such as Bridge(). Inconsistent information such as
StasisEnd events with unknown channels as a result of masquerades has
also been corrected. To accomplish these fixes, several new fields
were added to blind and attended transfer messages as well as
StasisStart and BridgeAttendedTransfer Stasis events.

ASTERISK-23941 #close
Review: https://reviewboard.asterisk.org/r/3865/
Review: https://reviewboard.asterisk.org/r/3857/
Review: https://reviewboard.asterisk.org/r/3852/
Review: https://reviewboard.asterisk.org/r/3816/
Review: https://reviewboard.asterisk.org/r/3731/
Review: https://reviewboard.asterisk.org/r/3729/
Review: https://reviewboard.asterisk.org/r/3728/
........

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


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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-06 12:55:28 +00:00
Mark Michelson dcf1ad14da Add module support level to ast_module_info structure. Print it in CLI "module show" .
ASTERISK-23919 #close
Reported by Malcolm Davenport

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-25 16:47:17 +00:00
Richard Mudgett a2ce95d9d2 accountcode: Slightly change accountcode propagation.
The previous behavior was to simply set the accountcode of an outgoing
channel to the accountcode of the channel initiating the call.  It was
done this way a long time ago to allow the accountcode set on the SIP/100
channel to be propagated to a local channel so the dialplan execution on
the Local;2 channel would have the SIP/100 accountcode available.

SIP/100 -> Local;1/Local;2 -> SIP/200

Propagating the SIP/100 accountcode to the local channels is very useful.
Without any dialplan manipulation, all channels in this call would have
the same accountcode.

Using dialplan, you can set a different accountcode on the SIP/200 channel
either by setting the accountcode on the Local;2 channel or by the Dial
application's b(pre-dial), M(macro) or U(gosub) options, or by the
FollowMe application's b(pre-dial) option, or by the Queue application's
macro or gosub options.  Before Asterisk v12, the altered accountcode on
SIP/200 will remain until the local channels optimize out and the
accountcode would change to the SIP/100 accountcode.

Asterisk v1.8 attempted to add peeraccount support but ultimately had to
punt on the support.  The peeraccount support was rendered useless because
of how the CDR code needed to unconditionally force the caller's
accountcode onto the peer channel's accountcode.  The CEL events were thus
intentionally made to always use the channel's accountcode as the
peeraccount value.

With the arrival of Asterisk v12, the situation has improved somewhat so
peeraccount support can be made to work.  Using the indicated example, the
the accountcode values become as follows when the peeraccount is set on
SIP/100 before calling SIP/200:

SIP/100 ---> Local;1 ---- Local;2 ---> SIP/200
acct: 100 \/ acct: 200 \/ acct: 100 \/ acct: 200
peer: 200 /\ peer: 100 /\ peer: 200 /\ peer: 100

If a channel already has an accountcode it can only change by the
following explicit user actions:

1) A channel originate method that can specify an accountcode to use.

2) The calling channel propagating its non-empty peeraccount or its
non-empty accountcode if the peeraccount was empty to the outgoing
channel's accountcode before initiating the dial.  e.g., Dial and
FollowMe.  The exception to this propagation method is Queue.  Queue will
only propagate peeraccounts this way only if the outgoing channel does not
have an accountcode.

3) Dialplan using CHANNEL(accountcode).

4) Dialplan using CHANNEL(peeraccount) on the other end of a local
channel pair.

If a channel does not have an accountcode it can get one from the
following places:

1) The channel driver's configuration at channel creation.

2) Explicit user action as already indicated.

3) Entering a basic or stasis-mixing bridge from a peer channel's
peeraccount value.

You can specify the accountcode for an outgoing channel by setting the
CHANNEL(peeraccount) before using the Dial, FollowMe, and Queue
applications.  Queue adds the wrinkle that it will not overwrite an
existing accountcode on the outgoing channel with the calling channels
values.

Accountcode and peeraccount values propagate to an outgoing channel before
dialing.  Accountcodes also propagate when channels enter or leave a basic
or stasis-mixing bridge.  The peeraccount value only makes sense for
mixing bridges with two channels; it is meaningless otherwise.

* Made peeraccount functional by changing accountcode propagation as
described above.

* Fixed CEL extracting the wrong ie value for the peeraccount.  This was
done intentionally in Asterisk v1.8 when that version had to punt on
peeraccount.

* Fixed a few places dealing with accountcodes that were reading from
channels without the lock held.

AFS-65 #close

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-24 22:48:38 +00:00
Matthew Jordan 9cc1a8e893 stasis: Reduce creation of channel snapshots to improve performance
During some performance testing of Asterisk with AGI, ARI, and lots of Local
channels, we noticed that there's quite a hit in performance during channel
creation and releasing to the dialplan (ARI continue). After investigating
the performance spike that occurs during channel creation, we discovered
that we create a lot of channel snapshots that are technically unnecessary.
This includes creating snapshots during:
 * AGI execution
 * Returning objects for ARI commands
 * During some Local channel operations
 * During some dialling operations
 * During variable setting
 * During some bridging operations
And more.

This patch does the following:
 - It removes a number of fields from channel snapshots. These fields were
   rarely used, were expensive to have on the snapshot, and hurt performance.
   This included formats, translation paths, Log Call ID, callgroup, pickup
   group, and all channel variables. As a result, AMI Status,
   "core show channel", "core show channelvar", and "pjsip show channel" were
   modified to either hit the live channel or not show certain pieces of data.
   While this is unfortunate, the performance gain from this patch is worth
   the loss in behaviour.
 - It adds a mechanism to publish a cached snapshot + blob. A large number of
   publications were changed to use this, including:
   - During Dial begin
   - During Variable assignment (if no AMI variables are emitted - if AMI
     variables are set, we have to make snapshots when a variable is changed)
   - During channel pickup
   - When a channel is put on hold/unhold
   - When a DTMF digit is begun/ended
   - When creating a bridge snapshot
   - When an AOC event is raised
   - During Local channel optimization/Local bridging
   - When endpoint snapshots are generated
   - All AGI events
   - All ARI responses that return a channel
   - Events in the AgentPool, MeetMe, and some in Queue
 - Additionally, some extraneous channel snapshots were being made that were
   unnecessary. These were removed.
 - The result of ast_hashtab_hash_string is now cached in stasis_cache. This
   reduces a large number of calls to ast_hashtab_hash_string, which reduced
   the amount of time spent in this function in gprof by around 50%.

#ASTERISK-23811 #close
Reported by: Matt Jordan

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-13 18:24:49 +00:00
Scott Griepentrog fa8c58fefb app_queue: delayed state can cause early leavewhenempty ringing
In app_queue, device state changes arrive in event messages and
update the queue member status value.  That value is checked in
get_member_status() to decide that the caller should leave when
there are no available members.  Although event messages can be
delayed by other activity, there is no adverse affect by lagged
status except in one specific case: there is only one available
member, it was just rung, and leavewhenempty is enabled set for
ringing members.  This change adds a direct check of the device
state only under this condition where the caller may be dropped
incorrectly, resolving this issue without affecting performance
of app_queue normally.

AST-1248 #close
Review: https://reviewboard.asterisk.org/r/3595/
Reported by: Thomas Arimont
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12 15:50:48 +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
Joshua Colp f2ca3438e7 app_queue: Extend documentation for various Manager actions and events.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-08 00:36:38 +00:00
Richard Mudgett cbe7f65674 app_dial and app_queue: Make lock the forwarding channel while taking the channel snapshot.
* Fixed ast_channel_publish_dial_forward() not locking the forwarded
channel when taking the channel snapshot.

* Fixed app_dial.c:do_forward() using the wrong channel to get the
original call forwarding string.

* Removed unnecessary locking when calling ast_channel_publish_dial() and
ast_channel_publish_dial_forward() in app_dial and app_queue.  Holding
channel locks when calling ast_channel_publish_dial_forward() with a
forwarded channel could result in pausing the system while the stasis bus
completes processsing a forwarded channel subscription.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-18 16:27:31 +00:00
Russell Bryant 5b7a769fd8 (mix)monitor: Add options to enable a periodic beep
Add an option to enable a periodic beep to be played into a call if it
is being recorded.  If enabled, it uses the PERIODIC_HOOK() function
internally to play the 'beep' prompt into the call at a specified
interval.  This option is provided for both Monitor() and
MixMonitor().

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-15 23:21:19 +00:00
Walter Doekes 76d5c4ed43 app_queue: Re-add HoldTime to QueueCallerAbandon event (simple typo during ast12 refactor).
Reported by: Ibrahim22 (on IRC)
Tested by: Ibrahim22
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-07 14:57:57 +00:00
Joshua Colp c7b8633c26 app_queue: Fix a bug where realtime members would be deleted during reload causing waiting callers to get ejected.
This patch causes realtime queue members to remain in queues during the reload process. Previously these
members would be removed causing any waiting callers to be ejected from the queue with a reason of "EXITEMPTY".

ASTERISK-23547 #close
ASTERISK-23547 #comment Patch app_queue_fix_realtime_reload_1.8_trunk.patch submitted by Italo Rossi (license 6409)

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

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

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

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


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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 15:47:55 +00:00
Kinsey Moore abf1d883f7 app_queue: Fix documented AMI event name
During the rewrite of AMI events to use the Stasis bus, the name of the
QueueMemberPaused event was changed to QueueMemberPause. This corrects
documentation to reflect that.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 21:24:47 +00:00
Rusty Newton b17c80f4f0 apps/app_queue - Fix incorrect Macro parameter documentation
Macro is executed on the called channel, not the calling channel.

(closes issue ASTERISK-23069)
Reported By: Bryan Anderson
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-20 02:44:26 +00:00
Rusty Newton f6647d2362 Documentation: doc fixes across various parts of the code for ASTERISK issues 23061,23028,23046,23027
Fixes typos of "transfered" instead of "transferred" in various code. Fixes incorrect gosub param help text for app_queue.
Fixes Asterisk man pages containing unquoted minus signs. Adds note about the "textsupport" option in sip.conf.sample.

(issue ASTERISK-23061)
(issue ASTERISK-23028)
(issue ASTERISK-23046)
(issue ASTERISK-23027)
(closes issue ASTERISK-23061)
(closes issue ASTERISK-23028)
(closes issue ASTERISK-23046)
(closes issue ASTERISK-23027)
Reported by: Eugene, Jeremy Laine, Denis Pantsyrev
Patches:
 transferred.patch uploaded by Jeremy Laine (license 6561)
 hyphen.patch uploaded by Jeremy Laine (license 6561)
 sip.conf.sample.patch uploaded by Eugene (license 6360)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-17 17:16:14 +00:00
Kevin Harwell 28c0cb28d0 channel locking: Add locking for channel snapshot creation
Original commit message by mmichelson (asterisk 12 r403311):

"This adds channel locks around calls to create channel snapshots as well
as other functions which operate on a channel and then end up
creating a channel snapshot. Functions that expect the channel to be
locked prior to being called have had their documentation updated to
indicate such."

The above was initially committed and then reverted at r403398.  The problem
was found to be in core_local.c in the publish_local_bridge_message function.
The ast_unreal_lock_all function locks and adds a reference to the returned
channels and while they were being unlocked they were not being unreffed when
no longer needed.  Fixed by unreffing the channels.

Also in bridge.c a lock was obtained on "other->chan", but then an attempt was
made to unlock "other" and not the previously locked channel.  Fixed by
unlocking "other->chan"

(closes issue ASTERISK-22709)
Reported by: John Bigelow
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-18 20:33:37 +00:00
Joshua Colp 3a5cc054ed res_stasis: Expose event for call forwarding and follow forwarded channel.
This change adds an event for when an originated call is redirected to
another target. This event contains the original channel and the newly
created channel. If a stasis subscription exists on the original originated
channel for a stasis application then a new subscription will also be
created on the stasis application to the redirected channel. This allows
the application to follow the call path completely.

(closes issue ASTERISK-22719)
Reported by: Joshua Colp

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-14 17:19:41 +00:00
David M. Lee 1212906351 Reverting r403311. It's causing ARI tests to hang.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-05 22:10:20 +00:00
Mark Michelson 8e8b329e14 Add channel locking for channel snapshot creation.
This adds channel locks around calls to create channel snapshots as well
as other functions which operate on a channel and then end up
creating a channel snapshot. Functions that expect the channel to be
locked prior to being called have had their documentation updated to
indicate such.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-03 17:07:29 +00:00
Kinsey Moore 483d127d55 app_queue: Honor penalty limits of 0
In the current app_queue code from 1.8 up to trunk the upper and lower
penalties can be set to 0 but the value is interpreted to be disabled
instead of actually setting limits. This is especially evident if min
and max limits are set to 0 and members with penalties of 0 and 1 are
in the queue since the member with penalty 1 will still receive calls.
This patch adjusts the special disabled value to be INT_MAX instead of
0.

(closes issue ASTERISK-20862)
Review: https://reviewboard.asterisk.org/r/2995/
Reported by: Schmooze Com
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-11 15:37:03 +00:00
Kevin Harwell cdfbc02df1 app_queue: crash if first agent is "busy"
If the first agent/member (via CLI "queue show") in a queue is "busy" (dnd,
circuit busy, etc...) and no agents answered then app_queue would crash.
This occurred because while the calling of agent(s) remained valid the channel
on "busy" agent would be set to NULL and then later dereferenced upon a second
"rna" function call.  The original intention of the code is to have only valid
"call attempt" objects (channels != NULL) checked while attempting to call
agent(s).  It does this by building a "call_next" list of valid "call attempt"
objects.  In the case of the "busy" agent subsequent builds of the valid "call
attempt" list would sometimes include (the case mentioned above) an invalid
"call attempt" object.

The fix was to make sure the "call attempt" list was appropriately built on
every iteration.  A NULL sanity check was also added at the original offending
spot of the crash just in case another one slipped by somehow.

(closes issue ASTERISK-22644)
Reported by: Marco Signorini
Review: https://reviewboard.asterisk.org/r/2983/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402518 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-06 21:58:17 +00:00
Richard Mudgett 4ae7a4b1ba app_queue: Fix CLI "queue remove member" queue_log entry.
The queue_log entry resulting from CLI "queue remove member" when
log_membername_as_agent is enabled is wrong.  It always uses the interface
name instead of the member name in the queue_log entry.

* Get the queue member before removing it from the queue so the member
name is available for the queue_log entry.

(closes issue ASTERISK-21826)
Reported by: Oscar Esteve
Patches:
      fix_membername.diff (license #6505) patch uploaded by Oscar Esteve
         (modified to fix potential ref leak)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-22 19:04:53 +00:00
Walter Doekes e694a976f6 Don't check all realtime queues when doing "queue show some_queue".
When using realtime queues, queues have to be fetched from the database
every now and then to see if any info has been changed or to see if the
queue has been removed. When fetching info for an individual queue, the
pruning of other queues is unnecessarily costly.

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-16 12:19:47 +00:00
Richard Mudgett 8eec8fbf83 Make app_queue and res_agi independent of AMI being enabled.
The https://reviewboard.asterisk.org/r/2888/ review changes manager to not
subscribe to stasis when it is disabled for performance reasons.  When
manager is disabled app_queue and res_agi decline to load and fail to
clean up what they have already allocated.

* Made app_queue and res_agi clean up allocated resources when they
decline to load.

* Made app_queue and res_agi use their own subscriptions to the stasis
topics instead of borrowing manager's message router structure
inappropriately.

(closes issue ASTERISK-22604)
Reported by: rmudgett

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-08 15:12:46 +00:00
Richard Mudgett 96d27333d2 Miscellaneous stand alone comment cleanups.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-07 15:43:22 +00:00
Michael L. Young 0e218f76e2 app_queue: Fix Queuelog EXITWITHKEY only logging two of four fields
Commit r62462 added two extra fields for logging "the original position the
caller entered the queue at, and the amount of time the caller was waiting in
the queue."  But when r75969 was merged from 1.4 into trunk (r75977), these two
fields disappeared. Those two extra fields were not logged in 1.4 and when the
patch was merged, those fields went away.

Therefore, this is a regression and was caught by the reporter because he was
reading the awesome "Asterisk: The Definitive Guide" book.

(closes issue ASTERISK-22197)
Reported by: Dalius M.
Tested by: Dalius M.
Patches:
    asterisk-22197-q-log-exitwithkey.diff
				     uploaded by Michael L. Young (license 5026)

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

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

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

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


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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:55:27 +00:00
Matthew Jordan ccab0f27bc app_queue: Make manager events tolerant of Local channel shenanigans
app_queue currently attempts to handle Local channel optimizations in an effort
to provide accurate information in Stasis messages (and their corresponding
AMI events) as well as the Queue log. Sometimes, however, things don't go as
planned.

Consider the following scenario:
 SIP/foo <-> L;1 <-> L;2 <-> SIP/agent

SIP/agent answers, triggering a Local channel optimization. app_queue will
normally do the following:
 * Listen for the Local optimization events and update our agent accordingly
   to SIP/agent in the queue log and messages
 * When we get a hangup, publish the AgentComplete event based on our
   information (SIP/foo and SIP/agent)

However, as with all things that depend on sanity from something as capricious
as Local channels, things can go wrong:
 (1) SIP/agent immediately hangs up upon answering. This triggers a race
     condition between termination messages coming from SIP/agent and the
     ongoing Local channel optimization messages. (Note that this can also
     occur with SIP/foo)
 (2) In a race condition, Asterisk can (rarely) deliver the hangup messages
     prior to the Local channel optimization.

In that case, the messages *may* arrive to app_queue in the following order:
 * Hangup SIP/Agent
 * Hangup SIP/foo
 * Optimize L;1/L;2
 * Hangup L;2
 * Hangup L;1

When app_queue receives the hangup of the agent or the caller, it will attempt
to publish the AgentComplete event. However, it now has a problem - it thinks
its agent is the ;1 side of the Local channel, as it never received the
optimization event. At the same time, that channel is already gone. This
results in getting NULL from the Stasis cache. What's more, we can't really
wait for the optimization message, as we are currently handling the hangup
of the channel that the optimization event would tell us to use.

This patch modifies the behavior in app_queue such that, since we still have a
lot of pertinent queue information (interface, queue name, etc.), we now raise
the event with what information we know. The channels involved now may or may
not be present. Users will still at least get the "AgentComplete" event, which
"completes" the known Agent information.

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

(closes issue ASTERISK-22507)
Reported by: Richard Mudgett
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-28 20:39:10 +00:00
Matthew Jordan 57e652f2ac app_queue: Don't be quite so aggressive in initializing the array
We only need the first character.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-24 19:22:30 +00:00
Matthew Jordan 0618d89499 app_queue: Initialize array holding MixMonitor exec options
If the channel variable MONITOR_EXEC is set, app_queue will pass the specified
execution parameters to the MixMonitor application when a queue is recorded.
If that channel variable is not set, the buffer that holds the escaped value
was not being initialized to NULL, and so would be passed to the MixMonitor
application with garbage. Hilarity ensued as app_mixmonitor attempted to
execute gobeldy-gook.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-24 18:59:05 +00:00
Richard Mudgett 5afbc01d5d app_queue: Fix json blob ref leak.
The json ref from queue_member_blob_create() was never released.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-21 00:23:45 +00:00
Rusty Newton 4e3f78ad7b 'queue add member' help text correction
You are adding dial strings to the queue, not channels. An aribitrary string
could be used, but you are typically referencing a channel. Correcting the
command help text.

(issue ASTERISK-22263)
(closes issue ASTERISK-22263)
Reported By: Rusty Newton
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-12 00:04:57 +00:00
Mark Michelson 0bc2a77365 Multiple revisions 397921-397922
........
  r397921 | mmichelson | 2013-08-29 10:42:10 -0500 (Thu, 29 Aug 2013) | 6 lines
  
  Resolve assumptions that bridge snapshots would be non-NULL for transfer stasis events.
  
  Attempting to transfer an unbridged call would result in crashes in either CEL code or
  in the conversion to AMI messages.
........
  r397922 | mmichelson | 2013-08-29 10:42:29 -0500 (Thu, 29 Aug 2013) | 3 lines
  
  Remove extra debug message.
........

Merged revisions 397921-397922 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29 15:43:23 +00:00
Mark Michelson 8300c9aaaf Remove set but unused variable 'meid'.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-22 20:18:27 +00:00
Mark Michelson 00baddb906 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
2013-08-22 18:52:41 +00:00
Matthew Jordan 430bb3bfb3 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
2013-08-20 00:08:33 +00:00
Kinsey Moore 59753b1ea1 Strip down the old event system
This removes unused code, event types, IE pltypes, and event IE types
where possible and makes several functions private that were once
public. This includes a renumbering of the remaining event and IE types
which breaks binary compatibility with previous versions. The last
remaining consumers of the old event system (or parts thereof) are
main/security_events.c, res/res_security_log.c, tests/test_cel.c,
tests/test_event.c, main/cel.c, and the CEL backends.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17 14:39:27 +00:00
Richard Mudgett e47d3db365 Doxygen comment tweaks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-16 17:33:21 +00:00
Matthew Jordan 200ed6a405 Perform Ring-No-Answer checks before processing Hangup logic
The rna() routine will raise a Stasis message involving both the caller and the
agent. This doesn't work so well if we already hung up the agent channel, as
the channel doesn't quite exist. Not surprisingly, this will crash. This patch
properly runs the rna subroutine (performing all of the Ring-No-Answer logic)
prior to hanging up the agent channel.

(closes issue ASTERISK-22258)
Reported by: Kiril Valchev
Tested by: Kiril Valchev



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-07 21:38:17 +00:00
Matthew Jordan c8a91b5b01 Add queue member paused hints
This patch adds the ability in Queue to raise a hint when a member's paused
state changes. The hint uses the form 'Queue:{queue_name}_pause_{member_name}',
where {queue_name} and {member_name} are the name of the queue and the name
of the member to subscribe to, respectively.

For example: exten => 8501,hint,Queue:sales_pause_mark.

Members will show as In Use when paused.

Note that the format of the queue pause hint was changed slightly from what
is on the issue to accomodate suggestion on the code review.

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

(closes issue ASTERISK-20842)
Reported by: Philippe Lindheimer
patches:
  qpause-10-378206.diff uploaded by Philippe Lindheimer (license 5519)
  qpause-11-378206.diff uploaded by Philippe Lindheimer (license 5519)
  qpause-trunk-378206.diff uploaded by Philippe Lindheimer (license 5519)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01 19:11:46 +00:00
Kinsey Moore 03090a88ba Fix documentation replication issues
This prevents XML documentation duplication by expanding channel and
bridge snapshot tags into channel and bridge snapshot parameter sets
with a given prefix or defaulting to no prefix. This also prevents
documentation from becoming fractured and out of date by keeping all
variations of the documentation in template form such that it only
needs to be updated once and keeps maintenance to a minimum.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01 17:07:52 +00:00
Matthew Jordan cafc115896 A great big renaming patch
This patch renames the bridging* files to bridge*. This may seem pedantic
and silly, but it fits better in line with current Asterisk naming conventions:
* channel is not "channeling"
* monitor is not "monitoring"
etc.

A bridge is an object. It is a first class citizen in Asterisk. "Bridging" is
the act of using a bridge on a set of channels - and the API that fulfills that
role is more than just the action.

(closes issue ASTERISK-22130)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-25 04:06:32 +00:00
Matthew Jordan 9d8a5ceb02 Move after bridge callbacks into their own file
One more major refactoring to go.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-25 02:20:23 +00:00
Kinsey Moore 684c83b29b Add transfer support to CEL
This adds CEL support for blind and attended transfers and call pickup.
During the course of adding this functionality I noticed that
CONF_ENTER, CONF_EXIT, and BRIDGE_TO_CONF events are particularly
useless without a bridge identifier, so I added that as well.

This adds tests for blind transfers, several types of attended
transfers, and call pickup.

The extra field in CEL records now consists of a JSON blob whose fields
are defined on a per-event basis.

Review: https://reviewboard.asterisk.org/r/2658/
(closes issue ASTERISK-21565)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-20 13:10:22 +00:00
Matthew Jordan f54b1f2788 Provide error message for QUEUE_MEMBER when member is not in queue
When QUEUE_MEMBER is used and the member specified is not in the queue,
Asterisk provides an ERROR message that indicates that the option specified
is not valid. This patch now properly displays an ERROR message that the
member is not in the queue if an interface is specified.

(closes issue ASTERISK-21980)
Reported by: Avraam David
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-14 02:41:43 +00:00
Kinsey Moore 909ee4bfb9 Refactor extraneous channel events
This change removes JitterBufStats, ChannelReload, and ChannelUpdate
and refactors the following events to travel over Stasis-Core:
* LocalBridge
* DAHDIChannel
* AlarmClear
* SpanAlarmClear
* Alarm
* SpanAlarm
* DNDState
* MCID
* SIPQualifyPeerDone
* SessionTimeout

Review: https://reviewboard.asterisk.org/r/2627/
(closes issue ASTERISK-21476)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-01 13:16:09 +00:00
Kinsey Moore a1e219ef51 CEL refactoring cleanup
This change removes AST_CEL_BRIDGE_UPDATE since it should no longer be
used because masquerade situations are now accounted for in other ways.

This also refactors usage of AST_CEL_FORWARD to be produced by a Dial
message which has been extended with a "forward" field.

(closes issue ASTERISK-21566)
Review: https://reviewboard.asterisk.org/r/2635/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-25 13:03:17 +00:00
Matthew Jordan 6258bbe7bd Update Asterisk's CDRs for the new bridging framework
This patch is the initial push to update Asterisk's CDR engine for the new
bridging framework. This patch guts the existing CDR engine and builds the new
on top of messages coming across Stasis. As changes in channel state and bridge
state are detected, CDRs are built and dispatched accordingly. This
fundamentally changes CDRs in a few ways.
(1) CDRs are now *very* reflective of the actual state of channels and bridges.
    This means CDRs track well with what an actual channel is doing - which
    is useful in transfer scenarios (which were previously difficult to pin
    down). It does, however, mean that CDRs cannot be 'fooled'. Previous
    behavior in Asterisk allowed for CDR applications, channels, and other
    properties to be spoofed in parts of the code - this no longer works.
(2) CDRs have defined behavior in multi-party scenarios. This behavior will not
    be what everyone wants, but it is a defined behavior and as such, it is
    predictable.
(3) The CDR manipulation functions and applications have been overhauled. Major
    changes have been made to ResetCDR and ForkCDR in particular. Many of the
    options for these two applications no longer made any sense with the new
    framework and the (slightly) more immutable nature of CDRs.

There are a plethora of other changes. For a full description of CDR behavior,
see the CDR specification on the Asterisk wiki.

(closes issue ASTERISK-21196)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17 03:00:38 +00:00
Matthew Jordan c2e29abcbf Add announce-to-first-user option for app_queue
In r386792, the ability to play prompts to the first caller in a call queue was
added. While this is arguably a bug fix for those who expect the first caller
to continue receiving prompts while the agent is dialed, it has the side effect
of preventing the first caller from hearing the agent immediately upon
bridging. This may not be a problem for those who really want this option, but
for those who didn't care whether or not the first caller in queue heard their
position, it was an issue.

This patch disables the ability for the first caller in the queue to hear
prompts and adds a new option, announce-to-first-user, to queues.conf. Those
who the behavior can enable it by setting this value to True.

Note that if we ever implement the ability to have the prompts be stopped
upon bridging, this option can be removed.

(closes issue ASTERISK-21782)
Reported by: Remi Quezada
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 14:36:15 +00:00
Jason Parker a2d02edca5 Make app_queue AMI events more consistent. Give Join/Leave more useful names.
This also removes the eventwhencalled and eventmemberstatus configuration
options.  These events can just be filtered via manager.conf blacklists.

(closes issue ASTERISK-21469)
Review: https://reviewboard.asterisk.org/r/2586/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-07 19:51:19 +00:00
Jason Parker b6aac885be Add dial events to app_queue and app_followme.
Also fixes an issue in app_dial, where the channels were swapped on dial events.

(closes issue ASTERISK-21551)
(closes issue ASTERISK-21550)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-22 18:11:57 +00:00
Richard Mudgett 908ac3507a Conditional out more app_queue logging that needs to be reworked.
Fixes crash because app_queue was unconditionally freeing a datastore that
was still on a channel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-21 21:08:19 +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 b97c71bb11 Fix shutdown assertions in stasis-core
In r388005, macros were introduced to consistently define message
types. This added an assert if a message type was used either before
it was initialized or after it had been cleaned up. It turns out that
this assertion fires during shutdown.

This actually exposed a hidden shutdown ordering problem. Since
unsubscribing is asynchronous, it's possible that the message types
used by the subscription could be freed before the final message of
the subscription was processed.

This patch adds stasis_subscription_join(), which blocks until the
last message has been processed by the subscription. Since joining was
most commonly done right after an unsubscribe, a
stasis_unsubscribe_and_join() convenience function was also added.

Similar functions were also added to the stasis_caching_topic and
stasis_message_router, since they wrap subscriptions and have similar
problems.

Other code in trunk was refactored to join() where appropriate, or at
least verify that the subscription was complete before being
destroyed.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17 21:10:32 +00:00
Michael L. Young bb52414990 Fix Segfault In app_queue When "persistentmembers" Is Enabled And Using Realtime
When the "ignorebusy" setting was deprecated, we added some code to allow us to
be compatible with older setups that are still using the "ignorebusy" setting
instead of "ringinuse".  We set a char *variable with the column name to use,
which helps the realtime functions to use the correct column in their SQL
queries.  When "persistentmembers" is enabled, we are not setting this variable
before the realtime functions were called to load members.  This results in the
variable being NULL and therefore causing a segfault when loading members during
the module's process of loading.

The solution was to move the code that sets that variable to be before these
realtime functions are called during the loading of the module.

(closes issue ASTERISK-21738)
Reported by: JoshE
Tested by: JoshE
Patches:
    asterisk-21738-rt-ringinuse-field-not-set.diff
                                     uploaded by Michael L. Young (license 5026)

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-09 03:35:25 +00:00
Olle Johansson 465d0f4a22 Play periodic prompts for first call in a call queue
Review: https://reviewboard.asterisk.org/r/2263/
........

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

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


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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16 15:33:59 +00:00
Michael L. Young a7c5183d67 Fix Manager Segfault When app_queue Is Unloaded
When app_queue is unloaded, some manager commands are not being unregistered
which result in a segfault.  This patch corrects this.

(closes issue ASTERISK-21397)
Reported by: Peter Katzmann, Corey Farrell
Tested by: Corey Farrell
Patches:
    asterisk-21397-missing-unreg-manager-cmd_1.8.diff
                                                 Michael L. Young (license 5026)
    asterisk-21397-missing-unreg-manager-cmd_11.diff
                                                 Michael L. Young (license 5026)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12 22:38:56 +00:00
Kinsey Moore 2e1e0735fe Revamp of terminal color codes
The core module related to coloring terminal output was old and needed
some love.  The main thing here was an attempt to get rid of the
obscene number of stack-local buffers that were allocated for no other
reason than to colorize some output.  Instead, this uses a simple trick
to allocate several buffers within threadlocal storage, then
automatically rotates between them, so that you can make multiple calls
to the colorization routine within one function and not need to
allocate multiple buffers.

Review: https://reviewboard.asterisk.org/r/2241/
Patches:
    bug.patch uploaded by Tilghman Lesher


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14 18:47:56 +00:00
Richard Mudgett c41e70d647 app_queue: Fix incorrect assertion.
(issue ASTERISK-16115)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-09 00:05:35 +00:00
Richard Mudgett 8ed2c74fe3 app_queue: Fix multiple calls to a queue member that is in only one queue.
When ringinuse=no queue members can receive more than one call if these
calls happen at nearly the same time.

* Fix so a queue member does not receive more than one call from a queue.

NOTE: This fix does not prevent multiple calls to a member if the member
is in more than one queue.

* Did some refactoring to eliminate some code redundancy.

(issue ASTERISK-16115)
Reported by: nik600
Patches:
      jira_asterisk_16115_single_q_v1.8.patch (license #5621) patch uploaded by rmudgett
      Modified

* Revert the -r341580 and -r341599 changes adding the queues.conf
check_state_unknown option as it was added in an attempt to fix this
problem.  The fix did not need to be optional.  The fix should not have
tried to explicitly set the device state.  Setting the device state by
something other than the device introduces a race condition.  I also could
not see how the change would be effective other than delaying the
app_queue code long enough for the device state to propagate to app_queue.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-08 23:44:26 +00:00
Michael L. Young 8c0d7005f3 Fix Queue Log Reporting Every Call COMPLETECALLER With "h" Extension Present
When the "h" extension is present within the context of the queue, all calls
are being reported COMPLETECALLER even when the agent is hanging up the call.

This patch checks to see if the agent hung-up or not instead of only relying on
checking if the queue (caller) channel hung-up or not.  It would appear that
having the h extension in the mix, the pbx goes to the h extension,
"hanging-up" the queue channel and triggering the reporting of COMPLETECALLER.

(closes issue ASTERISK-20743)
Reported by: call
Tested by: call, Michael L. Young
Patches: 
    asterisk-20743-q-cmplt-caller.diff 
                                     uploaded by Michael L. Young (license 5026)

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

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

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


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

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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 18:11:59 +00:00
Richard Mudgett 0f54b3ee37 app_queue: Revert bad ringinuse=no patch.
With the option ringinuse=no set, the patch committed for ASTERISK-16115
causes non-SIP queue members to never be called because the device state
is checked after a channel is created to determine if the member is busy.
These queue members always get the "Member %s is busy, cannot dial"
message.

Most channel drivers other than chan_sip use the default device state
handling.  The default device-state state is considered in use or unknown
if the channel exists or not respectively.

(closes issue ASTERISK-20801)
Reported by: rmudgett
Patches:
      jira_asterisk_16115_revert_r370418_v1.8.patch (license #5621) patch uploaded by rmudgett
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-14 21:35:44 +00:00
Richard Mudgett 1c2f27c4a9 app_queue: Make update_status() not return anything.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-14 20:22:36 +00:00
Mark Michelson f2bb9afe17 Multiple revisions 375993-375994
........
  r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines
  
  Fix misuses of timeouts throughout the code.
  
  Prior to this change, a common method for determining if a timeout
  was reached was to call a function such as ast_waitfor_n() and inspect
  the out parameter that told how many milliseconds were left, then use
  that as the input to ast_waitfor_n() on the next go-around.
  
  The problem with this is that in some cases, submillisecond timeouts
  can occur, resulting in the out parameter not decreasing any. When this
  happens thousands of times, the result is that the timeout takes much
  longer than intended to be reached. As an example, I had a situation where
  a 3 second timeout took multiple days to finally end since most wakeups
  from ast_waitfor_n() were under a millisecond.
  
  This patch seeks to fix this pattern throughout the code. Now we log the
  time when an operation began and find the difference in wall clock time
  between now and when the event started. This means that sub-millisecond timeouts
  now cannot play havoc when trying to determine if something has timed out.
  
  Part of this fix also includes changing the function ast_waitfor() so that it
  is possible for it to return less than zero when a negative timeout is given
  to it. This makes it actually possible to detect errors in ast_waitfor() when
  there is no timeout.
  
  (closes issue ASTERISK-20414)
  reported by David M. Lee
  
  Review: https://reviewboard.asterisk.org/r/2135/
........
  r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines
  
  Remove some debugging that accidentally made it in the last commit.
........

Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07 19:15:26 +00:00
Matthew Jordan 1eb14dbff8 Ensure that CDRs for a caller in a Queue that is not answered is NO ANSWER.
When a caller enters a queue and no queue member answers the call, the current
behaviour can be a little odd depending on the paused status of the queue
members.  If any queue member is paused, but not all, the CDR disposition
will be BUSY.  If all queue members are paused, then the CDR disposition is
based instead on the disposition of the call prior to entering the Queue.

This patch modifies the behaviour in the following ways:
* If no queue members are paused, the CDR disposition is whatever the
  disposition was prior to going into Queue.  If the call was answered this
  will be ANSWERED; otherwise, it is NO ANSWER.
* If some queue members are pused, the CDR result is NO ANSWER. (This is a
  change in behaviour, as the result would previously have been BUSY)
* If all queue members are paused, the CDR result is whatever the result was
  prior to going into Queue.  This is the same as the behaviour prior to this
  patch.
* If the caller hangs up, times out, or presses '*' with the 'h' option, the
  CDR disposition is again not set and is dependent on whether or not the
  caller was Answered prior to entering Queue.

This patch was based on one provided by Thomas Arimont, but has been modified
to accomodate findings by the reviewers.

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

(closes issue AST-906)
Reported by: Thomas Arimont

(closes issue ASTERISK-17776)
Reported by: Attila Megyeri



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29 21:02:20 +00:00
Jonathan Rose 42a83618dd app_queue: Make ordering of rrmemory/rrordered persist over add/remove members
Prior to this patch, adding, removing or reloading  members to rrmemory would
cause the order to become completely jumbled. Now it behaves more or less like
rrordered other than the fact that it stores the members on a hash table rather
than a linked list. This patch also prevents removal of members and member
reloads from jumbling rrordered queues.

(issue AST-989)
Reported by: Thomas Arimont
Review: https://reviewboard.asterisk.org/r/2164/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-18 21:25:22 +00:00
Andrew Latham cfc6f60ca3 Doxygen Updates - Title update
Update and extend the configuration_file group and enable linking to the application.  Update title that was left behind many years ago.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375004 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14 21:45:16 +00:00
Richard Mudgett 516c9ec665 app_queue: Made pass connected line updates from the caller to ringing queue members.
Party A calls Party B
Party B puts Party A on hold.
Party B calls a queue.
Ringing queue member D sees Party B identification.
Party B transfers Party A to the queue.
Queue member D does not get a connected line update for Party A.
Queue member D answers the call and still sees Party B information.

However, if Party A later transfers the call to Party C then queue member
D gets a connected line update for Party C.

* Made pass connected line updates from the caller to queue members while
the queue members are ringing.

(closes issue AST-1017)
Reported by: Thomas Arimont

(closes issue ABE-2886)
Reported by: Thomas Arimont
Tested by: rmudgett

........

Merged revisions 374801 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-10 21:05:51 +00:00
Andrew Latham 14be2a5514 Doxygen Cleanup
Start adding configuration file linking and pages.  Add module loading doxygen block.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 23:22:50 +00:00
Sean Bright b9eeff1521 app_queue: Support persisting and loading of long member lists.
Greenlight in #asterisk brought up that he was receiving an error message "Could
not create persistent member string, out of space" when running app_queue in
Asterisk 10.  dump_queue_members() made an assumption that 8K would be enough to
store the generated string, but with queues that have large member lists this is
not always the case.  This patch removes the limitation and uses ast_str instead
of a fixed sized buffer.

The complicating factor comes from the fact that ast_db_get requires a buffer
and buffer size argument, which doesn't let us pull back more than what we pass
in, so I introduced a new ast_db_get_allocated() which returns an ast_strdup()'d
copy of the value from astdb.

As an aside, I did some testing on the maximum size of data that we can store in
the BDB library we distribute and was able to store a 10MB string and retrieve
it with no problems, so I feel this is a safe patch.

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 20:36:25 +00:00
Alec L Davis f8a37188f0 app_queue: 'agent available' hint, cleanup restart, and initial state
Fix previously untested senarios;

1). On queue initialisation set queue_avail devstate to INUSE.
    Previously was unavailable, which indicated an agent was available.

2). When removing members, if there are no other members available, set queue_avail to INUSE.
    Previously, if a member interface had become 'unavailable', they were never going to be removed, particularly when persistant queues is enabled.

3). When adding a member, check that they are available, if they are set queue_avail to NOT_INUSE.
 Previously on reloaded, members may have been 'unavailable'.

4). When pausing or unpausing a member, set appropriate queue availability. 

alecdavis (license 585)
Reported by: Alec Davis
Tested by: alecdavis

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-26 08:31:46 +00:00
Kinsey Moore 0a9d89d6be "show" completion option for "queue" shouldn't appear twice
When tab-completing CLI commands starting with "queue", "show" appeared
twice in the list due to the way that Asterisk's tab completion
functions and the order in which the commands were registered. The
registration order has been altered to resolve this issue.

(closes issue AST-940)
Reported-by: Steve Pitts
........

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

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

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


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

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22 20:43:30 +00:00
Jonathan Rose f56c0ecf9c app_queue: Make queue reload members and variants of that work
Prior to this patch, 'queue reload members' cli command did not
work at all. This also affects the manager function 'QueueReload'
when supplied with the 'members: yes' field.

(closes issue AST-956)
Reported by: John Bigelow
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 15:41:09 +00:00
Matthew Jordan ca0e96ae19 Add queue monitoring hints
This patch adds support for hints on a queue.  Hints can be added using
the nomenclature 'Queue:name', where name is the name of the queue being
monitored.

This nifty feature was done by Alec Davis.

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

Reported by: Alec Davis
Tested by: alecdavis
patches:
  review1619.diff2 by alecdavis (license 585)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 18:44:26 +00:00
Matthew Jordan f1fb120f5d Support all ways a member can be available for 'agent available' hints
Alec's patch in r373188 added the ability to subscribe to a hint for when
Queue members are available.  This patch modifies the check that determines
when a Queue member is available by refactoring the availability checks in
num_available_members into a shared function is_member_available.  This
should now handle the ringinuse option, as well as device state values
other than AST_DEVICE_NOT_INUSE.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 18:02:02 +00:00
Alec L Davis 67ca3b9126 app_queue: Support an 'agent available' hint
Sets INUSE when no free agents, NOT_INUSE when an agent is free.  

modifes handle_statechange() scan members loop to scan for a free agent
and updates the Queue:queuename_avial devstate.

Previously exited early if the member was found in the queue.

Now Exits later when both a member was found, and a free agent was found.


alecdavis (license 585)
Reported by: Alec Davis
Tested by: alecdavis

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-19 22:33:12 +00:00
Richard Mudgett 2a6be9fd0a Fix exception path typo in app_queue.c try_calling().
(closes issue ASTERISK-20380)
Reported by: Jeremy Pepper
Patches:
      fix-local-channel-locking.patch (license #6350) patch uploaded by Jeremy Pepper
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-07 21:51:31 +00:00
Matthew Jordan 5da59112b7 Update QueueMemberStatus event documentation to include member status values
The Status: header in a QueueMemberStatus event (and other QueueMember* events)
is the numeric value of the device state corresponding to that Queue Member.
As those values are not exactly obvious, listing them in the documentation is
useful.

Matt Riddell reported this indirectly through the wiki page.

(closes issue ASTERISK-20243)
Reported by: Matt Riddell
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-06 22:21:12 +00:00
Kinsey Moore 0090fb558d Ensure listed queues are not offered for completion
When using tab-completion for the list of queues on "queue reset stats"
or "queue reload {all|members|parameters|rules}", the tab-completion
listing for further queues erroneously listed queues that had already
been added to the list. The tab-completion listing now only displays
queues that are not already in the list.

(closes issue AST-963)
Reported-by: John Bigelow
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-06 21:43:18 +00:00
Kinsey Moore c16141dda1 Ensure "rules" is tab-completable for "queue show"
Previously, tabbing at the end of "queue show" produced a list of
available queues about which information could be shown, but did not
include an alternative command, "rules", to access information about
queue rules. The "rules" item should now be shown in the list of
tab-completable items.

(closes issue AST-958)
Reported-by: John Bigelow
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-06 14:31:44 +00:00
Jonathan Rose b02c65752c app_queue: Only log PAUSEALL/UNPAUSEALL when 1+ memebers changed.
Prior to this patch, if pause or unpause was issued on an interface
without specifying a specific queue, a PAUSEALL or UNPAUSEALL event
would be logged in the queue log even if that interface wasn't a
member of any queues. This patch changes it so that these events are
only logged when at least one member of any queue exists for that
interface.

(closes issue AST-946)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2079/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-04 19:26:02 +00:00
Mark Michelson 1ab2639cf2 Prevent crash on shutdown due to refcount error on queues container.
When app_queue is unloaded, the queues container has its refcount
decremented, potentially to 0. Then the taskprocessor responsible
for handling device state changes is unreferenced. If the
taskprocessor happens to be just about to run its task, then it
will create and destroy an iterator on the queues container.
This can cause the refcount on the queues container to increase to
1 and then back to 0. Going back to 0 a second time results in
double frees.

This failure was seen periodically in the testsuite when Asterisk
would shut down.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30 20:54:51 +00:00
Mark Michelson c3b5ec70ac Help prevent ringing queue members from being rung when ringinuse set to no.
Queue member status would not always get updated properly when the member
was called, thus resulting in the member getting multiple calls. With this
change, we update the member's status at the time of calling, and we also
check to make sure the member is still available to take the call before
placing an outbound call.

(closes issue ASTERISK-16115)
reported by nik600
Patches:
	app_queue.c-svn-r370418.patch uploaded by Italo Rossi (license #6409)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30 18:39:16 +00:00
Mark Michelson 6a539ace84 Fix misuses of asprintf throughout the code.
This fixes three main issues

* Change asprintf() uses to ast_asprintf() so that it
pairs properly with ast_free() and no longer causes
MALLOC_DEBUG to freak out.

* When ast_asprintf() fails, set the pointer NULL if
it will be referenced later.

* Fix some memory leaks that were spotted while taking
care of the first two points.

(Closes issue ASTERISK-20135)
reported by Richard Mudgett

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-21 21:01:11 +00:00
Mark Michelson f4a34ee89c Fix bug where final queue member would not be removed from memory.
If a static queue had realtime members, then there could be a potential
for those realtime members not to be properly deleted from memory.

If the queue's members were loaded from realtime and then all the
members were deleted from the backend, then the queue would still
think these members existed. The reason was that there was a short-
circuit in code such that if there were no members found in the
backend, then the queue would not be updated to reflect this.

Note that this only affected static queues with realtime members.
Realtime queues with realtime members were unaffected by this issue.

(closes issue ASTERISK-19793)
reported by Marcus Haas
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-15 23:35:35 +00:00
Mark Michelson 567b35e547 Fix a couple of documentation problems in app_queue.c
* The RemoveQueueMember app made mention of options that could
be passed in, but no options are supported. I have removed the
listing of options from the documentation.

* The RQMSTATUS variable did not list "NOTDYNAMIC" as a possible
value that could be set.

(closes issue AST-949)
reported by Steve Pitts

(closes issue AST-954)
reported by Steve Pitts
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-10 21:35:18 +00:00
Richard Mudgett ac35b92b62 Hangup handlers - Dialplan subroutines that run when the channel hangs up.
Hangup handlers are an alternative to the h extension.  They can be used
in addition to the h extension.  The idea is to attach a Gosub routine to
a channel that will execute when the call hangs up.  Whereas which h
extension gets executed depends on the location of dialplan execution when
the call hangs up, hangup handlers are attached to the call channel.  You
can attach multiple handlers that will execute in the order of most
recently added first.

(closes issue ASTERISK-19549)
Reported by: Mark Murawski
Tested by: rmudgett

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-29 17:02:32 +00:00
Matthew Jordan 82a7409c15 Add AMI event documentation
This patch adds the core changes necessary to support AMI event documentation
in the source files of Asterisk, and adds documentation to those AMI events
defined in the core application modules.  Event documentation is built from
the source by two new python scripts, located in build_tools:
get_documentation.py and post_process_documentation.py.

The get_documentation.py script mirrors the actions of the existing AWK
get_documentation scripts, except that it will scan the entirety of a source
file for Asterisk documentation.  Upon encountering it, if the documentation
happens to be an AMI event, it will attempt to extract information about the
event directly from the manager event macro calls that raise the event.  The
post_process_documentation.py script combines manager event instances that
are the same event but documented in multiple source files.  It generates
the final core-[lang].xml file.

As this process can take longer to complete than a typical 'make all', it
is only performed if a new make target, 'full', is chosen.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-25 17:59:34 +00:00
Richard Mudgett 62274463fa Explicitly check caller hangup in app Queue rather than a polluted res2 value.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-22 22:12:06 +00:00
Richard Mudgett 30a417dc6c Fix F and F(x) action logic in Queue application.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-22 21:51:05 +00:00
Richard Mudgett f8746d0009 Allow non-normal execution routines to be able to run on hungup channels.
* Make non-normal dialplan execution routines be able to run on a hung up
channel.  This is preparation work for hangup handler routines.

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

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

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

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

* Eliminated the need for the gosub_virtual_context return location.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-14 23:22:53 +00:00
Kinsey Moore c6142cf2cc Fix coverity UNUSED_VALUE findings in core support level files
Most of these were just saving returned values without using them and
in some cases the variable being saved to could be removed as well.

(issue ASTERISK-19672)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-11 15:23:30 +00:00
Richard Mudgett 3f59ad990c Fix app_queue debug message use of args.options after the string has been parsed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-07 20:39:25 +00:00
Richard Mudgett 9ecd6c9ab4 Fix inverted test in app_queue for ringinuse.
Regression from -r367080 ringinuse commit.

(issue ASTERISK-19536)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-07 20:37:05 +00:00
Kinsey Moore 571445ab9c Convert AST_FLAG_ANSWERED_ELSEWHERE usage to AST_CAUSE_ANSWERED_ELSEWHERE
This was essentially duplicated functionality where normal channels used
AST_CAUSE_ANSWERED_ELSEWHERE while local channels and queues used
AST_FLAG_ANSWERED_ELSEWHERE.  This removes the flag and converts that usage
into AST_CAUSE_ANSWERED_ELSEWHER usage.

Review: https://reviewboard.asterisk.org/r/1944
(closes issue ASTERISK-19865)
Patch-by: Birger Harzenetter


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-05 14:41:43 +00:00
Mark Michelson 14a985560e Merge changes dealing with support for Digium phones.
Presence support has been added. This is accomplished by
allowing for presence hints in addition to device state
hints. A dialplan function called PRESENCE_STATE has been
added to allow for setting and reading presence. Presence
can be transmitted to Digium phones using custom XML
elements in a PIDF presence document.

Voicemail has new APIs that allow for moving, removing,
forwarding, and playing messages. Messages have had a new
unique message ID added to them so that the APIs will work
reliably. The state of a voicemail mailbox can be obtained
using an API that allows one to get a snapshot of the mailbox.
A voicemail Dialplan App called VoiceMailPlayMsg has been
added to be able to play back a specific message.

Configuration hooks have been added. Configuration hooks
allow for a piece of code to be executed when a specific
configuration file is loaded by a specific module. This is
useful for modules that are dependent on the configuration
of other modules.

chan_sip now has a public method that allows for a custom
SIP INFO request to be sent mid-dialog. Digium phones use
this in order to display progress bars when files are played.

Messaging support has been expanded a bit. The main
visible difference is the addition of an AMI action
MessageSend.

Finally, a ParkingLots manager action has been added in order
to get a list of parking lots.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04 20:26:12 +00:00
Richard Mudgett dd2427c141 Coverity Report: Fix issues for error type REVERSE_INULL (core modules)
* Fixes findings: 0-2,5,7-15,24-26,28-31

(issue ASTERISK-19648)
Reported by: Matt Jordan
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-31 18:39:30 +00:00
Richard Mudgett e518536773 Fix Dial I option ignored if dial forked and one fork redirects.
The Dial and Queue I option is intended to block connected line updates
and redirecting updates.  However, it is a feature that when a call is
locally redirected, the I option is disabled if the redirected call runs
as a local channel so the administrator can have an opportunity to setup
new connected line information.  Unfortunately, the Dial and Queue I
option is disabled for *all* forked calls if one of those calls is
redirected.

* Make the Dial and Queue I option apply to each outgoing call leg
independently.  Now if one outgoing call leg is locally redirected, the
other outgoing calls are not affected.

* Made Dial not pass any redirecting updates when forking calls.
Redirecting updates do not make sense for this scenario.

* Made Queue not pass any redirecting updates when using the ringall
strategy.  Redirecting updates do not make sense for this scenario.

* Fixed deadlock potential with chan_local when Dial and Queue send
redirecting updates for a local redirect.

* Converted the Queue stillgoing flag to a boolean bitfield.

(closes issue ASTERISK-19511)
Reported by: rmudgett
Tested by: rmudgett

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-24 23:52:40 +00:00
Jonathan Rose ec3b8a1f27 app_queue: Per Member ringinuse option and deprecation of ignorebusy
Adds a number of methods for controlling the setting of 'ringinuse'
which is basically the same concept as the old ignorebusy setting,
only now the per member setting always controls whether or not the
member is actually ringed while in use. A CLI command and a manager
action have been added to change a given queue member's ringinuse
option while Asterisk is running and the an argument has been added
for adding members with deliberately set ringinuse in queues.conf
Some effort has been made to ensure compatability with dialplans and
databases still referring to 'ignorebusy'.

(issue ASTERISK-19536)
reported by: Philippe Lindheimer
Review: https://reviewboard.asterisk.org/r/1919/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 19:39:54 +00:00
Matthew Jordan 7b51320642 Fix a variety of memory leaks
This patch addresses a number of memory leaks in a variety of modules that were
found by a static analysis tool.  A brief summary of the changes:

* app_minivm:       free ast_str objects on off nominal paths
* app_page:         free the ast_dial object if the requested channel technology
                    cannot be appended to the dialing structure
* app_queue:        if a penalty rule failed to match any existing rule list
                    names, the created rule would not be inserted and its memory
                    would be leaked
* app_read:         dispose of the created silence detector in the presence of
                    off nominal circumstances
* app_voicemail:    dispose of an allocated unique ID field for MWI event
                    un-subscribe requests in off nominal paths; dispose of
                    configuration objects when using the secret.conf option
* chan_dahdi:       dispose of the allocated frame produced by ast_dsp_process
* chan_iax2:        properly unref peer in CLI command "iax2 unregister"
* chan_sip:         dispose of the allocated frame produced by sip_rtp_read's
                    call of ast_dsp_process; free memory in parse unit tests
* func_dialgroup:   properly deref ao2 object grhead in nominal path of
                    dialgroup_read
* func_odbc:        free resultset in off nominal paths of odbc_read
* cli:              free match_list in off nominal paths of CLI match completion
* config:           free comment_buffer/list_buffer when configuration file load
                    is unchanged; free the same buffers any time they were
                    created and config files were processed
* data:             free XML nodes in various places
* enum:             free context buffer in off nominal paths
* features:         free ast_call_feature in off nominal paths of applicationmap
                    config processing
* netsock2:         users of ast_sockaddr_resolve pass in an ast_sockaddr struct
                    that is allocated by the method.  Failures in
                    ast_sockaddr_resolve could result in the users of the method
                    not knowing whether or not the buffer was allocated.  The
                    method will now not allocate the ast_sockaddr struct if it
                    will return failure.
* pbx:              cleanup hash table traversals in off nominal paths; free
                    ignore pattern buffer if it already exists for the specified
                    context
* xmldoc:           cleanup various nodes when we no longer need them
* main/editline:    various cleanup of pointers not being freed before being
                    assigned to other memory, cleanup along off nominal paths
* menuselect/mxml:  cleanup of value buffer for an attribute when that attribute
                    did not specify a value
* res_calendar*:    responses are allocated via the various *_request method
                    returns and should not be allocated in the various
                    write_event methods; ensure attendee buffer is freed if no
                    data exists in the parsed node; ensure that calendar objects
                    are de-ref'd appropriately
* res_jabber:       free buffer in off nominal path
* res_musiconhold:  close the DIR* object in off nominal paths
* res_rtp_asterisk: if we run out of ports, close the rtp socket object and free
                    the rtp object
* res_srtp:         if we fail to create the session in libsrtp, destroy the
                    temporary ast_srtp object

(issue ASTERISK-19665)
Reported by: Matt Jordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 14:43:44 +00:00
Kinsey Moore b5a6de76fc Commit framework for HANGUPCAUSE (replacement for SIP_CAUSE)
This is the starting point for the Asterisk 11: Who Hung Up work and provides
a framework which will allow channel drivers to report the types of hangup
cause information available in SIP_CAUSE without incurring the overhead of the
MASTER_CHANNEL dialplan function. The initial implementation only includes
cause generation for chan_sip and does not include cause code translation
utilities.

This change deprecates SIP_CAUSE and replaces its method of reporting cause
codes with the new framework. This change also deprecates the 'storesipcause'
option in sip.conf.

Review: https://reviewboard.asterisk.org/r/1822/
(Closes issue SWP-4221)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14 19:44:27 +00:00
Jonathan Rose 8227f70cd7 Coverity Report: Fix issues for error type CHECKED_RETURN for core
(issue ASTERISK-19658)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1905/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10 18:35:14 +00:00
Olle Johansson e5c20ccb76 Code formatting fixes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-26 13:59:11 +00:00
Olle Johansson 04ddb5714f Add documentation
Thanks Tilghman!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25 13:57:01 +00:00
Olle Johansson f102aecf12 Formatting changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25 11:18:14 +00:00
Olle Johansson a8e755700e Use the DEFINED value for musicclass length.
For some reason, features.c has it's own definition. Should propably be fixed too.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25 10:49:13 +00:00
Richard Mudgett f663924517 Make app_dial and app_queue use new macro and gosub calls.
* Simplify some code in app_dial and app_queue by calling
ast_app_exec_macro() and ast_app_exec_sub().

* Fix minor locking issue in app_dial for post-answer macro/gosub
MACRO/GOSUB_RESULT=GOTO: handling.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-23 17:05:55 +00:00
Jonathan Rose 683eacb59a Change default value of 'ignorebusy' on Queue members so that behavior is more like 1.8
Prior to this patch, in order to restore that behavior, a function would have
to be used on the QueueMember to make the ringinuse option do anything, which
is pretty unreasonable.

(closes issue ASTERISK-19536)
reported by: Philippe Lindheimer
Review: https://reviewboard.asterisk.org/r/1860/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-11 17:20:08 +00:00
Jonathan Rose c6979ff581 Adds F option to Bridge application
Similar to dial and queue F option.

(Closes issue ASTERISK-19282)
Reported by: To
Patches:
	bridge_f-v3.diff uploaded by To (license 6347)
Review: https://reviewboard.asterisk.org/r/1825/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22 21:25:22 +00:00
Richard Mudgett e9703da1d5 Add missing connected line macro calls to initial dial for Dial and Queue apps.
The connected line interception macros do not get executed when the
outgoing channel is initially created and that channel's caller-id is
implicitly imported into the incoming channel's connected line data.  If
you are using the interception macros, you would expect that they get run
for every change to a channel's connected line information outside of
normal dialplan execution.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-15 18:32:22 +00:00
Terry Wilson 786f5898d1 Finalize ast_channel opaquification
Review: https://reviewboard.asterisk.org/r/1786/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 18:20:34 +00:00
Sean Bright 4657b016ad Resolve a few more cases of variable shadowing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-08 17:48:14 +00:00
Jonathan Rose d3db6da254 Adds a transfer callee on hangup option (like with Dial option F) to queues.
This should (and does in my testing) act just like the Dial option of the same name.
This allows a queue member to be transfered to the next priority (no args), or to
a context/extension/priority similar to goto (with args context^extension^priority)
when a caller hangs up on them.

(closes issue ASTERISK-19283)
Reported by: To
Patches:
	queue_f-v3.diff uploaded by To (license 6347)
Review: https://reviewboard.asterisk.org/r/1785/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 16:57:12 +00:00
Terry Wilson 0e5c761c28 Opaquify ast_channel typedefs, fd arrays, and softhangup flag
Review: https://reviewboard.asterisk.org/r/1784/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-01 22:09:18 +00:00
Terry Wilson a9d607a357 Opaquify ast_channel structs and lists
Review: https://reviewboard.asterisk.org/r/1773/


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

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


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


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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 17:27:06 +00:00
Walter Doekes db24fc2523 Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: Clod Patry
Review: https://reviewboard.asterisk.org/r/1651


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08 20:49:48 +00:00
Richard Mudgett 2e04182efc Audit of ao2_iterator_init() usage for v10. Missed one.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27 21:38:54 +00:00
Richard Mudgett 27b69e7d29 Audit of ao2_iterator_init() usage for v1.8.
Fixes numerous reference leaks and missing ao2_iterator_destroy() calls as
a result.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27 18:47:16 +00:00
Terry Wilson 99cae5b750 Opaquify channel stringfields
Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 20:12:09 +00:00
Matthew Jordan 9c4821f468 Realtime queues failed to load queue information without queue member table
Previously, realtime queues could be loaded without defining the queue member
table.  This allowed for queue members to be dynamic, while the realtime
queue definitions could exist in some backing storage.  Revision 342223 broke
this when it changed the return value for realtime_multientry to return NULL
when no results are returned.  Previously, an empty ast_config object was
expected.

(closes issue ASTERISK-19170)
Reported by: Rene Mendoza
Tested by: Rene Mendoza
Patches: 
  rt_queue_member_patch.diff uploaded by Matt Jordan (license 6283)
........

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

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


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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 22:15:50 +00:00
Richard Mudgett b05d4603c4 Fix crash during CDR update.
The ast_cdr_setcid() and ast_cdr_update() were shown in ASTERISK-18836 to
be called by different threads for the same channel.  The channel driver
thread and the PBX thread running dialplan.

* Add lock protection around CDR API calls that access an ast_channel
pointer.

(closes issue ASTERISK-18836)
Reported by: gpluser

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-16 21:10:19 +00:00
Matthew Jordan aaa715bfae Fixed Asterisk crash when function QUEUE_MEMBER receives invalid input
The function QUEUE_MEMBER has two required parameters (queuename, option).  It
was only checking for the presence of queuename.  The patch checks for the
existence of the option parameter and provides better error logging when
invalid values are provided for the option parameter as well.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-14 22:08:55 +00:00
Jonathan Rose e1884139c4 Fix regressed behavior of queue set penalty to work without specifying 'in <queuename>'
r325483 caused a regression in Asterisk 10+ that would make Asterisk segfault when
attempting to set penalty on an interface without specifying a queue in the queue set
penalty CLI command. In addition, no attempt would be made whatsoever to perform the
penalty setting on all the queues in the core list with either the cli command or the
non-segfaulting ami equivalent. This patch fixes that and also makes an attempt to
document and rename some functions required by this command to better represent what
they actually do. Oh yeah, and the use of this command without specifying a specific
queue actually works now.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-08 20:55:19 +00:00
Richard Mudgett 9e726d9cb4 Make queue log indicate if ADDMEMBER is paused for AMI and realtime.
* Add parameter to queue log ADDMEMBER to indicate if the member is
paused.

(closes issue ASTERISK-18645)
Reported by: garlew
Patches:
      paused.diff (License #5337) patch uploaded by garlew
Tested by: rmudgett, garlew

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-14 22:27:42 +00:00
Richard Mudgett 46089f6b51 Fix potential deadlock calling ast_call() with channel locks held.
Fixed app_queue.c:ring_entry() calling ast_call() with the channel locks
held.  Chan_local attempts to do deadlock avoidance in its ast_call()
callback and could deadlock if a channel lock is already held.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-10 23:02:46 +00:00
Richard Mudgett 464b337b3c Make AMI event AgentCalled get CallerID/ConnectedLine info from the incoming channel.
It was strange that the AgentCalled AMI event would get most of its
information from the incoming channel but then get the CallerID
information from the outgoing channel.  Before connected line support was
added, this information was always the same at this point.

(closes issue ASTERISK-18152)
Reported by: Thomas Farnham
Tested by: rmudgett
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-10 22:38:29 +00:00
Terry Wilson 6e730a6806 Use int for storing ao2_container_count instad of size_t
AST-676
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-25 21:11:14 +00:00
Terry Wilson f8351a8342 Simplify queue membercount code
Despite an ominous sounding comment stating that membercount was for "logged
in" members only and thus we couldn't use ao2_container_count(), I could not
find a single place in the code where that seemed to be accurate. The only time
we decremented membercount was when we were marking something dead or actually
removing it. The only places we incremented it were either after ao2_link(), or
trying to correct for having set it to 0 during a reload. In every case where
we were correcting the value, it seemed that we were trying to make the count
actually match what ao2_container_count() would return. The only place I could
find where we made a determination about something being "logged in" or not, we
didn't trust the membercount, but instead looked at devicestate, paused, etc.

This patch removes membercount, replaces its use with ao2_container_count, and
manually adds the results of ao2_container_count to a "membercount" field for
ast_data queue query results. This patch also would fix AST-676, but as it is
slightly riskier than the previously committed fix, the two commits have been
made separately.

Reivew: https://reviewboard.asterisk.org/r/1541/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-25 20:07:59 +00:00
Terry Wilson 5749ef5be8 Properly update membercount for reloaded members
Since q->membercount is set to 0 before reloading, it is important
to increment it again for reloaded members as well as added.

(closes issue AST-676)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-25 19:54:17 +00:00
Richard Mudgett 3e9f1ee3e0 Fix use of OBJ_KEY in Queue application.
To use the new OBJ_KEY flag, the container hash and compare callback
functions must be updated to support OBJ_KEY.  Otherwise, bad things
happen.

(issue ASTERISK-14769)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-24 21:01:58 +00:00
Gregory Nietsky 7ac53e57b3 queues container needs locking when using the OBJ_NOLOCK flag
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-24 07:40:18 +00:00
Gregory Nietsky 3d55a05019 Remove some ref leaks and a return without unlock.
There some resource leaks introduced in asterisk 10
make sure that locks are not held on return and we 
release ref's held.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-23 14:35:26 +00:00
Gregory Nietsky d36c70e021 Whitespace Fixups / Add Braces
This janitorial patch is related to work on RB1538



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-23 11:37:50 +00:00
Gregory Nietsky 71b7df16bf Merged revisions 341580 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r341580 | irroot | 2011-10-20 19:13:23 +0200 (Thu, 20 Oct 2011) | 15 lines
  
  Add option to check state when state is unknown
  
  r341486 reverts r325483 this is a rework of the patch.
  optimize to minimize load.
  
  add option check_state_unknown to control whether a member with unknown
  device state is checked there is a small % chance that calls will be sent
  to the member when they on a call.
  
  app_queue will see a device with unknown state as available and does not 
  try verify the state without this option enabled.
  
  Review: https://reviewboard.asterisk.org/r/1535/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-20 17:34:54 +00:00
Matthew Nicholson 3f98c937a1 Merged revisions 341486 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r341486 | mnicholson | 2011-10-19 16:23:17 -0500 (Wed, 19 Oct 2011) | 18 lines
  
  Fix a performance regression introduced in r325483.
  
  The regression was caused by a call to ast_parse_device_state() in app_queue's
  ring_entry() function. The ast_parse_device_state() function eventually calls
  ast_channel_get_full() with a channel name prefix which causes it to walk the
  channel list causing massive lock contention and slow downs.
  
  This patch fixes the regression by removing the call to
  ast_parase_device_state() which should be unnecessary. Queue member device
  state should be maintained by device state events. Some users have seen
  instances where busy agents were called when they shouldn't have, which is the
  reason the call to ast_parse_device_state() was added. That change appears to
  have resolved that issue but also causes this performance regression. There may
  still be issues with queue member status, and if so, alternative methods should
  be investigated to resolve them.
  
  AST-695
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-19 21:24:07 +00:00
Terry Wilson 0ab04b53b5 Add autopausebusy and autopauseunavail queue options
Make it possible to autopause on a busy or unavailable response from
a device.

(closes issue ASTERISK-16112)
Reported by: jlpedrosa
Patches:
	autopausebusy.txt by twilson

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@338187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-28 16:59:11 +00:00
Gregory Nietsky b4d8f26ecd Merged revisions 337840 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r337840 | irroot | 2011-09-23 10:39:22 +0200 (Fri, 23 Sep 2011) | 17 lines
  
  Merged revisions 337839 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r337839 | irroot | 2011-09-23 10:34:03 +0200 (Fri, 23 Sep 2011) | 11 lines
    
    Make sure a CDR is on the stack for call in the Queue.
    Only let update_cdr act on the last CDR in the stack.
    
    In some circumstances [Attended transfer to queue] a 
    CDR record is not inserted for this call where it should.
    
    (closes issue ASTERISK-18567)
    
    Review: https://reviewboard.asterisk.org/r/1266
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-23 09:35:32 +00:00
Jonathan Rose 364eb56835 Merged revisions 336717 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r336717 | jrose | 2011-09-19 15:16:23 -0500 (Mon, 19 Sep 2011) | 14 lines
  
  Merged revisions 336716 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r336716 | jrose | 2011-09-19 15:07:36 -0500 (Mon, 19 Sep 2011) | 7 lines
    
    Document applications that play audio and do not answer unanswered calls.
    
    This patch is part of an effort to document early media and its usage. If you are
    interested in contributing to this documentation effort, there are probably other
    applications worth documenting as well as an Asterisk wiki article at
    https://wiki.asterisk.org/wiki/display/AST/Early+Media+and+the+Progress+Application
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 20:23:29 +00:00
Gregory Nietsky 6f7ff1074b Merged revisions 336094 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r336094 | irroot | 2011-09-15 17:54:46 +0200 (Thu, 15 Sep 2011) | 26 lines
  
  Merged revisions 336093 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r336093 | irroot | 2011-09-15 17:46:21 +0200 (Thu, 15 Sep 2011) | 20 lines
    
    
    Locking order in app_queue.c causes deadlocks.
    
    a channel lock must never be held with the queues container lock held.
    
    the deadlock occured on masquerade.
    
    the queues container lock is a relic of the past the old queue module lock.
    with ao2 there is no need to hold this lock when dealing with members this
    patch removes unneeded locks.
    
    (closes issue ASTERISK-18101)
    (closes issue ASTERISK-18487)
    Reported by: Paul Rolfe, Jason Legault
    Tested by: irroot, Jason Legault, Paul Rolfe
    Reviewed by: Matthew Nicholson
    
    Review: https://reviewboard.asterisk.org/r/1402/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-15 15:59:24 +00:00
Alec L Davis 5ad57732f5 Merged revisions 334621 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r334621 | alecdavis | 2011-09-07 20:14:50 +1200 (Wed, 07 Sep 2011) | 9 lines
  
  Merged revisions 334620 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r334620 | alecdavis | 2011-09-07 20:12:49 +1200 (Wed, 07 Sep 2011) | 2 lines
    
    peroid typo
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 08:17:24 +00:00
Richard Mudgett 436ceb827c Merged revisions 333011 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r333011 | rmudgett | 2011-08-23 13:15:49 -0500 (Tue, 23 Aug 2011) | 19 lines
  
  Merged revisions 333010 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r333010 | rmudgett | 2011-08-23 13:14:01 -0500 (Tue, 23 Aug 2011) | 12 lines
    
    Memory Leak in app_queue
    
    The patch that was committed in the 1.6.x versions of Asterisk for
    ASTERISK-15862 actually fixed two issues.  One was not applicable to 1.8
    but the other is.  queue_leak.patch fixes the portion applicable to 1.8.
    
    (closes issue ASTERISK-18265)
    Reported by: Fred Schroeder
    Patches:
          queue_leak.patch (license #5049) patch uploaded by mmichelson
    Tested by: Thomas Arimont
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@333014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-23 18:17:52 +00:00
Richard Mudgett b92dcb0c82 Merged revisions 332875,332878 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r332875 | rmudgett | 2011-08-22 14:41:03 -0500 (Mon, 22 Aug 2011) | 1 line
  
  Fix merge property.
................
  r332878 | rmudgett | 2011-08-22 14:46:25 -0500 (Mon, 22 Aug 2011) | 25 lines
  
  Merged revisions 332874 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r332874 | rmudgett | 2011-08-22 14:32:19 -0500 (Mon, 22 Aug 2011) | 18 lines
    
    Reference leaks in app_queue.
    
    * Fixed load_realtime_queue() leaking a queue reference when it overwrites
    q when processing a realtime queue.
    (issue ASTERISK-18265)
    
    * Make join_queue() unreference the queue returned by
    load_realtime_queue() when it is done with the pointer.  The
    load_realtime_queue() returns a reference to the just loaded realtime
    queue.
    
    * Fixed queues container reference leak in queues_data_provider_get().
    
    * queue_unref() should not return q that was just unreferenced.
    
    * Made logic in __queues_show() and queues_data_provider_get() when
    calling load_realtime_queue() easier to understand.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22 20:01:30 +00:00
Matthew Nicholson c9f65ece49 Merged revisions 331775 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r331775 | mnicholson | 2011-08-12 14:03:31 -0500 (Fri, 12 Aug 2011) | 17 lines
  
  Merged revisions 331774 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r331774 | mnicholson | 2011-08-12 14:01:27 -0500 (Fri, 12 Aug 2011) | 11 lines
    
    Unlock the channel before calling update_queue.
    
    Holding the channel lock when calling update_queue which attempts to lock the
    queue lock can cause a deadlock. This deadlock involves the following chain:
    
    1. hold chan lock -> wait queue lock
    2. hold queue lock -> wait agent list lock
    3. hold agent list lock -> wait chan list lock
    4. hold chan list lock -> wait chan lock
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-12 19:06:10 +00:00
Kinsey Moore 0f5ef2c781 Log queue member name when state_interface is set for ADDMEMBER and REMOVEMEMBER events
app_queue logs the events ADDMEMBER and REMOVEMEMBER with the agent field set
to the interface value rather than the membername value when a member is added
with a state_interface value set.  However all other member related queue
events are logged with the membername when a state_interface is set.  This
patch makes these fields optionally more consistent and correct.

(closes issue ASTERISK-14769)
Review: https://reviewboard.asterisk.org/r/1286
Patch-by: Jamuel Starkey
Tested-by: Kinsey Moore <kmoore@digium.com>


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-08 20:28:20 +00:00
Kinsey Moore d1a0938c99 app_queue: Add StateInterface to output of "queue show" and "QueueStatus"
This patch adds the state_interface of the queue member struct to the output
of "queue show" (CLI command) and "QueueStatus" (AMI action) when displaying
relevant queue member information.  For the AMI event message the variable
StateInterface has been added.

(closes issue ASTERISK-18071)
Review: https://reviewboard.asterisk.org/r/1300/
Patch-by: Jamuel Starkey


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-08 15:00:26 +00:00
Richard Mudgett 145c174565 Merged revisions 328329 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

........
  r328329 | rmudgett | 2011-07-14 19:19:32 -0500 (Thu, 14 Jul 2011) | 2 lines
  
  Make hint watcher callback take const strings for context and exten parameters.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-15 00:23:14 +00:00
Leif Madsen a525edea59 Merged revisions 328247 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines
  
  Merged revisions 328209 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines
    
    Introduce <support_level> tags in MODULEINFO.
    This change introduces MODULEINFO into many modules in Asterisk in order to show
    the community support level for those modules. This is used by changes committed
    to menuselect by Russell Bryant recently (r917 in menuselect). More information about
    the support level types and what they mean is available on the wiki at
    https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14 20:28:54 +00:00
Tilghman Lesher 7d179abfd4 Merged revisions 326411 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r326411 | tilghman | 2011-07-05 17:08:29 -0500 (Tue, 05 Jul 2011) | 14 lines
  
  Add the attribute "type" to each "<use>" for menuselect.
  
  This matters only when autoconf fails to detect that weak linking is supported.
  External optional dependencies will become optional in both cases, as they are
  removed at compile time when not detected.  However, runtime-optional modules
  are made mandatory when weak linking is not found.  This change affects only
  the external optional dependencies; previously, they were incorrectly required
  when weak linking support was not detected.
  
  Patches:
  	20110702__issue18062__asterisk_trunk.diff.txt by tilghman (License #5003)
  
  Tested by: iasgoscouk
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-05 22:11:40 +00:00
Richard Mudgett 4240017462 Merged revisions 325614 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r325614 | rmudgett | 2011-06-29 13:16:45 -0500 (Wed, 29 Jun 2011) | 5 lines
  
  Fixed some error exit cleanup in app_queue.c.
  
  * Fixed error exit cleanup in app_queue.c copy_rules() and
  reload_queue_rules().
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@325616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-29 18:18:00 +00:00
Richard Mudgett 54763625c6 Merged revisions 325610 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r325610 | rmudgett | 2011-06-29 13:05:15 -0500 (Wed, 29 Jun 2011) | 18 lines
  
  Response to QueueRule manager command does not contain ActionID if it was specified.
  
  * Add ActionID support as documented for the QueueRule AMI action.
  
  * Remove documentation for ActionID with the Queues AMI action.  The
  output does not follow normal AMI response output and there is no place to
  put an ActionID header.
  
  (closes issue AST-602)
  Reported by: Vlad Povorozniuc
  Patches:
        jira_ast_602_v1.8.patch (license #5621) patch uploaded by rmudgett
  Tested by: Vlad Povorozniuc, rmudgett
  
  Review: https://reviewboard.asterisk.org/r/1295/
  
  JIRA SWP-3575
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@325611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-29 18:07:26 +00:00
Gregory Nietsky f99a06d030 Commit "distrotech" app_queue changes to Trunk
* Added general option negative_penalty_invalid default off. when set
   members are seen as invalid/logged out when there penalty is negative.  
   for realtime members when set remove from queue will set penalty to -1.  
 * Added queue option autopausedelay when autopause is enabled it will be
   delayed for this number of seconds since last successful call if there
   was no prior call the agent will be autopaused immediately.
 * Added member option ignorebusy this when set and ringinuse is not   
   will allow per member control of multiple calls as ringinuse does for
   the Queue.
  
 - Mark QUEUE_MEMBER_PENALTY Deprecated it never worked for realtime members
 - QUEUE_MEMBER is now R/W supporting setting paused, ignorebusy and penalty.

(closes issue ASTERISK-17421)
(closes issue ASTERISK-17391)
Reported by: irroot
Tested by: irroot, jrose
Review: https://reviewboard.asterisk.org/r/1119/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@325483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-29 06:39:26 +00:00
Richard Mudgett 67dc7a4c93 Merged revisions 322484 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r322484 | rmudgett | 2011-06-08 15:46:55 -0500 (Wed, 08 Jun 2011) | 15 lines
  
  Ring all queue with more than 255 agents will cause crash.
  
  1. Create a ring-all queue with 500 permanent agents.
  2. Call it.
  3. Asterisk will crash.
  
  The watchers array in app_queue.c has a hard limit of 255.  Bounds
  checking is not done on this array.  No sane person should put 255 people
  in a ring-all queue, but we should not crash anyway.
  
  * Added bounds checking to the watchers array.
  
  JIRA AST-464
  JIRA SWP-2903
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-08 20:48:03 +00:00
Gregory Nietsky 2cfe89a7fd Remove Unused Var Warning rt_handle_member_record
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322128 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-06 19:39:25 +00:00
Gregory Nietsky cfb10e99b5 Refactor rt_handle_member_record
Review: https://reviewboard.asterisk.org/r/1172



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-06 19:30:56 +00:00
Richard Mudgett 0096238b52 Merged revisions 320823 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r320823 | rmudgett | 2011-05-25 12:06:38 -0500 (Wed, 25 May 2011) | 18 lines
  
  The AMI Newstate event contains different information between v1.4 and v1.8.
  
  The addition of connected line support in v1.8 changes the behavior of the
  channel caller ID somewhat.  The channel caller ID value no longer time
  shares with the connected line ID on outgoing call legs.  The timing of
  some AMI events/responses output the connected line ID as caller ID.
  These party ID's are now separate.
  
  * The ConnectedLineNum and ConnectedLineName headers were added to many
  AMI events/responses if the CallerIDNum/CallerIDName headers were also
  present.
  
  (closes issue #18252)
  Reported by: gje
  Tested by: rmudgett
  
  Review: https://reviewboard.asterisk.org/r/1227/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@320825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-25 17:14:11 +00:00
Terry Wilson 892953466b Merged revisions 317584 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r317584 | twilson | 2011-05-06 01:18:53 -0700 (Fri, 06 May 2011) | 20 lines
  
  Merged revisions 317575 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r317575 | twilson | 2011-05-06 01:04:17 -0700 (Fri, 06 May 2011) | 13 lines
    
    Merged revisions 317574 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r317574 | twilson | 2011-05-06 00:55:21 -0700 (Fri, 06 May 2011) | 6 lines
      
      Re-fix queue round-robin
      
      This part of the change for r315596 was incorrect. No bridge occurs
      when doing a roundrobin dial and no one answers, so this code shouldn't
      have been removed.
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-06 08:21:22 +00:00
Russell Bryant 7a2103efa6 Merged revisions 317336 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r317336 | russell | 2011-05-05 14:55:58 -0500 (Thu, 05 May 2011) | 7 lines
  
  Increase buffer size to be PATH_MAX for a path.
  
  (closes issue #19239)
  Reported by: byronclark
  Patches:
        queue_announce_length.patch uploaded by byronclark (license 1200)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 19:56:44 +00:00
Russell Bryant 37aa52fd78 Merged revisions 316265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines
  
  Fix a bunch of compiler warnings generated by gcc 4.6.0.
  
  Most of these are -Wunused-but-set-variable, but there were a few others
  mixed in here, as well.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 20:45:32 +00:00
Terry Wilson 8d2a71877a Merged revisions 315644 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r315644 | twilson | 2011-04-26 14:39:01 -0700 (Tue, 26 Apr 2011) | 32 lines
  
  Merged revisions 315643 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r315643 | twilson | 2011-04-26 14:27:44 -0700 (Tue, 26 Apr 2011) | 25 lines
    
    Merged revisions 315596 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r315596 | twilson | 2011-04-26 14:16:10 -0700 (Tue, 26 Apr 2011) | 18 lines
      
      Allow transfer loops without allowing forwarding loops
      
      We try to avoid the situation where two phones may be forwarded to each other
      causing an infinite loop by storing each dialed interface in a channel
      datastore and checking the list before dialing out. This works, but currently
      breaks situations like A calls B, A transfers B to C, B transfers C to A, and A
      transfers C to B. Since human interaction is happening here and not an
      automated forwarding loop, it should be allowed.
      
      This patch removes the dialed_interfaces datastore when a call is bridged (a
      suggestion from the brilliant mmichelson). If a call is being bridged, it
      should be safe to assume that we aren't stuck in a loop.
      
      Since we are now handling this is the bridge code, the previous attempts at
      handling it in app_dial and app_queue are removed.
      
      Review: https://reviewboard.asterisk.org/r/1195/
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@315670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-26 22:26:37 +00:00
Jason Parker 551dac2eda Merged revisions 308010 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r308010 | qwell | 2011-02-15 17:34:03 -0600 (Tue, 15 Feb 2011) | 24 lines
  
  Merged revisions 308007 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r308007 | qwell | 2011-02-15 17:33:24 -0600 (Tue, 15 Feb 2011) | 17 lines
    
    Merged revisions 308002 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r308002 | qwell | 2011-02-15 17:32:20 -0600 (Tue, 15 Feb 2011) | 10 lines
      
      Fix regression that changed behavior of queues when ringing a queue member.
      
      This reverts r298596, which was to fix a highly bizarre and contrived issue
      with a queue member that called into his own queue being transferred back
      into his own queue.  I couldn't reproduce that issue in any way.  I think one
      of the other recent transfer fixes actually fixed this.
      
      (closes issue #18747)
      Reported by: vrban
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-15 23:34:27 +00:00
Tilghman Lesher 7800a1c330 Merged revisions 307750 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r307750 | tilghman | 2011-02-14 00:50:23 -0600 (Mon, 14 Feb 2011) | 23 lines
  
  Calling a gosub routine defined in AEL from Dial/Queue ceased to work.
  
  A bug in AEL did not distinguish between the "s" extension generated by
  AEL and an "s" extension that was required to exist by the chan_dahdi
  (or another channel) that was not supplied with a starting extension.
  Therefore, AEL made incorrect assumptions about what commands were
  permissable in the context.  This was fixed by making AEL generate a
  different extension name.  However, Dial and Queue make additional
  assumptions about the name of the default gosub extension.  Therefore,
  they needed to be brought into line with a "macro" rendered by AEL (as
  a gosub), without breaking traditional dialplans written without the
  aid of AEL.
  
  Related to (issue #18480)
   Reported by: nivek
  
  (closes issue #18729)
   Reported by: kkm
   Patches: 
         20110209__issue18729.diff.txt uploaded by tilghman (license 14)
         018729-dial-queue-gosub-try3.patch uploaded by kkm (license 888)
   Tested by: kkm
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-14 06:54:08 +00:00
Jason Parker 0beeb00ef3 Merged revisions 306356 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r306356 | qwell | 2011-02-04 13:24:29 -0600 (Fri, 04 Feb 2011) | 16 lines
  
  Merged revisions 306346 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r306346 | qwell | 2011-02-04 13:21:43 -0600 (Fri, 04 Feb 2011) | 9 lines
    
    Don't fallthrough to 'unknown' in the 'ringing' case.
    
    This could cause improper exits from the queue.
    
    (closes issue #18499)
    Reported by: zaltar
    Patches: 
          app_queue.patch uploaded by zaltar (license 1148)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04 19:24:54 +00:00
Richard Mudgett 4d8feab7fa Merged revisions 306324 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r306324 | rmudgett | 2011-02-04 12:53:06 -0600 (Fri, 04 Feb 2011) | 9 lines
  
  Don't send redirecting updates to the caller if the dialplan forked the call.
  
  Each fork in the dial could be redirected and confuse the caller.  For
  ISDN the DivLeg1 and DivLeg3 messages would get confused because ISDN
  redirects calls in sequence not in parallel.
  
  * Also fixed a formatting inconsistency in app_dial.c and make a warning
  message more useful about what frame type could not be written.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04 18:57:39 +00:00
Andrew Latham f9c3b26241 Add Function and Application Relationships to documentation
Add and extend the see-also sections to the documentation for applications
and functions in an effort to expand the online documentation of the wiki.
Also check for and update any links to moved documentation in the doc folder.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@304913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-30 00:22:59 +00:00
Jeff Peeler a4fec286f8 Merged revisions 303009 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r303009 | jpeeler | 2011-01-20 11:10:32 -0600 (Thu, 20 Jan 2011) | 21 lines
  
  Merged revisions 303008 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r303008 | jpeeler | 2011-01-20 11:07:44 -0600 (Thu, 20 Jan 2011) | 14 lines
    
    Merged revisions 303007 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r303007 | jpeeler | 2011-01-20 11:04:08 -0600 (Thu, 20 Jan 2011) | 8 lines
      
      Add new queue strategy to preserve behavior for when queue members moved to ao2.
      
      Add queue strategy called "rrordered" to mimic old behavior from when queue
      members were stored in a linked list.
      
      ABE-2707
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@303011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-20 17:14:01 +00:00
Jeff Peeler 6c0b904d17 Merged revisions 298598 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r298598 | jpeeler | 2010-12-16 14:51:44 -0600 (Thu, 16 Dec 2010) | 21 lines
  
  Merged revisions 298597 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r298597 | jpeeler | 2010-12-16 14:49:33 -0600 (Thu, 16 Dec 2010) | 14 lines
    
    Merged revisions 298596 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r298596 | jpeeler | 2010-12-16 14:46:52 -0600 (Thu, 16 Dec 2010) | 7 lines
      
      Fix improper hangup when doing an attended transfer to queue.
      
      Had to indicate ringing in wait_for_answer so the attended transfer code would
      not try and hang up the local channel it created, which would kill the call.
      
      ABE-2624
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@298599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-16 20:52:19 +00:00
Brett Bryant b54348691a Merged revisions 295670 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r295670 | bbryant | 2010-11-19 16:40:21 -0500 (Fri, 19 Nov 2010) | 8 lines
  
  Patch for deadlock from ordering issue between channel/queue locks in app_queue
  (set_queue_variables).
  
  (closes issue #18031)
  Reported by: rain
  
  Review: https://reviewboard.asterisk.org/r/1018/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@295671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-19 21:42:10 +00:00
Richard Mudgett 851141c131 Merged revisions 288079-288080 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r288079 | rmudgett | 2010-09-21 15:29:51 -0500 (Tue, 21 Sep 2010) | 2 lines
  
  Protect channel access in CONNECTED_LINE and REDIRECTING interception macro launch code.
........
  r288080 | rmudgett | 2010-09-21 15:29:59 -0500 (Tue, 21 Sep 2010) | 8 lines
  
  Simplify locking code for REDIRECTING interception macro when forwarding a call.
  
  Simplified the locking code by using a local copy of the redirecting party
  information in app_dial.c:do_forward() and app_queue.c:wait_for_answer()
  for launching the REDIRECTING interception macro when a call is forwarded.
  
  Reduced the lock time of the 'o->chan' and 'in' channels.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-21 20:33:20 +00:00
Tilghman Lesher b717decec6 Merged revisions 287388 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r287388 | tilghman | 2010-09-17 16:08:54 -0500 (Fri, 17 Sep 2010) | 21 lines
  
  Merged revisions 287387 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r287387 | tilghman | 2010-09-17 16:08:00 -0500 (Fri, 17 Sep 2010) | 14 lines
    
    Merged revisions 287386 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r287386 | tilghman | 2010-09-17 16:06:03 -0500 (Fri, 17 Sep 2010) | 7 lines
      
      Blank columns should get set on reload, not ignored.
      
      (closes issue #16893)
       Reported by: haakon
       Patches: 
             20100818__issue16893.diff.txt uploaded by tilghman (license 14)
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287389 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-17 21:10:02 +00:00
Russell Bryant dd1e62c095 Merged revisions 287193 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r287193 | russell | 2010-09-16 16:57:51 -0500 (Thu, 16 Sep 2010) | 4 lines
  
  Set the default for "autofill" and "shared_lastcall" to "yes" in queues.conf.
  
  Review: https://reviewboard.asterisk.org/r/922/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-16 22:00:15 +00:00