Commit Graph

629 Commits

Author SHA1 Message Date
Mark Michelson
683b4483fe Merged revisions 190622 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r190622 | mmichelson | 2009-04-27 11:26:14 -0500 (Mon, 27 Apr 2009) | 3 lines
  
  Update warning message to not have pipes and contain all options.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@190624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-27 16:27:49 +00:00
Mark Michelson
e79afd99ea Merged revisions 188470 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r188470 | mmichelson | 2009-04-14 18:28:13 -0500 (Tue, 14 Apr 2009) | 3 lines
  
  Fix a couple of queue member reference leaks.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@188473 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-14 23:29:04 +00:00
Mark Michelson
0511aea0cf Merged revisions 188032 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r188032 | mmichelson | 2009-04-13 09:17:56 -0500 (Mon, 13 Apr 2009) | 6 lines
  
  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/branches/1.6.1@188038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-13 14:20:30 +00:00
Mark Michelson
ec37bd0e63 Merged revisions 185600 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r185600 | mmichelson | 2009-03-31 17:02:48 -0500 (Tue, 31 Mar 2009) | 12 lines
  
  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/branches/1.6.1@185602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 22:05:06 +00:00
Russell Bryant
0cf7be26df Merged revisions 185261 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r185261 | russell | 2009-03-31 09:53:45 -0500 (Tue, 31 Mar 2009) | 5 lines

Don't free() an astobj2 object.

