Commit Graph

286 Commits

Author SHA1 Message Date
Doug Bailey
2b41886194 Merged revisions 189419 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r189419 | dbailey | 2009-04-20 14:28:16 -0500 (Mon, 20 Apr 2009) | 11 lines
  
  Merged revisions 189391 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r189391 | dbailey | 2009-04-20 14:10:56 -0500 (Mon, 20 Apr 2009) | 4 lines
    
    Clean up problem with manager implementation of mmap where it was not testing against MAP_FAILED response.
    Got rid of shadowed variable used in processign the mmap results. 
    Change test of mmap results to compare against MAP_FAILED
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@189422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 19:47:43 +00:00
Tilghman Lesher
d470a900fa Merged revisions 187599 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r187599 | tilghman | 2009-04-09 22:55:27 -0500 (Thu, 09 Apr 2009) | 2 lines
  
  Modify headers and macros, according to Russell's suggestions on the -dev list
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@187600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 03:56:37 +00:00
Tilghman Lesher
8a39d76713 Merged revisions 187483 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r187483 | tilghman | 2009-04-09 13:40:01 -0500 (Thu, 09 Apr 2009) | 15 lines
  
  Merged revisions 187428 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r187428 | tilghman | 2009-04-09 13:08:20 -0500 (Thu, 09 Apr 2009) | 8 lines
    
    Race condition between ast_cli_command() and 'module unload' could cause a deadlock.
    Add lock timeouts to avoid this potential deadlock.
    (closes issue #14705)
     Reported by: jamessan
     Patches: 
           20090320__bug14705.diff.txt uploaded by tilghman (license 14)
     Tested by: jamessan
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@187486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 18:54:07 +00:00
Mark Michelson
d88492cae1 Merged revisions 186720 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r186720 | mmichelson | 2009-04-07 15:46:18 -0500 (Tue, 07 Apr 2009) | 12 lines
  
  Merged revisions 186719 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r186719 | mmichelson | 2009-04-07 15:43:49 -0500 (Tue, 07 Apr 2009) | 6 lines
    
    Ensure that \r\n is printed after the ActionID in an OriginateResponse.
    
    (closes issue #14847)
    Reported by: kobaz
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@186722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-07 20:53:10 +00:00
Russell Bryant
ec2800dac7 Merged revisions 184726 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r184726 | russell | 2009-03-27 13:04:43 -0500 (Fri, 27 Mar 2009) | 2 lines

Use ast_random() instead of rand() to ensure we use the best RNG available.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@184728 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 18:09:49 +00:00
Joshua Colp
f182e8256a Merged revisions 180800 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r180800 | file | 2009-03-10 11:40:38 -0300 (Tue, 10 Mar 2009) | 5 lines
  
  Reset the thread local string buffer when handling the UserEvent action.
  
  (closes issue #14593)
  Reported by: JimDickenson
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@180802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-10 14:42:18 +00:00
Mark Michelson
f20ee79f1e Merged revisions 174764 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r174764 | mmichelson | 2009-02-10 15:45:14 -0600 (Tue, 10 Feb 2009) | 21 lines

Fix an fd leak that would occur in HTTP AMI sessions

The explanation behind this fix is a bit complicated, and I've already
typed it up in the code as a huge comment inside of manager.c, so I'll
give the abridged version here.

We needed a way to separate action-specific data from session-specific data.
Unfortunately, the only way to maintain API compatibility and to not have to
change every single manager action was to rename the current mansession structure
and wrap it inside a new mansession structure which actually contains action-
specific data.

(closes issue #14364)
Reported by: awk
Patches:
      14364_better.patch uploaded by putnopvut (license 60)
Tested by: putnopvut

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


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@174769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-10 21:54:45 +00:00
Russell Bryant
2e38587bd0 Merged revisions 173848 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r173848 | russell | 2009-02-06 04:25:09 -0600 (Fri, 06 Feb 2009) | 2 lines

Resolve a memory leak that would occur on an invalid channel given to Action: Status

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@173850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06 10:26:18 +00:00
Steve Murphy
dfb881fadf Merged revisions 172063 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r172063 | murf | 2009-01-28 13:31:06 -0700 (Wed, 28 Jan 2009) | 52 lines
  
  Merged revisions 172030 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r172030 | murf | 2009-01-28 11:51:16 -0700 (Wed, 28 Jan 2009) | 46 lines
    
    This patch fixes h-exten running misbehavior in manager-redirected 
    situations.
    
    What it does:
    1. A new Flag value is defined in include/asterisk/channel.h,
     AST_FLAG_BRIDGE_HANGUP_DONT, which used as a messenge to the
     bridge hangup exten code not to run the h-exten there (nor
     publish the bridge cdr there). It will done at the pbx-loop
     level instead.
    2. In the manager Redirect code, I set this flag on the channel
     if the channel has a non-null pbx pointer. I did the same for the
     second (chan2) channel, which gets run if name2 is set...
     and the first succeeds.
    3. I restored the ending of the cdr for the pbx loop h-exten
     running code. Don't know why it was removed in the first place.
    4. The first attempt at the fix for this bug was to place code
       directly in the async_goto routine, which was called from a
       large number of places, and could affect a large number of
       cases, so I tested that fix against a fair number of transfer
       scenarios, both with and without the patch. In the process,
       I saw that putting the fix in async_goto seemed not to affect
       any of the blind or attended scenarios, but still, I was
       was highly concerned that some other scenarios I had not tested
       might be negatively impacted, so I refined the patch to 
       its current scope, and jmls tested both. In the process, tho,
       I saw that blind xfers in one situation, when the one-touch
       blind-xfer feature is used by the peer, we got strange 
       h-exten behavior.  So, I  inserted code to swap CDRs and
       to set the HANGUP_DONT field, to get uniform behavior.
    5. I added code to the bridge to obey the HANGUP_DONT flag,
       skipping both publishing the bridge CDR, and running
       the h-exten; they will be done at the pbx-loop (higher)
       level instead.
    6. I removed all the debug logs from the patch before committing.
    7. I moved the AUTOLOOP set/reset in the h-exten code in res_features
       so it's only done if the h-exten is going to be run. A very
       minor performance improvement, but technically correct.
    
    
    (closes issue #14241)
    Reported by: jmls
    Patches:
          14241_redirect_no_bridgeCDR_or_h_exten_via_transfer uploaded by murf (license 17)
    Tested by: murf, jmls
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@172067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-28 20:56:48 +00:00
Tilghman Lesher
895e42e525 Merged revisions 169365 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r169365 | tilghman | 2009-01-19 14:05:52 -0600 (Mon, 19 Jan 2009) | 11 lines
  
  Merged revisions 169364 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r169364 | tilghman | 2009-01-19 13:49:25 -0600 (Mon, 19 Jan 2009) | 4 lines
    
    Truncate userevents at the end of a line, when the command exceeds the buffer.
    (closes issue #14278)
     Reported by: fnordian
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@169368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-19 20:10:13 +00:00
Russell Bryant
3db74e5bd7 Merged revisions 166282 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r166282 | russell | 2008-12-22 11:09:36 -0600 (Mon, 22 Dec 2008) | 12 lines

Introduce ast_careful_fwrite() and use in AMI to prevent partial writes.

This patch introduces a function to do careful writes on a file stream which
will handle timeouts and partial writes.  It is currently used in AMI to
address the issue that has been reported.  However, there are probably a few
other places where this could be used.

(closes issue #13546)
Reported by: srt
Tested by: russell
http://reviewboard.digium.com/r/104/

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@166284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 17:19:05 +00:00
Russell Bryant
43371e4cb1 Merged revisions 164807 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r164807 | russell | 2008-12-16 14:41:51 -0600 (Tue, 16 Dec 2008) | 17 lines

Merged revisions 164806 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r164806 | russell | 2008-12-16 14:35:25 -0600 (Tue, 16 Dec 2008) | 9 lines

Add "restart gracefully" to the AMI blacklist of CLI commands.  

"module unload" was already identified as a command that can not be used 
from the AMI.  "restart gracefully" effectively unloads all modules, and will 
run in to the same problems.

(closes issue #13894)
Reported by: kernelsensei

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@164813 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 20:44:22 +00:00
Tilghman Lesher
5e7155ec1f Merged revisions 161790 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r161790 | tilghman | 2008-12-08 12:49:50 -0600 (Mon, 08 Dec 2008) | 6 lines
  
  Allocate enough space initially for the message.
  (closes issue #14027)
   Reported by: junky
   Patches: 
         M14027.diff uploaded by junky (license 177)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@161792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-08 18:52:35 +00:00
Jason Parker
089fa9bb54 Merged revisions 160699-160700 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r160699 | qwell | 2008-12-03 14:32:20 -0600 (Wed, 03 Dec 2008) | 7 lines
  
  Fix typo when ListCategories returns none.
  
  (closes issue #13994)
  Reported by: mika
  Patches:
        ListCategoriesActionPatch.diff uploaded by mika (license 624)
........
  r160700 | qwell | 2008-12-03 14:35:36 -0600 (Wed, 03 Dec 2008) | 1 line
  
  Another place this is missing
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@160702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 20:36:48 +00:00
Sean Bright
c8d7336afb Merged revisions 160170-160172 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r160170 | seanbright | 2008-12-01 18:08:24 -0500 (Mon, 01 Dec 2008) | 1 line
  
  Pay attention to the return value of system(), even if we basically ignore it.
................
  r160171 | seanbright | 2008-12-01 18:18:48 -0500 (Mon, 01 Dec 2008) | 1 line
  
  Silence a build warning. (chan_phone.c:810: warning: value computed is not used)
................
  r160172 | seanbright | 2008-12-01 18:37:49 -0500 (Mon, 01 Dec 2008) | 10 lines
  
  Merged revisions 159976 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r159976 | mvanbaak | 2008-12-01 11:08:36 -0500 (Mon, 01 Dec 2008) | 3 lines
    
    Get rid of the useless format string and argument in the Bogus/ manager channelname.
    Noted by kpfleming and name Bogus/manager suggested by eliel
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@160175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 23:53:18 +00:00
Michiel van Baak
02766b0209 Merged revisions 159898 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r159898 | mvanbaak | 2008-12-01 15:09:59 +0100 (Mon, 01 Dec 2008) | 11 lines
  
  Merged revisions 159897 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r159897 | mvanbaak | 2008-12-01 15:05:41 +0100 (Mon, 01 Dec 2008) | 4 lines
    
    make manager compile on OpenBSD.
    The last (10th) argument to ast_channel_alloc here should be a pointer
    and NULL is not really a pointer.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@159975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 16:06:29 +00:00
Matthew Nicholson
6e242b3728 Merged revisions 158876 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r158876 | mnicholson | 2008-11-24 15:56:22 -0600 (Mon, 24 Nov 2008) | 7 lines
  
  Added EVENT_FLAG_AGI and used it for manager calls in res_agi.c
  
  (closes issue #13873)
  Reported by: fnordian
  Patches:
        ami_agievent.patch uploaded by fnordian (license 110)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@158894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-24 22:05:34 +00:00
Jason Parker
cd95606efe Merged revisions 158414 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r158414 | qwell | 2008-11-21 13:40:57 -0600 (Fri, 21 Nov 2008) | 7 lines
  
  Make sure we add the Event header for CoreShowChannels.
  
  (closes issue #13334)
  Reported by: srt
  Patches:
        13334_missing_event_header_in_core_show_channel.diff uploaded by srt (license 378)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@158415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 19:42:07 +00:00
Tilghman Lesher
1747fd1d2f Merged revisions 156911 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r156911 | tilghman | 2008-11-14 11:02:00 -0600 (Fri, 14 Nov 2008) | 4 lines
  
  Ping is missing the standard double-newline after the event.
  (closes issue #13903)
   Reported by: kebl0155
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@156913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14 17:04:13 +00:00
Tilghman Lesher
a99c4d9881 Merged revisions 156690 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r156690 | tilghman | 2008-11-13 15:30:41 -0600 (Thu, 13 Nov 2008) | 14 lines
  
  Merged revisions 156688 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r156688 | tilghman | 2008-11-13 15:24:00 -0600 (Thu, 13 Nov 2008) | 7 lines
    
    Provide more space for all the data which can appear in an originating
    channel name.
    (closes issue #13398)
     Reported by: bamby
     Patches: 
           manager.c.diff uploaded by bamby (license 430)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@156691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-13 21:31:27 +00:00
Brandon Kruse
cd7a9cb4fe Merged revisions 156017 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r156017 | pari | 2008-11-11 17:02:43 -0600 (Tue, 11 Nov 2008) | 5 lines


 Patch by Ryan Brindley -- Make sure that manager refuses any duplicate 'new category' requests in updateconfig

(closes issue #13539)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@156654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-13 19:29:48 +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
Kevin P. Fleming
f0c712cf4b Merged revisions 151101 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r151101 | kpfleming | 2008-10-19 22:11:28 +0300 (Sun, 19 Oct 2008) | 13 lines
  
  cleaup of the TCP/TLS socket API:
  
  1) rename 'struct server_args' to 'struct ast_tcptls_session_args', to follow coding guidelines
  
  2) make ast_make_file_from_fd() static and rename it to something that indicates what it really is for (again coding guidelines)
  
  3) rename address variables inside 'struct ast_tcptls_session_args' to be more descriptive (dare i say it... coding guidelines)
  
  4) change ast_tcptls_client_start() to use the new 'remote_address' field of the session args for the destination of the connection, and use the 'local_address' field to bind() the socket to the proper source address, if one is supplied
  
  5) in chan_sip, ensure that we pass in the PP address we are bound to when creating outbound (client) connections, so that our connections will appear from the correct address
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@151135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-19 19:33:42 +00:00
BJ Weschke
f4be174ad8 Merged revisions 150817 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r150817 | bweschke | 2008-10-17 22:18:33 -0400 (Fri, 17 Oct 2008) | 8 lines
  
   Using the GetVar handler in AMI is potentially dangerous (insta-crash [tm]) when you use a dialplan function that requires a channel and then you don't provide one or provide an invalid one in the Channel: parameter. We'll handle this situation exactly the same way it was handled in pbx.c back on r61766.
  We'll create a bogus channel for the function call and destroy it when we're done. If we have trouble allocating the bogus channel then we're not going to try executing the function call at all and run the risk of crashing.
  
  (closes issue #13715)
  reported by: makoto
  patch by: bweschke
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@150829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-18 02:29:37 +00:00
Mark Michelson
92b7447620 Merged revisions 150305 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r150305 | mmichelson | 2008-10-16 18:41:16 -0500 (Thu, 16 Oct 2008) | 14 lines

Merged revisions 150304 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r150304 | mmichelson | 2008-10-16 18:40:54 -0500 (Thu, 16 Oct 2008) | 6 lines

Reverting changes from commits 150298 and 150301 since
I was mistakenly under the assumption that dialplan functions
*always* required that a channel be present. I need to go
home earlier, I think :)


........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@150306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 23:41:50 +00:00
Mark Michelson
ddddee6976 Merged revisions 150302 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r150302 | mmichelson | 2008-10-16 18:36:49 -0500 (Thu, 16 Oct 2008) | 24 lines

Merged revisions 150298,150301 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r150298 | mmichelson | 2008-10-16 18:34:37 -0500 (Thu, 16 Oct 2008) | 10 lines

Don't try to call a dialplan function's read callback from
the manager's GetVar handler if an invalid channel has
been specified. Several dialplan functions, including
CHANNEL and SIP_HEADER, do not check for NULL-ness of
the channel being passed in.

(closes issue #13715)
Reported by: makoto


........
r150301 | mmichelson | 2008-10-16 18:35:07 -0500 (Thu, 16 Oct 2008) | 3 lines

And don't forget to return on the error condition


........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@150303 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 23:37:37 +00:00
Mark Michelson
502f661694 Merged revisions 148160 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r148160 | mmichelson | 2008-10-09 18:54:59 -0500 (Thu, 09 Oct 2008) | 14 lines

The priority was unnecessary for the manager atxfer, so it has
been removed. Furthermore, now we actually use the Context argument
passed to set the transfer context and don't error out if no
context is specified.

This addresses the actual problems outlined in issue 12158. Regarding
the other points brought up, regarding the inability to not transfer
to extensions which cannot be represented by DTMF, it is not enough of
a constraint that it is worth attempting to rework the feature.

(closes issue #12158)
Reported by: davidw


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@148161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-09 23:55:32 +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
Jeff Peeler
f7d3198c30 Merged revisions 139928 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r139928 | jpeeler | 2008-08-25 16:48:51 -0500 (Mon, 25 Aug 2008) | 11 lines

Merged revisions 139927 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r139927 | jpeeler | 2008-08-25 16:47:33 -0500 (Mon, 25 Aug 2008) | 3 lines

Fix a typo I made. Lesson learned, apply the patch if one exists.


........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@139929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 21:49:34 +00:00
Jeff Peeler
2090a58d2e Merged revisions 139624 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r139624 | jpeeler | 2008-08-22 16:57:32 -0500 (Fri, 22 Aug 2008) | 13 lines

Merged revisions 139621 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r139621 | jpeeler | 2008-08-22 16:36:13 -0500 (Fri, 22 Aug 2008) | 5 lines

(closes issue #13359)
Reported by: Laureano
Patches:
      originate_channel_check.patch uploaded by Laureano (license 265)

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@139625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 21:58:38 +00:00
Sean Bright
b69c8e6ab5 Another big chunk of changes from the RSW branch. Bunch of stuff from main/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-10 19:35:50 +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
Brandon Kruse
ab64d7181a Revert tilghman and pari's code changes, as
we do NOT need to uri_decode in manager.
(if I sent core%20show%20channels from a telnet
session, it should be interpreted literally, however,
if I send that from an http session, it should be
decoded, which is the behaivor now)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@133770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-25 19:12:17 +00:00
Brett Bryant
41a6477d82 Fixes problem where manager users loaded from users.conf would be
removed early (before the routine to load the configuration was 
finished) because a variable wasn't initialized.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@132242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 22:19:56 +00:00
Tilghman Lesher
0e76506c40 Russell pointed out that using ast_strdupa() within a loop like this is
probably not a good idea, as we might run out of stack space.  Therefore,
changing this over to use the ast_str infrastructure for buffers is
probably a good idea.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@132206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 20:57:47 +00:00
Tilghman Lesher
6a80af637c Fix trunk devmode
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@132203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 20:41:02 +00:00
Pari Nannapaneni
b5a207c6be updateconfig is not uri decoding variables,values from the GET url
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@132169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 20:14:05 +00:00
Tilghman Lesher
49715c05f1 Merged revisions 130959 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r130959 | tilghman | 2008-07-15 12:19:13 -0500 (Tue, 15 Jul 2008) | 8 lines

astman_send_error does not need a newline appended -- the API takes care of
that for us.
(closes issue #13068)
 Reported by: gknispel_proformatique
 Patches: 
       asterisk_1_4_astman_send.patch uploaded by gknispel (license 261)
       asterisk_trunk_astman_send.patch uploaded by gknispel (license 261)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-15 18:25:34 +00:00
Michiel van Baak
e58fecde43 Merged revisions 130573 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r130573 | mvanbaak | 2008-07-14 00:48:51 +0200 (Mon, 14 Jul 2008) | 8 lines

fix memory leak when originate from manager cannot create a thread

(closes issue #13069)
Reported by: gknispel_proformatique
Patches:
      asterisk_trunk_action_originate.patch uploaded by gknispel (license 261)
	  Tested by: gknispel_proformatique, mvanbaak

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-13 22:50:31 +00:00
Tilghman Lesher
4ff527903e Code wasn't ready to be merged - see -dev list discussion
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-09 03:39:59 +00:00
Brett Bryant
d185405755 Janitor project to convert sizeof to ARRAY_LEN macro.
(closes issue #13002)
Reported by: caio1982
Patches:
      janitor_arraylen5.diff uploaded by caio1982 (license 22)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 16:40:28 +00:00
Olle Johansson
6f400edeab Changing name of global api call to ast_*
My mistake, pointed out by Russell.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@128378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-06 08:28:58 +00:00
Olle Johansson
45e79490ba Implement flags for AGI in the channel structure so taht "show channels" and
AMI commands can display that a channel is under control of an AGI.

Work inspired by work at customer site, but paid for by Edvina AB


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@128240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-05 20:54:30 +00:00
Tilghman Lesher
885d17506b Keep ast_app_inboxcount API compatible with 1.6.0.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-02 21:27:53 +00:00
Brett Bryant
2aae0ba13d Updates all usages of ast_tcptls_session_instance to be managed by reference counts so that they only get destroyed when all threads are done using
them, and memory does not get free'd causing strange issues with SIP. 

This code was originally written by russellb in the team/group/issue_11972/ branch.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 21:46:57 +00:00
Russell Bryant
44e1c94465 Merged revisions 119742 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r119742 | russell | 2008-06-02 09:39:45 -0500 (Mon, 02 Jun 2008) | 5 lines

Improve CLI command blacklist checking for the command manager action.  Previously,
it did not handle case or whitespace properly.  This made it possible for blacklisted
commands to get executed anyway.
(closes issue #12765)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 14:41:55 +00:00
Brett Bryant
d32c2d6fd9 Add new functionality to http server that requires manager authentication for any path that includes a directory named 'private'. This patch also
requires manager authentication for any POST's being sent to the server as well to help secure uploads.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-23 21:19:42 +00:00
Luigi Rizzo
d5c75ee032 + Implement a variant of astman_get_header() to return the first or
last match, and possibly skip empty fields.  The function is useful
  (and used here) when a form submits multiple 'Action' fields to the
  Manager.

  This change slightly modifies the current behaviour, but only in the
  case the user supplies multiple 'Action: ' lines and the first
  ones are empty, so the change is totally harmless.
 
+ Fix style on a couple of "if (displayconnects)" statements;
 
+ Expand a bit the 'Manager Test' interface, to make it slightly
  more user friendly. But also comment that the HTML should not
  be embedded in the C source.
 
None of this stuff needs to be applied to 1.4.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-20 18:07:24 +00:00
Luigi Rizzo
18065a175d Use casts or intermediate variables to remove a number
of platform/compiler-dependent warnings when handing
struct timeval fields, both reading and printing them.

It is a lost battle to handle the different ways struct timeval
is handled on the various platforms and compilers, so try
to be pragmatic and go through int/long which are universally
supported.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-15 10:56:29 +00:00
Olle Johansson
29b1d73567 Add support for codec settings in originate via call file and manager.
This is to enable video and text in originated calls. Development sponsored
by Omnitor AB, Sweden. (http://www.omnitor.se)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 12:32:57 +00:00