Commit Graph

1075 Commits

Author SHA1 Message Date
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
Tilghman Lesher 27cbcba255 Merged revisions 284632 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r284632 | tilghman | 2010-09-02 00:31:02 -0500 (Thu, 02 Sep 2010) | 14 lines
  
  Merged revisions 284631 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r284631 | tilghman | 2010-09-02 00:30:16 -0500 (Thu, 02 Sep 2010) | 7 lines
    
    Don't reset queue stats on a module reload.
    
    (closes issue #17535)
     Reported by: raarts
     Patches: 
           20100819__issue17535.diff.txt uploaded by tilghman (license 14)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02 05:31:47 +00:00
Tilghman Lesher 8190e96fad Merged revisions 284610 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r284610 | tilghman | 2010-09-02 00:20:59 -0500 (Thu, 02 Sep 2010) | 10 lines
  
  When optional_api is non-optional, force dependent modules to be loaded.
  
  (closes issue #17707)
   Reported by: ira
   Patches: 
         20100819__issue17707__asterisk1.8.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman
   
  Review: https://reviewboard.asterisk.org/r/876/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02 05:27:53 +00:00
Sean Bright 395ecf1153 Merged revisions 280161 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r280161 | seanbright | 2010-07-28 12:52:12 -0400 (Wed, 28 Jul 2010) | 15 lines
  
  Merged revisions 280160 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r280160 | seanbright | 2010-07-28 12:51:11 -0400 (Wed, 28 Jul 2010) | 8 lines
    
    Plug a reference leak in app_queue when adding members dynamically.
    
    (closes issue #17738)
    Reported by: bobwienholt
    Patches:
          issue17738.patch uploaded by bobwienholt (license 950)
    Tested by: bobwienholt, seanbright
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@280162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-28 16:53:14 +00:00
Richard Mudgett ff2dc29d88 Merged revisions 279227 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r279227 | rmudgett | 2010-07-23 17:20:47 -0500 (Fri, 23 Jul 2010) | 21 lines
  
  Merged revisions 279207 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r279207 | rmudgett | 2010-07-23 17:11:23 -0500 (Fri, 23 Jul 2010) | 14 lines
    
    Merged revisions 279206 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r279206 | rmudgett | 2010-07-23 16:56:44 -0500 (Fri, 23 Jul 2010) | 7 lines
      
      SIP promiscuous redirect could fail to dial the redirect.
      
      The ast_channel was created with one variable to ast_request() but the
      call to ast_call() that initiates the outgoing call was using a different
      variable.  The two variables are not equivalent if the call_forward string
      included a channel technology specifier.  e.g., SIP/200
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@279245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-23 22:24:52 +00:00
Tilghman Lesher b4e18d5660 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 19:35:02 +00:00
Jeff Peeler 5b8a8fc6c8 Fix reporting estimated queue hold time.
Just say the number of seconds (after minutes) rather than doing some incorrect
calculation with respect to minutes.

(closes issue #17498)
Reported by: corruptor
Patches: 
      holdesecs_bug.diff uploaded by corruptor (license 253)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16 21:16:08 +00:00
Jeff Peeler b73c1377e5 Add missing handling for ringing state for use with queue empty options.
(closes issue #17471)
Reported by: jazzy
Patches: 
      app_queue.c.diff uploaded by jazzy (license 1056)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16 19:22:49 +00:00
Olle Johansson 65203b12dd Add a dialplan function to check if a queue exists: QUEUE_EXISTS
Review: https://reviewboard.asterisk.org/r/777/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16 09:25:48 +00:00
Richard Mudgett ec37ffbdaf ast_callerid restructuring
The purpose of this patch is to eliminate struct ast_callerid since it has
turned into a miscellaneous collection of various party information.

Eliminate struct ast_callerid and replace it with the following struct
organization:

struct ast_party_name {
	char *str;
	int char_set;
	int presentation;
	unsigned char valid;
};
struct ast_party_number {
	char *str;
	int plan;
	int presentation;
	unsigned char valid;
};
struct ast_party_subaddress {
	char *str;
	int type;
	unsigned char odd_even_indicator;
	unsigned char valid;
};
struct ast_party_id {
	struct ast_party_name name;
	struct ast_party_number number;
	struct ast_party_subaddress subaddress;
	char *tag;
};
struct ast_party_dialed {
	struct {
		char *str;
		int plan;
	} number;
	struct ast_party_subaddress subaddress;
	int transit_network_select;
};
struct ast_party_caller {
	struct ast_party_id id;
	char *ani;
	int ani2;
};

The new organization adds some new information as well.

* The party name and number now have their own presentation value that can
be manipulated independently.  ISDN supplies the presentation value for
the name and number at different times with the possibility that they
could be different.

* The party name and number now have a valid flag.  Before this change the
name or number string could be empty if the presentation were restricted.
Most channel drivers assume that the name or number is then simply not
available instead of indicating that the name or number was restricted.

* The party name now has a character set value.  SIP and Q.SIG have the
ability to indicate what character set a name string is using so it could
be presented properly.

* The dialed party now has a numbering plan value that could be useful to
have available.

The various channel drivers will need to be updated to support the new
core features as needed.  They have simply been converted to supply
current functionality at this time.


The following items of note were either corrected or enhanced:

* The CONNECTEDLINE() and REDIRECTING() dialplan functions were
consolidated into func_callerid.c to share party id handling code.

* CALLERPRES() is now deprecated because the name and number have their
own presentation values.

* Fixed app_alarmreceiver.c write_metadata().  The workstring[] could
contain garbage.  It also can only contain the caller id number so using
ast_callerid_parse() on it is silly.  There was also a typo in the
CALLERNAME if test.

* Fixed app_rpt.c using ast_callerid_parse() on the channel's caller id
number string.  ast_callerid_parse() alters the given buffer which in this
case is the channel's caller id number string.  Then using
ast_shrink_phone_number() could alter it even more.

* Fixed caller ID name and number memory leak in chan_usbradio.c.

* Fixed uninitialized char arrays cid_num[] and cid_name[] in
sig_analog.c.

* Protected access to a caller channel with lock in chan_sip.c.

* Clarified intent of code in app_meetme.c sla_ring_station() and
dial_trunk().  Also made save all caller ID data instead of just the name
and number strings.

* Simplified cdr.c set_one_cid().  It hand coded the ast_callerid_merge()
function.

* Corrected some weirdness with app_privacy.c's use of caller
presentation.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 15:48:36 +00:00
Eliel C. Sardanons a1b89a6a50 Implement AstData API data providers as part of the GSOC 2010 project,
midterm evaluation.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08 14:48:42 +00:00
Tilghman Lesher 45a4bf35c2 The switch fallthrough could create some errorneous situations, so best to force directly to the default case.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-02 16:57:28 +00:00
Matthew Nicholson cb22af3ec5 Merged revisions 272367 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

This version of the patch only adds AgentComplete for attended transfers.  It was already present for blind transfers.

........
  r272367 | mnicholson | 2010-06-23 17:33:51 -0500 (Wed, 23 Jun 2010) | 8 lines
  
  Send AgentComplete manager events in the event of blind and attended transfers.
  
  (closes issue #16819)
  Reported by: elbriga
  Patches:
        app_queue.diff uploaded by elbriga (license 482)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-23 22:36:49 +00:00
Richard Mudgett afd4454c44 Generic Advice of Charge.
Asterisk Generic AOC Representation
- Generic AOC encode/decode routines.
  (Generic AOC must be encoded to be passed on the wire in the AST_CONTROL_AOC frame)
- AST_CONTROL_AOC frame type to represent generic encoded AOC data
- Manager events for AOC-S, AOC-D, and AOC-E messages

Asterisk App Support
- app_dial AOC-S pass-through support on call setup
- app_queue AOC-S pass-through support on call setup

AOC Unit Tests
- AOC Unit Tests for encode/decode routines
- AOC Unit Test for manager event representation.

SIP AOC Support
- Pass-through of generic AOC-D and AOC-E messages to snom phones via the
  snom AOC specification.
- Creation of chan_sip page3 flags for the addition of the new
  'snom_aoc_enabled' sip.conf option.

IAX AOC Support
- Natively supports AOC pass-through through the use of the new
  AST_CONTROL_AOC frame type

DAHDI AOC Support
- ETSI PRI full AOC Pass-through support
- 'aoc_enable' chan_dahdi.conf option for independently enabling
  pass-through of AOC-S, AOC-D, AOC-E.
- 'aoce_delayhangup' option for retrieving AOC-E on disconnect.
- DAHDI A() dial string option for requesting AOC services.
  example usage:
  ;requests AOC-S, AOC-D, and AOC-E on call setup
  exten=>1111,1,Dial(DAHDI/g1/1112/A(s,d,e))

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 18:10:15 +00:00
Matthew Nicholson 9ed82007f1 Merged revisions 265610 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r265610 | mnicholson | 2010-05-25 11:48:19 -0500 (Tue, 25 May 2010) | 8 lines
  
  Don't mark the cdr records of unanswered queue calls with "NOANSWER".  This restores the behavior prior to r258670.
  
  (closes issue #17334)
  Reported by: jvandal
  Patches:
        queue-cdr-fixes1.diff uploaded by mnicholson (license 96)
  Tested by: aragon, jvandal
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@265611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-25 17:00:11 +00:00
Mark Michelson 1225ee831c Merged revisions 265089 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r265089 | mmichelson | 2010-05-21 15:59:14 -0500 (Fri, 21 May 2010) | 8 lines
  
  Don't hang up on a queue caller if the file we attempt to play does not exist.
  
  This also fixes a documentation mistake in file.h that made my original attempt
  to correct this problem not work correctly.
  
  (closes issue #17061)
  Reported by: RoadKill
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@265090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-21 21:08:51 +00:00
Richard Mudgett 3d1f005fed Dial and queue connected line update macro not always run when expected.
The connected line update macro would not get run if the connected line
number string was empty.  The number could be empty if the connected line
update did not update a number but the name.  It should be run if there
was an AST_CONTROL_CONNECTED_LINE frame received for pending dials and
queues.

Renamed and added some more comments for some confusing identifiers
directly connected to the related code.

Also fixed a memory leak in app_queue.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-20 19:40:03 +00:00
Mark Michelson b5d5cc565f Enhancements to connected line and redirecting work.
From reviewboard:

Digium has a commercial customer who has made extensive use of the connected party and
redirecting information present in later versions of Asterisk Business Edition and which
is to be in the upcoming 1.8 release. Through their use of the feature, new problems and solutions
have come about. This patch adds several enhancements to maximize usage of the connected party
and redirecting information functionality.

First, Asterisk trunk already had connected line interception macros. These macros allow you to
manipulate connected line information before it was sent out to its target. This patch adds the
same feature except for redirecting information instead.

Second, the ast_callerid and ast_party_id structures have been enhanced to provide a "tag." This
tag can be set with func_callerid, func_connectedline, func_redirecting, and in the case of DAHDI,
mISDN, and SIP channels, can be set in a configuration file. The idea behind the callerid tag is
that it can be set to whatever value the administrator likes. Later, when running connected line
and redirecting macros, the admin can read the tag off the appropriate structure to determine what
action to take. You can think of this sort of like a channel variable, except that instead of having
the variable associated with a channel, the variable is associated with a specific identity within
Asterisk.

Third, app_dial has two new options, s and u. The s option lets a dialplan writer force a specific
caller ID tag to be placed on the outgoing channel. The u option allows the dialplan writer to force
a specific calling presentation value on the outgoing channel.

Fourth, there is a new control frame subclass called AST_CONTROL_READ_ACTION added. This was added
to correct a very specific situation. In the case of SIP semi-attended (blond) transfers, the party
being transferred would not have the opportunity to run a connected line interception macro to
possibly alter the transfer target's connected line information. The issue here was that during a
blond transfer, the SIP transfer code has no bridged channel on which to queue the connected line
update. The way this was corrected was to add this new control frame subclass. Now, we queue an
AST_CONTROL_READ_ACTION frame on the channel on which the connected line interception macro should
be run. When ast_read is called to read the frame, ast_read responds by calling a callback function
associated with the specific read action the control frame describes. In this case, the action taken
is to run the connected line interception macro on the transferee's channel.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-17 15:36:31 +00:00
Paul Belanger d7ff67179d 'queue reset stats' erroneously clears wrapuptime configuration.
Resets each member's lastcall to 0 now.

(closes issue #17262)
Reported by: rain
Patches:
      wrapuptime_reset_fix.diff uploaded by rain (license 327)
Tested by: rain


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-05 15:42:07 +00:00
Mark Michelson fc652b869a Add new possible value to autopause option to allow members to be autopaused in all queues.
See the CHANGES file and queues.conf.sample for more details.

(closes issue #17008)
Reported by: jlpedrosa
Patches:
      queues.autopause_en_review.diff uploaded by jlpedrosa (license 1002)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-04 22:46:42 +00:00
Mark Michelson 2dcb4df6d8 Fix logic reversal error when queue callers join the queue.
When a specific position is specified for the queue, the idea
was that the caller cannot be placed ahead of higher-priority
callers. Unfortunately, the logic was reversed so that the caller
could ONLY be placed ahead of higher priority callers.

Discovered while writing a unit test.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-30 19:53:36 +00:00
Eliel C. Sardanons a753e8878b Asterisk data retrieval API.
This module implements an abstraction for retrieving and exporting
asterisk data.
Developed by:
	Brett Bryant <brettbryant@gmail.com>
	Eliel C. Sardanons (LU1ALY) <eliels@gmail.com>
For the Google Summer of code 2009 Project.
Documentation can be found in doxygen format and inside the
header include/asterisk/data.h

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-22 18:07:02 +00:00
Richard Mudgett a5a0a5f867 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229
ABE-2161

* Ensure chan_local.c:local_call() will not leak cid.cid_dnid when
copying.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-03 02:12:33 +00:00
Sean Bright 9461bac812 Remove unused structure member in app_queue.
(closes issue #15494)
Reported by: makoto


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23 20:52:35 +00:00
Richard Mudgett 73ef4b8daf Removed cdrflags from ast_channel structure.
Only chan_dahdi set a value in cdrflags.  Everyone else just copied it
around the system.  Noone cared about any value it may have contained.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 19:38:06 +00:00
David Vossel 48134df655 fixes Queue with C option crash
(closes issue #16475)
Reported by: okrief
Patches:
      queue_crash.diff uploaded by dvossel (license 671)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18 20:58:41 +00:00
Mark Michelson c54f8ced1b Merged revisions 247168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r247168 | mmichelson | 2010-02-17 10:24:17 -0600 (Wed, 17 Feb 2010) | 3 lines
  
  Make sure that when autofill is disabled that callers not in the front of the queue cannot place calls.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 16:24:54 +00:00
David Vossel fa156c067d Merged revisions 246115 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r246115 | dvossel | 2010-02-10 11:44:20 -0600 (Wed, 10 Feb 2010) | 8 lines
  
  fixes random deadlock in app_queue with use_weight during reload
  
  (closes issue #16677)
  Reported by: tim_ringenbach
  Patches:
        app_queue_use_weight_deadlock.diff uploaded by tim ringenbach (license 540)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10 17:49:34 +00:00
Jeff Peeler 0f7c1a8cc9 Merged revisions 243691 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r243691 | jpeeler | 2010-01-27 14:35:56 -0600 (Wed, 27 Jan 2010) | 5 lines
  
  Revert 243570, I should have looked at this closer. Will reopen the issue, but
  am leaving the review closed as the change was pointless.
  
  (issue #16488)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27 20:37:33 +00:00
Jeff Peeler 7e20456f3a Merged revisions 243570 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r243570 | jpeeler | 2010-01-27 12:47:34 -0600 (Wed, 27 Jan 2010) | 9 lines
  
  Extend announcement URL used with Queue from 80 chars to PATH_MAX.
  
  (closes issue #16488)
  Reported by: syspert
  Patches: 
        soundfilelen.pacth-2 uploaded by syspert (license 938)
  
  Review: https://reviewboard.asterisk.org/r/475/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27 18:49:52 +00:00
David Vossel 8d8800072e fixes spelling error. s/memeber/member
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 15:52:55 +00:00
David Vossel 0a6c0ee1f7 cli 'queue show' formatting fix. queue name was truncated over 12 characters
(closes issue #16078)
Reported by: RoadKill
Patches:
      quequename_limit.patch uploaded by ppyy (license 906)
Tested by: dvossel


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-07 18:58:23 +00:00
David Vossel bfae8dca78 fixes holdtime playback issue in app_queue
When reporting hold time, the number of seconds should be mod 60.
Otherwise audio playback could be something like "2 minutes 123 seconds"
rather than "2 minutes 3 seconds".

Also, the "minute" sound file is missing, so for the moment until
that file can be created the "minutes" file is used instead.

(closes issue #16168)
Reported by: nickilo
Patches:
      patch-unified-trunk-rev-222176 uploaded by nickilo (license )
Tested by: nickilo, wonderg



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05 23:08:50 +00:00
David Vossel 688e1bbac6 app_queue segfaults if realtime field uniqueid is NULL
(closes issue #16385)
Reported by: haakon
Patches:
      app_queue.c.patch uploaded by haakon (license 880)
      app_queue.c.patch_v2 uploaded by dvossel (license 671)
Tested by: haakon



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-04 16:39:11 +00:00
David Vossel 0a5d21e6c7 QUEUE_MEMBER(..., ready) counts only ready agents, not free agents wrapping up
The QUEUE_MEMBER dialplan function can return total members,
logged-in members and "free" members count. A member is counted
as "free" immediately after his call ends, even though its wrap-up
time, if specified in queues.conf, has not yet expired, and the
queue will not actually route a call to it.

This Patch introduces a new "ready" option that only counts
free agents no longer in the wrap up time period.

(closes issue #16240)
Reported by: kkm
Patches:
      appqueue-memberfun-readyoption-trunk.diff uploaded by kkm (license 888)
Tested by: kkm, dvossel


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-23 19:14:05 +00:00
David Vossel 065fce7310 update CHANGES to reflect new 'R' app_queue option plus a minor optimization to the feature patch
(issue #16384)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-23 18:45:54 +00:00
David Vossel 6892b103ab new parameter 'R' to the Queue application
The 'R' argument stops moh and indicates ringing once the agent is
ringing.  This allows the person in the queue to know their call
is potentially about to be answered.

(closes issue #16384)
Reported by: haakon
Patches:
      new_app_queue.c.patch uploaded by haakon (license 880)
Tested by: haakon, loloski, dvossel


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-23 18:39:37 +00:00
David Vossel 63dafe98f6 changes penaltymemberslimit to use scanf for config value parsing
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-04 18:55:21 +00:00
David Vossel e21deabf02 new queue option, penaltymemberslimit, disregards penalty on too few queue members when enabled
(closes issue #14559)
Reported by: fiddur
Patches:
      trunk-199584-1.diff uploaded by fiddur (license 678)
Tested by: fiddur, dvossel


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-04 18:48:31 +00:00
David Vossel 4f5dd10749 app_queue crashes randomly, often during call-transfers
This patch adds a ref to the queue_ent object's parent call_queue
in queue_exec() so the call_queue won't be destroyed
while the the queue_ent still holds a pointer to it.

(closes issue 0015686)
Tested by: dvossel, aragon




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 18:55:07 +00:00
Tilghman Lesher baca4c6437 Found a few places where queue refcounts were counted incorrectly. Also add debug statements.
(closes issue #15982, closes issue #15984)
 Reported by: atis
 Patches: 
       20091111__issue15982.diff.txt uploaded by tilghman (license 14)
 Tested by: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-24 20:31:28 +00:00
Tilghman Lesher 5e2aa190fe Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 20:42:03 +00:00
Matthew Nicholson aabff54c4b Add the 'relative-periodic-announce' option to app_queue to allow for calculating the time of announcments from the end of the previous announcment rather than from the beginning.
(closes issue #15260)
Reported by: tonils


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-09 16:28:31 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
Tilghman Lesher 206d2cbc16 Don't crash when state_interface is NULL.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 03:15:10 +00:00
Joshua Colp 2263ced9dd Add support for using a hint when configuring a state interface using the format hint:<extension>@<context>.
(closes issue #15168)
Reported by: p_lindheimer
Patches:
      queue_extenstate5_1.4.svn.patch uploaded by GameGamer43 (license 894)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 21:16:14 +00:00
Kevin P. Fleming 1c9fe00920 Recorded merge of revisions 222152 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines
  
  Fix ao2_iterator API to hold references to containers being iterated.
  
  See Mantis issue for details of what prompted this change.
  
  Additional notes:
  
  This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK
  has become an enum instead of a macro, with a name that fits our
  naming policy; also, it is now necessary to call
  ao2_iterator_destroy() on any iterator that has been
  created. Currently this only releases the reference to the container
  being iterated, but in the future this could also release other
  resources used by the iterator, if the iterator implementation changes
  to use additional resources.
  
  (closes issue #15987)
  Reported by: kpfleming
  
  Review: https://reviewboard.asterisk.org/r/383/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 01:24:24 +00:00
Matthias Nick 00bb578898 Prevents from division by zero
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 21:15:01 +00:00
Tilghman Lesher 85f18fcb8f Merged revisions 217989 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r217989 | tilghman | 2009-09-10 18:52:22 -0500 (Thu, 10 Sep 2009) | 3 lines
  
  Don't ring another channel, if there's not enough time for a queue member to answer.
  (Fixes AST-228)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 23:54:51 +00:00
Tilghman Lesher 1b08c27c1a Add original position, when logging a caller entering a queue.
(closes issue #15146)
 Reported by: arabe
 Patches: 
       asterisk-trunk.patch uploaded by arabe (license 786)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-20 22:13:26 +00:00
Matthew Nicholson 160eb55c47 Merged revisions 211953 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r211953 | mnicholson | 2009-08-12 18:04:02 -0500 (Wed, 12 Aug 2009) | 10 lines
  
  This patch adds additional checking when generating queue log TRANSFER events.
  
  The additional checks prevent generation of false TRANSFER events in certain situations.
  
  (closes issue #14536)
  Reported by: aragon
  Patches:
        queue-log-xfer-fix1.diff uploaded by mnicholson (license 96)
  Tested by: aragon, mnicholson
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-12 23:14:36 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Tilghman Lesher 20102765bf Merged revisions 211038 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r211038 | tilghman | 2009-08-07 13:16:28 -0500 (Fri, 07 Aug 2009) | 14 lines
  
  QUEUE_MEMBER_LIST _really_ wants the interface name, not the membername.
  
  This is a partial revert of revision 82590, which was an attempted cleanup,
  but in reality, it broke QUEUE_MEMBER_LIST, which has always been intended
  as a method by which component interfaces could be queried from the queue.
  Membername isn't useful here, because that field cannot be used to obtain
  further information about the member.  See the documentation on
  QUEUE_MEMBER_LIST, RemoveQueueMember, QUEUE_MEMBER_PENALTY, and the various
  AMI commands which take a member argument for further justification.
  (closes issue #15664)
   Reported by: rain
   Patches: 
         app_queue-queue_member_list.diff uploaded by rain (license 327)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-07 18:17:41 +00:00
Mark Michelson fd52c5834e Merged revisions 205349 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r205349 | mmichelson | 2009-07-08 14:26:13 -0500 (Wed, 08 Jul 2009) | 14 lines
  
  Prevent phantom calls to queue members.
  
  If a caller were to hang up while a periodic announcement or position
  were being said, the return value for those functions would incorrectly
  indicate that the caller was still in the queue. With these changes,
  the problem does not occur.
  
  (closes issue #14631)
  Reported by: latinsud
  Patches:
        queue_announce_ghost_call2.diff uploaded by latinsud (license 745)
  	  (with small modification from me)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 19:26:55 +00:00
Russell Bryant 0264eef115 Merge the new Channel Event Logging (CEL) subsystem.
CEL is the new system for logging channel events.  This was inspired after
facing many problems trying to represent what is possible to happen to a call
in Asterisk using CDR records.  For more information on CEL, see the built in
HTML or PDF documentation generated from the files in doc/tex/.

Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard
work developing this code.  Also, thanks to Matt Nicholson (mnicholson) and
Sean Bright (seanbright) for their assistance in the final push to get this
code ready for Asterisk trunk.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 15:28:53 +00:00
Kevin P. Fleming aaeec3b40f Last batch of 'static' qualifiers for module-level global variables.
Fix up modules in the 'apps' directory, and also correct the bad example of
enum definitions in include/asterisk/app.h, which many developers followed
(thanks for reading the documentation!). In addition, add some basic usage
examples of the 'pahole' and 'pglobal' tools to the coding guidelines.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 19:10:10 +00:00
Kevin P. Fleming 6c5987811c Redesigned 'optional API' support.
This patch provides a new implementation of the optional API support defined
in asterisk/optional_api.h; this new version provides solves compatibility
issues with the use of linker version scripts for suppressing global symbols.
In addition, there is now a functional (and tested!) implementation for Mac OS/X,
so module writers no longer need to use special tests before calling optional
API functions. All future implementations must provide these same semantics,
so that module writers can rely on them.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 16:07:23 +00:00
Mark Michelson e1c03cbf1a Fix some bad locking stemming from trying to forward a call to a non-existent
extension from a queue.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-12 15:37:30 +00:00
Mark Michelson d222361a29 Fix a potential crash from trying to access a NULL channel pointer.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-12 14:55:07 +00:00
David Vossel c42344b319 ast_call_forward() todo notes and originate flag copy.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-03 20:30:10 +00:00
Mark Michelson 298d745fb4 Add the ability to execute connected line interception macros.
When connected line updates are received or generated in the middle
of an application call, it is now possible to execute a macro to
manipulate the connected line data. This way, phone numbers may be
manipulated to be more presentable to users, names may be changed 
for...whatever reason, or whatever else needs to be done may be.

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

AST-165



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01 20:57:31 +00:00
Mark Michelson 4c7c13d574 Remove extra lock from app_queue.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01 14:45:43 +00:00
Sean Bright 7ee6e9f4ce Add a missing unref for queues in handle_statechange.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26 16:38:54 +00:00
Eliel C. Sardanons 2c882626a0 Implement a new element in AstXML for AMI actions documentation.
A new xml element was created to manage the AMI actions documentation,
using AstXML.
To register a manager action using XML documentation it is now possible
using ast_manager_register_xml().
The CLI command 'manager show command' can be used to show the parsed
documentation.

Example manager xml documentation:
<manager name="ami action name" language="en_US">
    <synopsis>
        AMI action synopsis.
    </synopsis>
    <syntax>
        <xi:include xpointer="xpointer(...)" /> <-- for ActionID
        <parameter name="header1" required="true">
	    <para>Description</para>
	</parameter>
	...
    </syntax>
    <description>
        <para>AMI action description</para>
    </description>
    <see-also>
    	...
    </see-also>
</manager>



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22 17:52:35 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
Tilghman Lesher bdcafc1ab4 Recorded merge of revisions 195366 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r195366 | tilghman | 2009-05-18 15:24:13 -0500 (Mon, 18 May 2009) | 8 lines
  
  Add a similar dependency on SMDI for voicemail as already exists for ADSI.
  (closes issue #14846)
   Reported by: pj
   Patches: 
         20090413__bug14846__1.4.diff.txt uploaded by tilghman (license 14)
         20090507__issue14846__1.6.0.diff.txt uploaded by tilghman (license 14)
         20090507__issue14846__1.6.1.diff.txt uploaded by tilghman (license 14)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 20:52:33 +00:00
Matthew Nicholson 69976640f5 Merged revisions 194028 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r194028 | mnicholson | 2009-05-12 17:15:45 -0500 (Tue, 12 May 2009) | 16 lines
  
  This change modifies app_queue to properly generate CDR records in failure
  situations.
  
  This involves setting a proper cdr disposition coresponding to the given
  failure condition and ensuring the proper information is stored in the cdr
  record.
  
  (closes issue #13691)
  Reported by: dferrer
  Tested by: mnicholson
  
  (closes issue #13637)
  Reported by: atis
  Tested by: atis
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 22:32:13 +00:00
Kevin P. Fleming 1c988d8996 add 'const' qualifiers in various places where they should have been
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 13:59:35 +00:00
Mark Michelson 7a2a6a073f Reset the members' call counts when resetting queue statistics.
This helps to prevent odd scenarios where a queue will claim to have
taken 0 calls, but the members appear to have taken a non-zero amount.

(closes issue #15068)
Reported by: sum
Patches:
      patchreset.patch uploaded by sum (license 766)
Tested by: sum



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-08 19:50:44 +00:00
Richard Mudgett 7019ff68db Fixed crashes from issue8824 review board channel locking changes.
The local struct ast_party_connected_line connected_caller variable
was uninitialized when the copy function was called.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 20:54:07 +00:00
Russell Bryant 1e016da893 Fix app_queue XML documentation.
I think it would behoove us to force "make validate-docs" to be run after the
XML documentation has been generated if dev-mode is enabled.

(closes issue #14989)
Reported by: tzafrir
Patches:
      app_queue_xml.diff uploaded by tzafrir (license 46)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 08:56:13 +00:00
Mark Michelson 1d941ad821 Allow for a position to be specified when entering a queue.
This would allow for one to add a caller to a specific place in the
queue instead of just placing the caller in the back every time. To help
facilitate some interesting manipulations, a new channel variable called
QUEUEPOSITION has been added. When a caller is removed from a queue, his
position in that queue is stored in the QUEUEPOSITION variable. One such
strategy an administrator can employ is to allow for the removal of a caller
from one queue followed by the insertion of the same caller into a separate
queue in the same position.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-27 16:37:51 +00:00
Mark Michelson 09cde5a40c Update warning message to not have pipes and contain all options.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-27 16:26:14 +00:00
Mark Michelson 8f81deab25 Fix reversed behavior of leavewhenempty option in queues.conf.
(closes issue #14650)
Reported by: alecdavis
Patches:
      14650.patch uploaded by mmichelson (license 60)
Tested by: mmichelson, lmadsen



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23 17:45:35 +00:00
Mark Michelson f26878feb2 Fix a couple of queue member reference leaks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-14 23:28:13 +00:00
Mark Michelson b6a2f40793 Set all queue variables on both the caller and member channels.
This allows for the variables to be accessed if a member macro is run.
Thanks to Grigoriy Puzankin for bringing this up on the -dev list.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-13 14:17:56 +00:00
Mark Michelson 6f53ed4c67 This commit introduces COLP/CONP and Redirecting party information into Asterisk.
The channel drivers which have been most heavily tested with these enhancements are
chan_sip and chan_misdn. Further work is being done to add Q.SIG support and will be
introduced in a later commit. chan_skinny has code added to it here, but according
to user pj, the support on chan_skinny is not working as of now. This will be fixed in
a later commit.

A special thanks goes out to bugtracker user gareth for getting the ball rolling and
providing the initial support for this work. Without his initial work on this, this would
not have been nearly as painless as it was.

This functionality has been tested by Digium's product quality department, as well as a
customer site running thousands of calls every day. In addition, many many many many bugtracker
users have tested this, too.

(closes issue #8824)
Reported by: gareth

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 22:41:46 +00:00
Mark Michelson f43159ba31 Fix trunk's compilation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 22:12:52 +00:00
Mark Michelson 5c0d934e6b Merged revisions 185599 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185599 | mmichelson | 2009-03-31 17:00:01 -0500 (Tue, 31 Mar 2009) | 6 lines
  
  Fix crash that would occur if an empty member was specified in queues.conf.
  
  (closes issue #14796)
  Reported by: pida
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 22:02:48 +00:00
Russell Bryant c9c8758d6d Don't free() an astobj2 object.
(closes issue #14672)
Reported by: makoto


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 14:53:45 +00:00
Mark Michelson c4e3bfb74c Merged revisions 185031 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185031 | mmichelson | 2009-03-30 11:17:35 -0500 (Mon, 30 Mar 2009) | 39 lines
  
  Fix queue weight behavior so that calls in low-weight queues are not inappropriately blocked.
  
  (This is copied and pasted from the review request I made for this patch)
  
  Asterisk has some odd behavior when queue weights are used. The current logic used when
  potentially calling a queue member is:
  
  If the member we are going to call is part of another queue and _that other queue has any 
  callers in it_ and has a higher weight than the queue we are calling from, then don't try 
  to contact that member. The issue here is what I have marked with underscores. If the 
  higher-weighted queue has any callers in it at all, then the queue member will be unreachable 
  from the lower-weighted queue. This has the potential to be really really bad if using a 
  queue strategy, such as leastrecent or fewestcalls, with the potential to call the same 
  member repeatedly.
  
  The fix proposed by garychen on issue 13220 is very simple and, as far as I can see, works 
  well for this situation. With this set of changes, the logic used becomes:
  
  If the member we are going to call is part of another queue, the other queue has a higher 
  weight than the queue we are calling from, and the higher weight queue has at least as many 
  callers as available members, then do not try to contact the queue member. If the higher 
  weighted queue has fewer callers than available members, then there is no reason to deny 
  the call to this member since the other queue can afford to spare a member.
  
  Since the fix involved writing a generic function for determining the number of available 
  members in the queue, I also modified the is_our_turn function to make use of the new 
  num_available_members function to determine if it is our turn to try calling a member. There 
  is one small behavior change. Before writing this patch, if you had autofill disabled, then 
  if you were the head caller in a queue, you would automatically be told that it was your 
  turn to try calling a member. This did not take into account whether there were actually any 
  queue members available to take the call. Now we actually make sure there is at least one 
  member available to take the call if autofill is disabled.
  
  (closes issue #13220)
  Reported by: garychen
  
  Review: http://reviewboard.digium.com/r/202/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-30 16:26:48 +00:00
Russell Bryant 2a4f9f7181 Change global_app_buf to ast_str_thread_global_buf.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 16:21:10 +00:00
Mark Michelson b52d2dae2e Fix a memory leak associated with queues.
For every attempt that app_queue made to place an outbound call to a queue member,
we would allocate a queue_end_bridge structure. When the bridge for the call had
completed, we would free the structure. Unfortunately not all call attempts actually
end up bridged to a member, so we need to be more selective of when to allocate
the structure. With this change, the allocation occurs in an area where we can
guarantee that the call will be bridged.

(closes issue #14680)
Reported by: caspy
Patches:
      14680.patch uploaded by mmichelson (license 60)
Tested by: caspy



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 18:10:34 +00:00
Mark Michelson b4fcc4a098 Change faulty comparison used when announcing average hold minutes and seconds
(closes issue #14227)
Reported by: caspy



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-13 21:26:20 +00:00
Mark Michelson a1a9006163 Run the macro on the queue member's channel when he answers, not the caller's channel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 21:43:51 +00:00
Mark Michelson d7d817d687 Fix segfault when dialing a typo'd queue
If trying to dial a non-existent queue, there would
be a segfault when attempting to access q->weight, even
though q was NULL. This problem was introduced during
the queue-reset merge and thus only affects trunk.

(closes issue #14643)
Reported by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 14:28:40 +00:00
Mark Michelson 8970f8caaa Merged revisions 180006 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r180006 | mmichelson | 2009-03-03 16:48:18 -0600 (Tue, 03 Mar 2009) | 17 lines
  
  Clarify some documentation of queues.conf.sample
  
  It had always been possible to explicitly specify a "blank"
  value for a sound file in queues.conf and have no sound played
  back. The problem with this is that it would result in some ugly
  CLI warnings from file.c.
  
  This commit introduces a check when playing a file in app_queue
  to see if the name of the file is zero-length and return early if
  that is the case. Also, the ability to specify the blank sound
  files in queues.conf is now mentioned more clearly in queues.conf.sample
  
  (closes issue #14227)
  Reported by: caspy
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 22:49:07 +00:00
Russell Bryant 184872fdfd Fix a race condition that caused device states to become incorrect for hints.
The problem here is that the hint processing code was subscribed to the wrong
event type.  So, it started processing state for a hint too soon, before the
device state cache had been updated.

Also, fix a similar bug in app_queue, as it was also subscribed to the wrong
event type.

(closes issue #14461)
Reported by: alecdavis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 17:33:38 +00:00
Mark Michelson 3c9667ae12 Merge queue-reset branch to Asterisk
From a user point-of-view, this adds new CLI commands and Manager Actions to
better facilitate the reloading of queues and the resetting of their statistics.

The new CLI commands are the "queue reload" and "queue reset stats" commands.

The new manager actions are the QueueReload and QueueReset commands.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-13 20:57:37 +00:00
Mark Michelson 0d5da5f436 Fix a bit of odd logic for announcing position. Sync with 1.6.0's logic
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-11 23:12:57 +00:00
Mark Michelson 34161542e9 Fix odd "thank you" sound playing behavior in app_queue.c
If someone has configured the queue to play an position or holdtime
announcement, then it is odd and potentially unexpected to hear a 
"Thank you for your patience" sound when no position or holdtime
was actually announced.

This fixes the announcement so that the "thanks" sound is only played
in the case that a position or holdtime was actually announced.

There is a way that the "thank you" sound can be played without a
position or holdtime, and that is to set announce-frequency to a value
but keep announce-position and announce-holdtime both turned off.

(closes issue #14227)
Reported by: caspy
Patches:
      14227_v3.patch uploaded by putnopvut (license 60)
Tested by: caspy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174948 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-11 23:03:08 +00:00
Mark Michelson 2e1d9f9a21 Merged revisions 173692 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r173692 | mmichelson | 2009-02-05 14:29:09 -0600 (Thu, 05 Feb 2009) | 12 lines

Fix situations where queue members could be autopaused unexpectedly

Specifically, this patch prevents us from autopausing members when
we receive a busy or congestion frame from them.

(closes issue #14376)
Reported by: fiddur
Patches:
      14376.patch uploaded by putnopvut (license 60)
Tested by: fiddur


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05 20:30:45 +00:00
Mark Michelson 172777bd02 Fix some areas where the incorrect interface was passed to ast_device_state
I swear it feels like I already did this once...

(closes issue #14359)
Reported by: francesco_r


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-04 22:16:19 +00:00
Olle Johansson 7ecda45482 Fix "cancel answered elsewhere" through app_queue with members in chan_local.
Also, implement a private cause code (as suggested by Tilghman). This works with
chan_sip, but doesn't propagate through chan_local.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-29 17:08:22 +00:00
Olle Johansson 097822966b Add final part of previously committed work for answered elsewhere in queue - the missing piece that started with app_dial() earlier on.
This is to avoid having the list and counter of missed calls being touched by queue calls. Add the C option to queue() and nothing 
will be logged on phones that support the Reason: header on SIP cancel, like the SNOM phones.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@171924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-28 14:37:16 +00:00
Mark Michelson 04e56bde03 Fix queue crashes that would occur after the calling channel was masqueraded.
The data passed to the end_bridge_callback was assumed to be data which was
still stack'd. The problem was that with some call features, attended transfers
in particular, a new bridge thread is started once the feature completes, meaning
that when the end_bridge_callback is called, the end_bridge_callback_data was
invalid.

To fix this problem, there are two measures taken

1. Instead of pointing to stacked data, we now used heap-allocated data for
passing to the end_bridge_callback in app_queue
2. Since bridges can end multiple times on a single logical call, we wait until
the final bridge is broken to actually set any queue variables. This is accomplished
through reference-counting and the use of an end_bridge_callback_data_fixup function
in app_queue.c

(closes issue #14260)
Reported by: ccesario
Patches:
      14260.patch uploaded by putnopvut (license 60)
Tested by: ccesario



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@171618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-27 19:30:54 +00:00
Mark Michelson 4263503bd5 Fix device state parsing issues for channel names with multiple slashes
The fix being applied is a bit different for trunk and the 1.6.X branches.
For trunk, we only wish to strip off the characters beyond the second slash
if the channel is a Local channel (i.e. we are removing the /n from the device
name). Other channel technologies with multiple slashes (e.g. DAHDI) need the
information after the second slash in order to get the proper device state
information.

In addition to this fix, the 1.6.X branches are receiving a much more important
fix as well. The problem in 1.6.X is that the member's device name was being directly
changed instead of having a copy changed. This meant that we would strip off the
second slash and trailing characters and then leave the member's device name like
that permanently thereafter.

(closes issue #14014)
Reported by: kebl0155
Patches:
      14014_number2.patch uploaded by putnopvut (license 60)
Tested by: kebl0155



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-21 00:33:32 +00:00
Mark Michelson b52253d590 Use the default timeout for a queue instead of -1
(closes issue #14272)
Reported by: timking



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-20 21:57:24 +00:00
Olle Johansson 526cc089a9 Add support for setting the Reason header when cancelling a call in the queue
because someone else answered. Previously, only dial() was supported.

EDV-102


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15 13:01:52 +00:00
Mark Michelson b9060d4435 Merged revisions 168628 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r168628 | mmichelson | 2009-01-14 18:11:01 -0600 (Wed, 14 Jan 2009) | 16 lines

Fix some crashes from bad datastore handling in app_queue.c

* The queue_transfer_fixup function was searching for and removing
  the datastore from the incorrect channel, so this was fixed.

* Most datastore operations regarding the queue_transfer datastore
  were being done without the channel locked, so proper channel locking
  was added, too.

(closes issue #14086)
Reported by: ZX81
Patches:
      14086v2.patch uploaded by putnopvut (license 60)
Tested by: ZX81, festr


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15 00:14:17 +00:00
Mark Michelson ec0f18405e Clarify a message that app_queue prints and change to a debug-level message
The "No one is answering..." verbose message contained 3 numbers that were not
explained in any way to whoever was viewing the message. It is more helpful now
since the message explains what the numbers mean. Also, the message has been
downgraded to "DEBUG" level.

(closes issue #14172)
Reported by: caio1982
Patches:
      queue_answering_debug.diff uploaded by caio1982 (license 22)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-13 22:30:59 +00:00
Mark Michelson 454241dd58 Add the average talk time for a queue
This patch adds the functionality to app_queue of calculating
the average amount of time that channels are bridged for a
queue. The algorithm used to calculate the average is the same
exponential average currently used to calculate the average holdtime.
See the CHANGES file to see the methods you may use to view this
information.

(closes issue #13960)
Reported by: coolmig
Patches:
      app_queue.c.diff.trunk-r158840 uploaded by coolmig (license 621)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@167792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-08 19:48:42 +00:00
Mark Michelson ff20b9116a Update app_queue to deal with the removal of AST_PBX_KEEPALIVE
When placing a call to a queue which ran a gosub on the member's
channel, Asterisk would crash every time, stemming from the fact
that the member's channel was being hung up unexpectedly when the
Gosub completed. The necessary change was pretty much copied and
pasted from app_dial's similar changes made last week.

I also took the opportunity to change a LOG_DEBUG message in
app_dial to use ast_debug. I am guessing this was due to a direct
merge from 1.4 that was not corrected to use trunk's preferred
syntax.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-29 18:04:52 +00:00
Steve Murphy aa905e347e Merged revisions 166093 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

In order to merge this 1.4 patch into trunk,
I had to resolve some conflicts and wait for
Russell to make some changes to res_agi.
I re-ran all the tests; 39 calls in all, and
made fairly careful notes and comparisons: I
don't want this to blow up some aspect of 
asterisk; I completely removed the KEEPALIVE
from the pbx.h decls. The first 3 scenarios
involving feature park; feature xfer to 700;
hookflash park to Park() app call all behave
the same, don't appear to leave hung channels,
and no crashes.

........
  r166093 | murf | 2008-12-19 15:30:32 -0700 (Fri, 19 Dec 2008) | 131 lines
  
  This merges the masqpark branch into 1.4
  
  These changes eliminate the need for (and use of)
  the KEEPALIVE return code in res_features.c;
  There are other places that use this result code
  for similar purposes at a higher level, these appear
  to be left alone in 1.4, but attacked in trunk.
  
  The reason these changes are being made in 1.4, is
  that parking ends a channel's life, in some situations,
  and the code in the bridge (and some other places),
  was not checking the result code properly, and dereferencing
  the channel pointer, which could lead to memory corruption
  and crashes.
  
  Calling the masq_park function eliminates this danger 
  in higher levels.
  
  A series of previous commits have replaced some parking calls
  with masq_park, but this patch puts them ALL to rest,
  (except one, purposely left alone because a masquerade
  is done anyway), and gets rid of the code that tests
  the KEEPALIVE result, and the NOHANGUP_PEER result codes.
  
  While bug 13820 inspired this work, this patch does
  not solve all the problems mentioned there.
  
  I have tested this patch (again) to make sure I have
  not introduced regressions. 
  
  Crashes that occurred when a parked party hung up
  while the parking party was listening to the numbers
  of the parking stall being assigned, is eliminated.
  
  These are the cases where parking code may be activated:
  
  1. Feature one touch (eg. *3)
  2. Feature blind xfer to parking lot (eg ##700)
  3. Run Park() app from dialplan (eg sip xfer to 700)
     (eg. dahdi hookflash xfer to 700)
  4. Run Park via manager.
  
  The interesting testing cases for parking are:
  I. A calls B, A parks B
      a. B hangs up while A is getting the numbers announced.
      b. B hangs up after A gets the announcement, but 
         before the parking time expires
      c. B waits, time expires, A is redialed,
         A answers, B and A are connected, after
         which, B hangs up.
      d. C picks up B while still in parking lot.
  
  II. A calls B, B parks A
      a. A hangs up while B is getting the numbers announced.
      b. A hangs up after B gets the announcement, but 
         before the parking time expires
      c. A waits, time expires, B is redialed,
         B answers, A and B are connected, after
         which, A hangs up.
      d. C picks up A while still in parking lot.
  
  Testing this throroughly involves acting all the permutations
  of I and II, in situations 1,2,3, and 4.
  
  Since I added a few more changes (ALL references to KEEPALIVE in the bridge
  code eliimated (I missed one earlier), I retested
  most of the above cases, and no crashes.
  
  H-extension weirdness.
  
  Current h-extension execution is not completely
  correct for several of the cases.
  
  For the case where A calls B, and A parks B, the
  'h' exten is run on A's channel as soon as the park
  is accomplished. This is expected behavior.
  
  But when A calls B, and B parks A, this will be
  current behavior:
  
  After B parks A, B is hung up by the system, and
  the 'h' (hangup) exten gets run, but the channel
  mentioned will be a derivative of A's...
  
  Thus, if A is DAHDI/1, and B is DAHDI/2,
  the h-extension will be run on channel
  Parked/DAHDI/1-1<ZOMBIE>, and the 
  start/answer/end info will be those 
  relating to Channel A.
  
  And, in the case where A is reconnected to
  B after the park time expires, when both parties
  hang up after the joyful reunion, no h-exten
  will be run at all.
  
  In the case where C picks up A from the 
  parking lot, when either A or C hang up,
  the h-exten will be run for the C channel.
  
  CDR's are a separate issue, and not addressed
  here.
  
  As to WHY this strange behavior occurs, 
  the answer lies in the procedure followed
  to accomplish handing over the channel
  to the parking manager thread. This procedure
  is called masquerading. In the process,
  a duplicate copy of the channel is created,
  and most of the active data is given to the
  new copy. The original channel gets its name
  changed to XXX<ZOMBIE> and keeps the PBX
  information for the sake of the original
  thread (preserving its role as a call 
  originator, if it had this role to begin
  with), while the new channel is without
  this info and becomes a call target (a
  "peer").
  
  In this case, the parking lot manager
  thread is handed the new (masqueraded)
  channel. It will not run an h-exten
  on the channel if it hangs up while
  in the parking lot. The h exten will
  be run on the original channel instead,
  in the original thread, after the bridge
  completes.
  
  See bug 13820 for our intentions as
  to how to clean up the h exten behavior.

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

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-23 18:13:49 +00:00
Joshua Colp 654ea55a65 Numerous documentation updates.
(closes issue #13970)
Reported by: pkempgen
Patches:
      __20081217_cli_usage_fixes.patch.txt uploaded by blitzrage (license 10)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 21:21:44 +00:00
Mark Michelson a7829044ec Merged revisions 165255 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r165255 | mmichelson | 2008-12-17 14:51:38 -0600 (Wed, 17 Dec 2008) | 7 lines

Fix some memory leaks found while looking at how realtime
configs are handled.

Also cleaned up some coding guidelines violations in app_realtime.c,
mostly related to spacing


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-17 21:17:20 +00:00
Mark Michelson 00c40264b7 Fix a compile warning and a logic error that could have been bad
for non-realtime queues



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 16:16:47 +00:00
Mark Michelson 8a2cf30830 Fix up a few issues with regards to queues
* Fix reference counting used in the __queues_show function
* Add code to be sure that the "queue show" command does not
  print information for a realtime queue which has been deleted
  from the backend
* Add a missing unref to the realtime queue loading function for
  the case where a queue is in the module's container but has been
  deleted from the realtime backend

(closes issue #14033)
Reported by: cristiandimache
Patches:
      14033.patch uploaded by putnopvut (license 60)
Tested by: cristiandimache



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 16:10:43 +00:00
Tilghman Lesher c8223fc957 Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 08:36:35 +00:00
Terry Wilson 74de8fdaa7 When using realtime queues, app_queue wasn't updating the strategy if it was changed in the realtime backend. This patch resolves the issue for almost all situations. It is currently not supported to switch to the linear strategy via realtime since the ao2_container for members will have been set to have multiple buckets and therefore the members would be unordered.
(closes issue #14034)
Reported by: cristiandimache
Tested by: otherwiseguy, cristiandimache


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-12 23:48:26 +00:00
Mark Michelson 1772fc56f0 Merged revisions 163084 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r163084 | mmichelson | 2008-12-11 10:46:22 -0600 (Thu, 11 Dec 2008) | 4 lines

Revert this cast to long. Using time_t here causes build failures on a 
FreeBSD 32-bit build.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 16:47:34 +00:00
Mark Michelson cda010c3b7 Merged revisions 163080 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r163080 | mmichelson | 2008-12-11 10:24:43 -0600 (Thu, 11 Dec 2008) | 14 lines

Fix a potential crash due to unsafe datastore handling.

This patch also contains a conversion from using long to time_t
for representing times for a queue, as well as some whitespace
fixes.

(closes issue #14060)
Reported by: nivek
Patches:
      datastore_fixup.patch.corrected uploaded by nivek (license 636)
	  with slight modification from me
Tested by: nivek


........


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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 10:31:25 +00:00
Mark Michelson a53877b469 Add some safety measures when using gosub, especially when using the options
for app_dial and app_queue to run a gosub when the call is answered.

* Check for the existence of the gosub target in gosub_exec. If it is nonexistent,
  then this will cause errors when we attempt to actually run the gosub, including
  a definite memory leak and potential crashes. Return an error in this situation
* Check the return value of pbx_exec in app_dial and app_queue before attempting
  to actually run the gosub routine. If there was an error, we should not attempt
  to run the gosub.
* Change a '|' to a ',' in app_queue.
* Add some extra curly braces where they had been missing previously.

(closes issue #13548)
Reported by: fiddur



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 18:37:46 +00:00
Mark Michelson ac1b520de6 When investigating issue #13548, I found that gosub
handling in app_queue was just completely wrong, mostly
because the channel operations being performed were being
done on the incorrect channel.

With this set of changes, a gosub will correctly run on
the answering queue member's channel. There are still crash
issues which occur if there are dialplan syntax errors, so
I cannot yet close the referenced issue.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 17:07:09 +00:00
Sean Bright fd8caa1778 This is basically a complete rollback of r155401, as it was determined that
it would be best to maintain API compatibility.  Instead, this commit introduces
ao2_callback_data() which is functionally identical to ao2_callback() except
that it allows you to pass arbitrary data to the callback.

Reviewed by Mark Michelson via ReviewBoard:
	http://reviewboard.digium.com/r/64


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 01:01:49 +00:00
Matthew Nicholson 17ed84ff07 Make the Join event from app_queue use CallerIDNum insead of CallerID for
indicating the callerid number just like the rest of asterisk.

(closes issue #13883)
Reported by: davidw


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 00:05:41 +00:00
Mark Michelson 9e1283e160 Add a space to the output
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19 23:30:42 +00:00
Mark Michelson de5ba432da Add a RES_NOT_DYNAMIC case for the CLI command
'queue remove member'



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19 23:29:14 +00:00
Mark Michelson cf6c66de65 Fix some refcounting in app_queue.c and change the
hashing used by app_queue.c to be case-insensitive.
This is accomplished by adding a new case-insensitive
hashing function.

This was necessary to prevent bad refcount errors
(and potential crashes) which would occur due to the
fact that queues were initially read from the config
file in a case-sensitive manner. Then, when a user
issued a CLI command or manager action, we allowed
for case-insensitive input and used that input to 
directly try to find the queue in the hash table. The result
was either that we could not find a queue that was input or
worse, we would end up hashing to a completely bogus value
based on the input.

This commit resolves the problem presented in
issue #13703. However, that issue was reported against
1.6.0. Since this fix introduces a behavior change, I am
electing to not place this same fix in to the 1.6.0 or 1.6.1
branches, and instead will opt for a change which does not
change behavior.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14 16:53:38 +00:00
Sean Bright 9ef09ad1d4 Merged revisions 155553 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r155553 | seanbright | 2008-11-08 20:08:07 -0500 (Sat, 08 Nov 2008) | 6 lines

Use static functions here instead of nested ones.  This requires a small
change to the ast_bridge_config struct as well.  To understand the reason
for this change, see the following post:

    http://gcc.gnu.org/ml/gcc-help/2008-11/msg00049.html

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-09 01:27:00 +00:00
Sean Bright 30d1744ffc Add ability to pass arbitrary data to the ao2_callback_fn (called from
ao2_callback and ao2_find).  Currently, passing OBJ_POINTER to either
of these mandates that the passed 'arg' is a hashable object, making
searching for an ao2 object based on outside criteria difficult.

Reviewed by Russell and Mark M. via ReviewBoard:
    http://reviewboard.digium.com/r/36/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07 22:39:30 +00:00
Eliel C. Sardanons d23dff9ca8 - Add some see-also references based on TFOT.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05 12:13:57 +00:00
Tilghman Lesher 2cc8e25222 Slightly optimize ast_devstate_str and rename global functions devstate2str and config_text_file_save to have an ast_ prefix
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04 18:47:20 +00:00
Kevin P. Fleming bd4eb070f3 bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 branch, and add the ones needed for all the new code here too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 18:52:13 +00:00
Russell Bryant 5b168ee34b Merge changes from team/group/appdocsxml
This commit introduces the first phase of an effort to manage documentation of the
interfaces in Asterisk in an XML format.  Currently, a new format is available for
applications and dialplan functions.  A good number of conversions to the new format
are also included.

For more information, see the following message to asterisk-dev:

http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01 21:10:07 +00:00
Terry Wilson 5fe37e47c6 Recent CDR fixes moved execution of the 'h' exten into the bridging code, so variables that were set after ast_bridge_call was called would not show up in the 'h' exten. Added a callback function to handle setting variables, etc. from w/in the bridging code. Calls back into a nested function within the function calling ast_bridge_call
(closes issue #13793)
Reported by: greenfieldtech


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31 18:55:33 +00:00
Steve Murphy d736ac2b19 Merged revisions 152538 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r152538 | murf | 2008-10-28 23:19:04 -0600 (Tue, 28 Oct 2008) | 14 lines

A little documentation cross-ref between features and
dial and queue... I wasted some time (stupidly) trying
to get the one-touch parking stuff working, because it
didn't occur to me that I had to also have the corresponding
options in the dial command! Duh! (In all this time, I never
set this up before!)
So, to keep some poor fool from suffering the same fate,
I made the features.conf.sample file mention the corresponding
opts in dial/queue; and the docs for dial/app specifically
mention the corresponding decls in the feature.conf file.

I hope this doesn't spoil some vast, eternal plan...


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:47:13 +00:00
Steve Murphy 6fad66dfb3 Merged revisions 152535 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r152535 | murf | 2008-10-28 22:36:32 -0600 (Tue, 28 Oct 2008) | 46 lines

The magic trick to avoid this crash is not to
try to find the channel by name in the list,
which is slow and resource consuming, but rather
to pay attention to the result codes from the
ast_bridge_call, to which I added the 
AST_PBX_NO_HANGUP_PEER_PARKED value, which
now are returned when a channel is parked.
Why? because CDR's aren't generated via parking,
so nothing is needed, but if a transfer occurred,
there are critical things I need.

If you get AST_PBX_KEEPALIVE,
then don't touch the channel pointer.

If you get AST_PBX_NO_HANGUP_PEER, or
AST_PBX_NO_HANGUP_PEER_PARKED, then don't
touch the peer pointer.

Updated the several places where the results
from a bridge were not being properly obeyed,
and fixed some code I had introduced so that
the results of the bridge were not overridden 
(in trunk).

All the places that previously tested for 
AST_PBX_NO_HANGUP_PEER now have to check for
both AST_PBX_NO_HANGUP_PEER and AST_PBX_NO_HANGUP_PEER_PARKED.

I tested this against the 4 common parking
scenarios:


1. A calls B; B answers; A parks B; B hangs up while A is getting the parking
slot announcement, immediately after being put on hold.

2. A calls B; B answers; A parks B; B hangs up after A has been hung up, but
before the park times out.

3. A calls B; B answers; B parks A; A hangs up while B is getting the parking slot announcement, immediately after being put on hold.

4. A calls B; B answers; B parks A; A hangs up after B has been hung up, but before the park times out.


No crash.

I also ran the scenarios above against valgrind, and accesses looked good.



........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:01:00 +00:00
BJ Weschke 7a8344bac6 The QueueEntry event now has the uniqueid of the channel included.
(closes issue #13731)
 reported and patched by: caio1982



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@150773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-18 00:25:18 +00:00
Mark Michelson 184fe6f87b Merged revisions 149200 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r149200 | mmichelson | 2008-10-14 17:40:42 -0500 (Tue, 14 Oct 2008) | 12 lines

Update the queue with the correct number of calls and
whether the call was completed within the service level
when a transfer takes place. This way, we do not "break"
the leastrecent and fewestcalls strategies by not logging
a call until after the transferred call has ended.

(closes issue #13395)
Reported by: Marquis
Patches:
      app_queue.c.transfer.patch uploaded by Marquis (license 32)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 22:41:13 +00:00
Mark Michelson b8aed684f5 This commit introduces a change to how the "joinempty"
and "leavewhenempty" options are configured in queues.conf.

Instead of using vague terms like "yes," "no," "loose," and
"strict," we now accept a comma-separated list of values
to determine when to consider a member available.

Extended details can be found in the queues.conf.sample
file. Note also that the above four referenced values are
still accepted for backwards-compatibility, but are mapped
internally to the new method of representing the option.

AST-105



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06 15:29:56 +00:00
Michiel van Baak 90751b16ca Merge the cli_cleanup branch.
This work is done by lmadsen, junky and mvanbaak
during AstriDevCon.

This is the second audit the CLI got, and
this time lmadsen made sure he had _ALL_ modules
loaded that have CLI commands in them.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-28 23:32:14 +00:00
Michiel van Baak f1b673eef0 fix a couple of CLI commands that did not have a help description.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@144879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-27 00:49:24 +00:00
Tilghman Lesher 08af5bb312 Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiating
when a file is invalid from when a file is missing.  This is most important when
we have two configuration files.  Consider the following example:

Old system:
sip.conf     users.conf     Old result               New result
========     ==========     ==========               ==========
Missing      Missing        SIP doesn't load         SIP doesn't load
Missing      OK             SIP doesn't load         SIP doesn't load
Missing      Invalid        SIP doesn't load         SIP doesn't load
OK           Missing        SIP loads                SIP loads
OK           OK             SIP loads                SIP loads
OK           Invalid        SIP loads incompletely   SIP doesn't load
Invalid      Missing        SIP doesn't load         SIP doesn't load
Invalid      OK             SIP doesn't load         SIP doesn't load
Invalid      Invalid        SIP doesn't load         SIP doesn't load

So in the case when users.conf doesn't load because there's a typo that
disrupts the syntax, we may only partially load users, instead of failing with
an error, which may cause some calls not to get processed.  Worse yet, the old
system would do this with no indication that anything was even wrong.

(closes issue #10690)
 Reported by: dtyoo
 Patches: 
       20080716__bug10690.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 23:30:03 +00:00
Steve Murphy 67f7ac0499 Merged revisions 142675 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r142675 | murf | 2008-09-11 22:29:34 -0600 (Thu, 11 Sep 2008) | 29 lines

Tested by: sergee, murf, chris-mac, andrew, KNK

This is a "second attempt" to restore the previous "endbeforeh" behavior
in 1.4 and up. In order to capture information concerning all the
legs of transfers in all their infinite combinations, I was forced
to this particular solution by a chain of logical necessities, the
first being that I was not allowed to rewrite the CDR mechanism from 
the ground up!

This change basically leaves the original machinery alone, which allows
IVR and local channel type situations to generate CDR's as normal, but
a channel flag can be set to suppress the normal running of the h exten.
That flag would be set by the code that runs the h exten from the
ast_bridge_call routine, to prevent the h exten from being run twice.
Also, a flag in the ast_bridge_config struct passed into ast_bridge_call
can be used to suppress the running of the h exten in that routine. This
would happen, for instance, if you use the 'g' option in the Dial app.

Running this routine 'early' allows not only the CDR() func to be used
in the h extension for reading CDR variables, but also allows them to
be modified before the CDR is posted to the backends.

While I dearly hope that this patch overcomes all problems, and 
introduces no new problems, reality suggests that surely someone
will have problems. In this case, please re-open 13251 (or 13289),
and we'll see if we can't fix any remaining issues.

** trunk note: some code to suppress the h exten being run 
from app_queue was added; for the 'continue' option available
only in trunk/1.6.x.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 04:50:48 +00:00
Mark Michelson 4ad993ed8f This is the trunk version of the patch to close
issue 12979. The difference between this and the
1.6.0 and 1.6.1 versions is that this is a much more
invasive change. With this, we completely get rid
of the interfaces list, along with all its helper
functions.

Let me take a moment to say that this change personally
excites me since it may mean huge steps forward regarding
proper lock order in app_queue without having to strew
seemingly unnecessary locks all over the place. It also
results in a huge reduction in lines of code and complexity.
Way to go Brett!

(closes issue #12979)
Reported by: sigxcpu
Patches:
      20080710_issue12979_queue_custom_state_interface_trunk_2.diff uploaded by bbryant (license 36)
Tested by: sigxcpu, putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-09 17:15:29 +00:00
Mark Michelson 16d2c41701 Use ast_debug for debug messages. I was wondering why debug
messages weren't showing up when I had set the debug level
high for just app_queue.c. It's because we were only checking
the global option_debug variable instead of using the awesome
macro which checks both the global and file-specific value



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@141998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-09 12:32:38 +00:00
Mark Michelson 4356d794e3 Optimization: The only reason we should check member
status is if the queue has a joinempty or a leavewhenempty
setting which could cause the caller to not join the queue
or exit the queue. Prior to this patch, we could potentially
traverse the entire queue's member list for no reason since
even if the members are currently not available in some way
we're going to let the caller join the queue anyway.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@141906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-08 23:00:06 +00:00
Mark Michelson 43285b9273 Fix some locking order issues in app_queue. This was
brought up by atis on IRC a while ago.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-03 20:16:12 +00:00
Mark Michelson 5dfefa5ee6 Merged revisions 140488 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r140488 | mmichelson | 2008-08-29 12:34:17 -0500 (Fri, 29 Aug 2008) | 22 lines

After working on the ao2_containers branch, I noticed
something a bit strange. In all cases where we provide
a callback function to ao2_container_alloc, the callback
function would only return 0 or CMP_MATCH. After inspecting
the ao2_callback() code carefully, I found that if you're
only looking for one specific item, then you should return
CMP_MATCH | CMP_STOP. Otherwise, astobj2 will continue
traversing the current bucket until the end searching for
more matches.

In cases like chan_iax2 where in 1.4, all the peers are
shoved into a single bucket, this makes for potentially
terrible performance since the entire bucket will be
traversed even if the peer is one of the first ones come
across in the bucket.

All the changes I have made were for cases where the 
callback function defined was passed to ao2_container_alloc
so that calls to ao2_find could find a unique instance
of whatever object was being stored in the container.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-29 17:47:17 +00:00
Mark Michelson e833fd2ab1 Add output of variables to AgentRingNoAnswer manager
event if eventwhencalled is set to "vars" in 
queues.conf. Yay for consistency.

(closes issue #13369)
Reported by: srt
Patches:
      13369_agentringnoanswer_variables.diff uploaded by srt (license 378)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 17:24:02 +00:00
Mark Michelson 612f8c85b4 Change the queue timeout priority logic into less ugly
and confusing code pieces. Clarify the logic within
queues.conf.sample.

(closes issue #12690)
Reported by: atis
Patches:
      queue_timeoutpriority.patch uploaded by atis (license 242)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@138694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-18 20:23:11 +00:00
Mark Michelson 16a0e23110 Merged revisions 138685 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r138685 | mmichelson | 2008-08-18 15:01:14 -0500 (Mon, 18 Aug 2008) | 10 lines

Change the inequalities used in app_queue with regards
to timeouts from being strict to non-strict for more
accuracy.

(closes issue #13239)
Reported by: atis
Patches:
      app_queue_timeouts_v2.patch uploaded by atis (license 242)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@138687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-18 20:04:10 +00:00
Sean Bright 790fde68d9 Another batch of files from RSW. The remaining apps and a few more
files from main/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-10 20:23:50 +00:00
Tilghman Lesher 285609937a Merged revisions 136488 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r136488 | tilghman | 2008-08-07 11:50:47 -0500 (Thu, 07 Aug 2008) | 7 lines

Update persistent state on all exit conditions.
(closes issue #12916)
 Reported by: sgenyuk
 Patches: 
       app_queue.patch.txt uploaded by neutrino88 (license 297)
 Tested by: sgenyuk, aragon

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 16:55:57 +00:00
Kevin P. Fleming 7df8b8b848 make datastore creation and destruction a generic API since it is not really channel related, and add the ability to add/find/remove datastores to manager sessions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05 16:56:11 +00:00
Mark Michelson 95ab87a07d Merged revisions 134758 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r134758 | mmichelson | 2008-07-31 10:56:18 -0500 (Thu, 31 Jul 2008) | 16 lines

Add more timeout checks into app_queue, specifically
targeting areas where an unknown and potentially
long time has just elapsed. Also added a check
to try_calling() to return early if the timeout
has elapsed instead of potentially setting a negative
timeout for the call (thus making it have *no* timeout
at all).


(closes issue #13186)
Reported by: miquel_cabrespina
Patches:
      13186.diff uploaded by putnopvut (license 60)
Tested by: miquel_cabrespina


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 16:05:12 +00:00
Mark Michelson 2f16a9583f Merged revisions 134556 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r134556 | mmichelson | 2008-07-30 15:24:40 -0500 (Wed, 30 Jul 2008) | 7 lines

Fix the parsing of the "reason" parameter in the
Diversion: header.

(closes issue #13195)
Reported by: woodsfsg


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 21:05:37 +00:00
Tilghman Lesher 87256ecdbc Let "roundrobin" also reference rrmemory, for the 1.6 release (as described in
UPGRADE-1.4.txt)
(Closes issue #13181)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 19:17:38 +00:00
Mark Michelson 4caeba12a6 Add a missing unlock.
Pointed out by Atis Lezdins in #asterisk-dev



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@133570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-25 13:52:52 +00:00
Mark Michelson b4dac0b385 Merged revisions 131369 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r131369 | mmichelson | 2008-07-16 15:23:02 -0500 (Wed, 16 Jul 2008) | 14 lines

Move the init_queue call back to where it used to be (changed
Sept 12 last year). It was moved then to prevent a memory leak.
Since then, the same memory leak recurred and was fixed in a 
better way.

Now it has been found that the placement of this init_queue
call can cause problems if a realtime queue has values changed
to an empty string. The problem is that the default value
for that queue parameter would not be set.

(closes issue #13084)
Reported by: elbriga


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 20:24:12 +00:00
Mark Michelson b35c06d838 Merged revisions 131357 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r131357 | mmichelson | 2008-07-16 14:37:08 -0500 (Wed, 16 Jul 2008) | 6 lines

Apparently, "thread safety" is important, whatever
that means. :P

(Thanks Russell!)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 19:37:42 +00:00
Mark Michelson b95bc53c23 Merged revisions 131299 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r131299 | mmichelson | 2008-07-16 13:57:34 -0500 (Wed, 16 Jul 2008) | 13 lines

Make absolutely certain that the transfer datastore
is removed from the calling channel once the caller
is finished in the queue. This could have weird con-
sequences when dialing local queue members when multiple
transfers occur on a single call.

Also fixed a memory leak that would occur when an
attended transfer occurred from a queue member.

(closes issue #13047)
Reported by: festr


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 18:59:27 +00:00
Brett Bryant fe874bfe6b Fix memory leak in app_queue when a device state is changed but it isn't
a member of any queue.

(closes issue #13073)
Reported by: eliel
Patches:
      app_queue.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-15 18:14:02 +00:00
Brett Bryant 7588bcf690 Fixes a bug where the interface for a queue member gets reloaded as the state_interface, if a state_interface was set, on reload because the
state_interface isn't stored in the ast_db.

(closes issue #13043)
Reported by: jvandal
Patches:
      app_queue.patch uploaded by jvandal (license 413)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-10 19:13:12 +00:00
Mark Michelson e4c93fc8c3 Added a new option, "timeoutpriority" to queues.conf. A detailed
explanation of the change may be found in configs/queues.conf.sample

(closes issue #12690)
Reported by: atis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 14:34:25 +00:00
Kevin P. Fleming da14954bdc another minor ast_channel memory size decrease... for nearly all channels, 'dialcontext' is only going to be set once during the channel's lifetime, so make it a string field instead of a char array
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 16:16:36 +00:00
Mark Michelson 6d1ebfbed5 Remove debug message
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-27 16:18:07 +00:00
Mark Michelson ab7809ace9 Ensure the thread-safety of the monexec variable in app_queue.
Thanks to Russell for pointing out the problem



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-27 16:16:13 +00:00
Mark Michelson 09c659d7d0 Make this compile with dev-mode on
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125666 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-27 00:22:03 +00:00
Mark Michelson 9aef593e58 The monitor-join option for queues was deprecated in favor of using
MixMonitor to mix audio. However, it was pointed out to me that because
of this, the command set for the MONITOR_EXEC variable is ignored as well.
This means that people can't do their own custom mixing commands at the end
of recordings in order to make, for instance, stereo recordings of calls.

With this patch, app_queue will set the "joinfiles" variable for the channel's
monitor if MONITOR_EXEC is not zero-length. This means that for normal audio
mixing, MixMonitor is still the preferred choice, but we allow custom
mixing to be done with the two Monitor streams if desired.

(closes issue #12923)
Reported by: snyfer



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-27 00:15:54 +00:00
Mark Michelson edbe6b7a25 Fix a really stupid mistake
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 23:06:18 +00:00
Mark Michelson 3859074667 Merged revisions 125585 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r125585 | mmichelson | 2008-06-26 17:52:39 -0500 (Thu, 26 Jun 2008) | 11 lines

Add the interface of a queue member to the output of the "queue show" command
so that it can easily be associated with a queue member's name. This helps
so that the appropriate queue member can be removed or paused since the 
interface is required, not the member's name.

(closes issue #12783)
Reported by: davevg
Patches:
      app_queue.diff uploaded by davevg (license 209) with small mod from me


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 23:01:02 +00:00
Mark Michelson 96f92f468f Merged revisions 125476 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r125476 | mmichelson | 2008-06-26 15:56:01 -0500 (Thu, 26 Jun 2008) | 11 lines

Prior to this patch, the "queue show" command used cached
information for realtime queues instead of giving up-to-date
info. Now realtime is queried for the latest and greatest in
queue info.

(closes issue #12858)
Reported by: bcnit
Patches:
      queue_show.patch uploaded by putnopvut (license 60)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 20:57:41 +00:00
Michiel van Baak 8e8359465b Older versions of GNU gcc do not allow 'NULL' as sentinel.
They want (char *)NULL as sentinel.
An example is OpenBSD (confirmed on 4.3) that ships with gcc 3.3.4

This commit introduces a contstant SENTINEL which is declared as:
#define SENTINEL ((char *)NULL)

All places I could test compile on my openbsd system are converted.
Update CODING-GUIDELINES to tell about this constant.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 20:48:33 +00:00
Sean Bright 62cb684f59 Include original position in TRANSFER entries written to queue_log.
(closes issue #12888)
Reported by: slavon
Patches:
      app_queue_transfer_patch_trunk.diff uploaded by slavon (license 288)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 14:24:43 +00:00
Mark Michelson eaa14309dd A portion of the code which handled the 'c' queue option had been
removed. No telling when it happened. Anyway, it's back in now
and works properly.

(Based on issue reported on mailing list)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-18 15:08:56 +00:00
Mark Michelson 103a94c6c4 Silly pointers. This fixes a memory corruption I introduced
with the attended transfer logging.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-18 14:54:47 +00:00
Mark Michelson 0283469cfc Merged revisions 123274 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r123274 | mmichelson | 2008-06-17 10:56:55 -0500 (Tue, 17 Jun 2008) | 12 lines

davidw pointed out that the holdtime calculation used by
app_queue does not use "boxcar" filtering as the comments
say. The term "boxcar" means that the number of samples used
to calculate stays constant, with new samples replacing the
oldest ones. The queue holdtime calculation uses all holdtime
samples collected since the queue was loaded, so the comment
has been changed to be accurate.

(closes issue #12781)
Reported by: davidw


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 15:57:43 +00:00
Steve Murphy f4c85ebd22 (closes issue #12689)
Reported by: ys

Many thanks to ys for doing the research on this problem.
I didn't think it would be best to unlock the contexts
and then relock them after the remove_extension2() call,
so I added an extra arg to remove_extension2() and set it
appropriately in each call. There were not that many.

I considered forcing the code to lock the contexts before
the call to remove_extension2(), but that would require
a slightly greater degree of changes, especially since
the find_context_locked is local to pbx.c

I did a simple sanity test to make sure the code doesn't
mess things up in general.




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 20:43:46 +00:00
Mark Michelson eb1e6f0806 Fix a segfault by not trying to store a stack address for
long-term use. Instead use the heap. I can't believe this
never happened *once* in my developer branch when I was testing.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 23:58:01 +00:00
Mark Michelson 54c92d9a63 Recommitting revision 122228, which was accidentally reverted
as a result of commit 122234.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 21:23:02 +00:00
Mark Michelson 054f08a1c8 Merged revisions 122311 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r122311 | mmichelson | 2008-06-12 13:50:58 -0500 (Thu, 12 Jun 2008) | 9 lines

Properly play a holdtime message if the announce-holdtime option is
set to "once."

(closes issue #12842)
Reported by: ramonpeek
Patches:
      patch001.diff uploaded by ramonpeek (license 266)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 18:53:17 +00:00
Jeff Peeler ef3b214728 Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 17:27:55 +00:00
Mark Michelson cf3a2a431f Merging the work done in the queue-log-atxfer branch. The
net result of this work is that attended transfers made
by queue members will now show up in the queue_log as a 
TRANSFER message instead of COMPLETECALLER as it had been.

As far as the details go, I created a datastore which is
attached to the calling channel just prior to when the caller
is bridged with the queue member. If the calling channel
is masqueraded, then during the "fixup" portion, the TRANSFER
will be logged and the datastore will be removed.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 16:25:09 +00:00
Russell Bryant e9d72e0cb2 Merge another big set of changes from team/russell/events
This commit merges in the rest of the code needed to support distributed device
state.  There are two main parts to this commit.

Core changes:
 - The device state handling in the core has been updated to understand device
   state across a cluster of Asterisk servers.  Every time the state of a device
   changes, it looks at all of the device states on each node, and determines the
   aggregate device state.  That resulting device state is what is provided to
   modules in Asterisk that take actions based on the state of a device.

New module, res_ais:
 - A module has been written to facilitate the communication of events between
   nodes in a cluster of Asterisk servers.  This module uses the SAForum AIS
   (Service Availability Forum Application Interface Specification) CLM and EVT
   services (Cluster Management and Event) to handle this task.  This module
   currently supports sharing Voicemail MWI (Message Waiting Indication) and
   device state events between servers.  It has been tested with openais, though
   other implementations of the spec do exist.

For more information on testing distributed device state, see the following doc:
  - doc/distributed_devstate.txt


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-10 15:12:17 +00:00
Tilghman Lesher 53459f86b2 Expand RQ_INTEGER type out to multiple types, one for each precision
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-09 22:51:59 +00:00
Tilghman Lesher 9471b87d27 Merge the adaptive realtime branch, which will make adding new required fields
to realtime less painful in the future.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 19:07:27 +00:00
Mark Michelson 4b1fae3efb Merged revisions 120513 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r120513 | mmichelson | 2008-06-04 17:05:33 -0500 (Wed, 04 Jun 2008) | 6 lines

Make sure that the string we set will survive the unref of
the queue member.

Thanks to Russell, who pointed this out.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 22:07:37 +00:00
Mark Michelson 564528663d Merged revisions 120285 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r120285 | mmichelson | 2008-06-04 09:11:12 -0500 (Wed, 04 Jun 2008) | 7 lines

Tab completion when removing a member should give the member's interface,
not the name, since the interface is what is expected for the command.

(closes issue #12783)
Reported by: davevg


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 14:12:45 +00:00
Mark Michelson d81d206148 Adding two new queue log events. The ADDMEMBER event is logged when
a dynamic realtime queue member is added to the queue, and the 
REMOVEMEMBER event is logged when a dynamic realtime member is
removed. Since no calling channel is associated with these events
the string "REALTIME" is placed where the channel's unique id is
normally placed.

(closes issue #12774)
Reported by: atis
Patches:
      queue_log_rt_members.patch uploaded by atis (license 242)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 21:22:52 +00:00
Tilghman Lesher ae317add1b Merged revisions 119404 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r119404 | tilghman | 2008-05-30 16:17:45 -0500 (Fri, 30 May 2008) | 6 lines

When joinempty=strict, it only failed on join if there were busy members.  If
all members were logged out OR paused, then it (incorrectly) let callers join
the queue.
(closes issue #12451)
 Reported by: davidw

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30 21:23:14 +00:00
Mark Michelson dd7e1255ac Update to the janitor project for making sure to be thread-safe when
retrieving the value of a channel variable. This covers app_queue.

This commit also incorporates a logical change. Previously, if MixMonitor
is to be used to record the call, all the arguments were parsed first. Then
the MixMonitor app would be located. Now the order of these operations has
been swapped. Now the app is located first so that we only go through the
work of parsing the arguments if the app was found.

(closes issue #12742)
Reported by: snuffy
Patches:
      bug_12742.diff uploaded by snuffy (license 35)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-28 19:56:18 +00:00
Michiel van Baak f1e9371da8 - revert change to ast_queue_hangup and create ast_queue_hangup_with_cause
- make data member of the ast_frame struct a named union instead of a void

Recently the ast_queue_hangup function got a new parameter, the hangupcause
Feedback came in that this is no good and that instead a new function should be created.
This I did.

The hangupcause was stored in the seqno member of the ast_frame struct. This is not very
elegant, and since there's already a data member that one should be used.
Problem is, this member was a void *.
Now it's a named union so it can hold a pointer, an uint32 and there's a padding in case someone
wants to store another type in there in the future.

This commit is so massive, because all ast_frame.data uses have to be
altered to ast_frame.data.data

Thanks russellb and kpfleming for the feedback.

(closes issue #12674)
Reported by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 16:29:54 +00:00
Mark Michelson 2c7760e626 Committing a fix pointed out by Atis Lezdins on the asterisk-dev list. Thanks!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 16:05:18 +00:00
Mark Michelson b0e637791c Add a new manager event, AgentRingNoAnswer to
app_queue.

(closes issue #12591)
Reported by: CCHAsteria
Patches:
      app_queue_RNA_event.diff uploaded by CCHAsteria (license 477)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 20:27:45 +00:00
Mark Michelson 06a7b4ea43 Optimize the update_realtime_member_field function by not having
to query the database for the member and instead using a cached
uniqueid. 

Special thanks to atis for creating this and for keeping it up
to date with necessary changes

(closes issue #11896)
Reported by: atis
Patches:
      realtime_uniqueid_v6.patch uploaded by atis (license 242)
Tested by: atis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:31:05 +00:00
Jason Parker e785520eb9 Correctly document state interface for AddQueueMember. Discovered while looking at issue #12626.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-12 16:35:50 +00:00
Mark Michelson c854ba85a5 Merged revisions 115320 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r115320 | mmichelson | 2008-05-05 16:41:34 -0500 (Mon, 05 May 2008) | 13 lines

Don't consider a caller "handled" until the caller is bridged with
a queue member. There was too much of an opportunity for the member
to hang up (either during a delay, announcement, or overly long
agi) between the time that he answered the phone and the time when
he actually was bridged with the caller. The consequence of this
was that if the member hung up in that interval, then proper
abandonment details would not be noted in the queue log if the caller
were to hang up at any point after the member hangup.

(closes issue #12561)
Reported by: ablackthorn


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115321 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 21:43:21 +00:00
Dwayne M. Hubbard 8fdea12f33 app_queue uses a taskprocessor for device state changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-03 03:57:42 +00:00
Tilghman Lesher b5a127daac Modify TIMEOUT() to be accurate down to the millisecond.
(closes issue #10540)
 Reported by: spendergrass
 Patches: 
       20080417__bug10540.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-01 23:06:23 +00:00
Mark Michelson e37dafdd3a Adding new configuration options to app_queue. This adds two new values
to announce-position, "limit" and "more," as well as a new option, 
announce-position-limit. For more information on the use of these options,
see CHANGES or configs/queues.conf.sample.

(closes issue #10991)
Reported by: slavon
Patches:
      app_q.diff uploaded by slavon (license 288)
Tested by: slavon, putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 19:30:41 +00:00
Mark Michelson 6447280c2f Merged revisions 114848 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114848 | mmichelson | 2008-04-29 14:40:06 -0500 (Tue, 29 Apr 2008) | 14 lines

Use the MACRO_CONTEXT and MACRO_EXTEN channel variables instead of the channel's macrocontext
and macroexten fields. This is needed because if macros are daisy-chained, the incorrect 
context and extension are placed on the new channel. I also added locking to the channel prior
to accessing these variables as noted in trunk's janitor project file.


(closes issue #12549)
Reported by: darren1713
Patches:
      app_queue.c.macroextenpatch uploaded by darren1713 (license 116)
	       (with modifications from me)
Tested by: putnopvut


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-29 19:42:04 +00:00
Tilghman Lesher 463a5dbd0a Whitespace changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 20:20:10 +00:00
Michiel van Baak 08e674bce0 Pass the hangup cause all the way to the calling app/channel.
(closes issue #11328)
Reported by: rain
Patches:
      20071207__pass_cause_in_hangup_control_frame.diff.txt uploaded by Corydon76 (license 14)
brought up-to-date to trunk by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 22:16:48 +00:00
Mark Michelson 14fc93e721 Merged revisions 114628 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114628 | mmichelson | 2008-04-24 15:43:03 -0500 (Thu, 24 Apr 2008) | 8 lines

Output of channel variables when eventwhencalled=vars was set
was being truncated two characters. This patch corrects the
problem.

(closes issue #12493)
Reported by: davidw


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 20:43:52 +00:00
Jason Parker 6f549bc324 Allow setqueuevar=yes (et al) to work, after changes to pbx_builtin_setvar()
(closes issue #12490)
Reported by: bcnit
Patches:
      12490-queuevars-3.diff uploaded by qwell (license 4)
Tested by: qwell


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 18:14:09 +00:00
Jason Parker f6cfccbc07 Merged revisions 114133 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114133 | qwell | 2008-04-15 11:18:08 -0500 (Tue, 15 Apr 2008) | 8 lines

Allow autofill to work in the general section of queues.conf.
Additionally, don't try to (re)set options when they have empty values in realtime (all unset columns would have an empty value).

(closes issue #12445)
Reported by: atis
Patches:
      12445-autofill.diff uploaded by qwell (license 4)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-15 16:18:38 +00:00
Mark Michelson df7cb6b30b Merged revisions 114112 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114112 | mmichelson | 2008-04-14 11:24:22 -0500 (Mon, 14 Apr 2008) | 9 lines

If the datastore has been moved to another channel due to a masquerade, then
freeing the datastore here causes an eventual double free when the new channel
hangs up. We should only free the datastore if we were able to successfully remove
it from the channel we are referencing (i.e. the datastore was not moved).

(closes issue #12359)
Reported by: pguido


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-14 16:25:09 +00:00
Mark Michelson 9bd9421c83 Fix a crash that happened due to accessing free'd memory
(closes issue #12396)
Reported by: tcalosi
Patches:
      12396.patch uploaded by putnopvut (license 60)
	  Tested by: tcalosi


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@113980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09 22:32:32 +00:00