(closes issue #14672)
Reported by: makoto

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@185263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 14:57:45 +00:00
Mark Michelson
9f90c1e617 Merged revisions 185072 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r185072 | mmichelson | 2009-03-30 11:26:48 -0500 (Mon, 30 Mar 2009) | 45 lines
  
  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/branches/1.6.1@185088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-30 16:47:22 +00:00
Mark Michelson
ad6d049f73 Merged revisions 183244 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r183244 | mmichelson | 2009-03-19 13:10:34 -0500 (Thu, 19 Mar 2009) | 16 lines
  
  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/branches/1.6.1@183246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 18:11:41 +00:00
Mark Michelson
2e46983377 Merged revisions 182121 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r182121 | mmichelson | 2009-03-13 16:26:20 -0500 (Fri, 13 Mar 2009) | 6 lines
  
  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/branches/1.6.1@182123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-13 21:27:08 +00:00
Mark Michelson
a4948990e2 Merged revisions 181846 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r181846 | mmichelson | 2009-03-12 16:43:51 -0500 (Thu, 12 Mar 2009) | 3 lines
  
  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/branches/1.6.1@181849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 21:45:48 +00:00
Mark Michelson
e170745b70 Merged revisions 180007 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r180007 | mmichelson | 2009-03-03 16:49:07 -0600 (Tue, 03 Mar 2009) | 22 lines
  
  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/branches/1.6.1@180009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 22:49:51 +00:00
Russell Bryant
ceffd56266 Merged revisions 176557 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r176557 | russell | 2009-02-17 11:33:38 -0600 (Tue, 17 Feb 2009) | 12 lines

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/branches/1.6.1@176559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 17:38:47 +00:00
Mark Michelson
063e72f154 Merged revisions 174951 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r174951 | mmichelson | 2009-02-11 17:12:57 -0600 (Wed, 11 Feb 2009) | 3 lines
  
  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/branches/1.6.1@174952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-11 23:13:21 +00:00
Mark Michelson
47ba9f946d Merged revisions 174948 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r174948 | mmichelson | 2009-02-11 17:03:08 -0600 (Wed, 11 Feb 2009) | 20 lines
  
  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/branches/1.6.1@174950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-11 23:11:33 +00:00
Mark Michelson
d9694895c9 Merged revisions 173693 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r173693 | mmichelson | 2009-02-05 14:30:45 -0600 (Thu, 05 Feb 2009) | 20 lines

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/branches/1.6.1@173695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05 20:35:42 +00:00
Mark Michelson
e24a4644e4 Merged revisions 173507 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r173507 | mmichelson | 2009-02-04 16:16:19 -0600 (Wed, 04 Feb 2009) | 7 lines

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/branches/1.6.1@173541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-04 22:25:06 +00:00
Mark Michelson
2d42d6cc64 Merged revisions 171618 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r171618 | mmichelson | 2009-01-27 13:30:54 -0600 (Tue, 27 Jan 2009) | 24 lines

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/branches/1.6.1@171620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-27 19:43:22 +00:00
Mark Michelson
e2ce2d9fab Merged revisions 169611 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r169611 | mmichelson | 2009-01-20 18:33:32 -0600 (Tue, 20 Jan 2009) | 22 lines

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/branches/1.6.1@169613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-21 00:35:44 +00:00
Mark Michelson
b072c19f40 Merged revisions 169574 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r169574 | mmichelson | 2009-01-20 15:57:24 -0600 (Tue, 20 Jan 2009) | 6 lines

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/branches/1.6.1@169575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-20 21:57:49 +00:00
Mark Michelson
fac78dd00e Merged revisions 168629 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r168629 | mmichelson | 2009-01-14 18:14:17 -0600 (Wed, 14 Jan 2009) | 24 lines

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/branches/1.6.1@168631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15 00:15:22 +00:00
Mark Michelson
45ac5e6838 Merged revisions 166861 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r166861 | mmichelson | 2008-12-29 12:04:52 -0600 (Mon, 29 Dec 2008) | 14 lines

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/branches/1.6.1@166863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-29 18:16:10 +00:00
Steve Murphy
a7aeaf341b Merged revisions 166665 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

This merged from trunk with no conflicts. I tested
mostly the 'tired' cases, and for the most part
ignored the tests for reconnecting and dialing in
to fetch a parked call, after the first case.

................
  r166665 | murf | 2008-12-23 11:13:49 -0700 (Tue, 23 Dec 2008) | 153 lines
  
  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/branches/1.6.1@166730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-24 01:15:43 +00:00
Joshua Colp
4142e300f7 Merged revisions 165792 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r165792 | file | 2008-12-18 17:21:44 -0400 (Thu, 18 Dec 2008) | 6 lines
  
  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/branches/1.6.1@165794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 21:24:00 +00:00
Mark Michelson
04b50b8b8c Merged revisions 165318 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r165318 | mmichelson | 2008-12-17 15:17:20 -0600 (Wed, 17 Dec 2008) | 15 lines

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/branches/1.6.1@165324 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-17 21:25:32 +00:00
Mark Michelson
e539850d4e Merged revisions 164270 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r164270 | mmichelson | 2008-12-15 10:16:47 -0600 (Mon, 15 Dec 2008) | 4 lines

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/branches/1.6.1@164274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 16:18:38 +00:00
Mark Michelson
20f7c5cb05 Merged revisions 164268 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r164268 | mmichelson | 2008-12-15 10:10:43 -0600 (Mon, 15 Dec 2008) | 17 lines

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/branches/1.6.1@164273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 16:18:19 +00:00
Terry Wilson
ff2e267521 Merged revisions 163873 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r163873 | twilson | 2008-12-12 17:48:26 -0600 (Fri, 12 Dec 2008) | 6 lines
  
  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/branches/1.6.1@163875 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 00:08:17 +00:00
Mark Michelson
15d88d2188 Merged revisions 163085 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r163085 | mmichelson | 2008-12-11 10:47:34 -0600 (Thu, 11 Dec 2008) | 12 lines

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/branches/1.6.1@163087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 16:49:47 +00:00
Mark Michelson
e3390f9344 Merged revisions 163081 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r163081 | mmichelson | 2008-12-11 10:33:16 -0600 (Thu, 11 Dec 2008) | 22 lines

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/branches/1.6.1@163083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 16:44:19 +00:00
Mark Michelson
ec71774eae Merged revisions 160626 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r160626 | mmichelson | 2008-12-03 12:37:46 -0600 (Wed, 03 Dec 2008) | 16 lines

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/branches/1.6.1@160628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 18:42:01 +00:00
Mark Michelson
96792dba18 Merged revisions 160555 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r160555 | mmichelson | 2008-12-03 11:07:09 -0600 (Wed, 03 Dec 2008) | 11 lines

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/branches/1.6.1@160557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 17:10:04 +00:00
Matthew Nicholson
39f8b957f2 Merged revisions 158924 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r158924 | mnicholson | 2008-11-24 18:05:41 -0600 (Mon, 24 Nov 2008) | 6 lines
  
  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/branches/1.6.1@158927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 00:41:07 +00:00
Mark Michelson
2831947109 This is the 1.6.1 version of trunk commit 156883.
It is functionally equivalent to the 1.6.0 commit



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@156894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14 16:57:04 +00:00
Sean Bright
839cb83ea3 Merged revisions 155554 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r155554 | seanbright | 2008-11-08 20:27:00 -0500 (Sat, 08 Nov 2008) | 14 lines

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/branches/1.6.1@155556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-09 01:43:14 +00:00
Kevin P. Fleming
1036849a42 import gcc 4.3.2 warning fixes from trunk, with a few changes specific to this branch
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@153710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 23:56:13 +00:00
Terry Wilson
239f1d53bc Merged revisions 153181 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r153181 | twilson | 2008-10-31 13:55:33 -0500 (Fri, 31 Oct 2008) | 5 lines
  
  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/branches/1.6.1@153266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31 22:11:11 +00:00
Terry Wilson
c30b0d8d10 Small modification to putnopvut's patch to fix this issue. Thanks for all the help, putnopvut!
(closes issue #12884)
	    Reported by: bcnit
		    Patches:
			          12884v4-1.6.0-branch.patch uploaded by otherwiseguy (license 396)
	    Tested by: otherwiseguy



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@152645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 20:16:09 +00:00
Steve Murphy
039de710a7 Merged revisions 152605 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r152605 | murf | 2008-10-28 23:47:13 -0600 (Tue, 28 Oct 2008) | 22 lines

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/branches/1.6.1@152606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:52:41 +00:00
Steve Murphy
f1da1c3957 Merged revisions 152536 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r152536 | murf | 2008-10-28 23:01:00 -0600 (Tue, 28 Oct 2008) | 57 lines

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/branches/1.6.1@152537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:09:20 +00:00
Mark Michelson
4e44db9dee Merged revisions 149201 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r149201 | mmichelson | 2008-10-14 17:41:13 -0500 (Tue, 14 Oct 2008) | 20 lines

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/branches/1.6.1@149203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 22:43:08 +00:00
Michiel van Baak
32330c68b7 Merged revisions 144879 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r144879 | mvanbaak | 2008-09-27 02:49:24 +0200 (Sat, 27 Sep 2008) | 2 lines

fix a couple of CLI commands that did not have a help description.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@144881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-27 01:08:11 +00:00
Steve Murphy
bc73329607 Merged revisions 142676 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r142676 | murf | 2008-09-11 22:50:48 -0600 (Thu, 11 Sep 2008) | 40 lines

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/branches/1.6.1@142678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 05:03:09 +00:00
Mark Michelson
92d81812a4 Merging Revision 142090 from 1.6.0.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@142143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-09 16:47:35 +00:00
Mark Michelson
8ead2e373f Merged revisions 141998 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r141998 | mmichelson | 2008-09-09 07:32:38 -0500 (Tue, 09 Sep 2008) | 7 lines

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/branches/1.6.1@142001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-09 12:34:45 +00:00
Mark Michelson
c760268cb8 Merged revisions 140975 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r140975 | mmichelson | 2008-09-03 15:16:12 -0500 (Wed, 03 Sep 2008) | 4 lines

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/branches/1.6.1@140977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-03 20:18:58 +00:00
Mark Michelson
6ed6a5ae29 Merged revisions 140489 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r140489 | mmichelson | 2008-08-29 12:47:17 -0500 (Fri, 29 Aug 2008) | 30 lines

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/branches/1.6.1@140490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-29 17:48:07 +00:00
Mark Michelson
f362535dde Merged revisions 138694 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r138694 | mmichelson | 2008-08-18 15:23:11 -0500 (Mon, 18 Aug 2008) | 10 lines

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/branches/1.6.1@138698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-18 20:24:29 +00:00
Mark Michelson
cfe95ab57a Merged revisions 138687 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r138687 | mmichelson | 2008-08-18 15:04:10 -0500 (Mon, 18 Aug 2008) | 18 lines

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/branches/1.6.1@138689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-18 20:07:42 +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