Commit Graph

309 Commits

Author SHA1 Message Date
Eliel C. Sardanons 68a37433bc Fix a crash when logging out from the AMI and avoid astobj2 warning messages.
When the user logout the session was being destroyed twice and the file
descriptor was being closed twice. The sessions reference counter wasn't
used in a proper way.
The 'mansession' structure was being treated as an astobj2 and we were
calling ao2_lock/ao2_unlock causing astobj2 report a warning message and
not locking the structure.
Also we were using an ugly naming convention 'destroy_session',
'session_destroy', 'free_session', ... all this "duplicated" code was merged.

(closes issue #14974)
Reported by: pj
Patches:
      manager.diff2 uploaded by eliel (license 64)
      Tested by: dhubbard, eliel, mnicholson

(closes issue #15088)
Reported by: eliel

Review: http://reviewboard.asterisk.org/r/248/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 22:49:13 +00:00
Kevin P. Fleming a3af213506 Remove rarely-used event_log/LOG_EVENT support
In discussions today at the Europe Asterisk Developer Meet-Up, we determined that
the event_log was used in only 9 places in the entire tree, and really was not needed
at all. The users have been converted to use LOG_NOTICE, or the messages have been
removed since other messages were already in place that provided the same information.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02 19:02:22 +00:00
David Vossel ca138fc807 Consistent SSL/TLS options across conf files
ast_tls_read_conf() is a new api call for handling SSL/TLS options across all conf files.  Before this change, SSL/TLS options were not consistent.  http.conf and manager.conf required the 'ssl' prefix while sip.conf used options with the 'tls' prefix.  While the options had different names in different conf files, they all did the exact same thing.  Now, instead of mixing 'ssl' or 'tls' prefixes to do the same thing depending on what conf file you're in, all SSL/TLS options use the 'tls' prefix.  For example.  'sslenable' in http.conf and manager.conf is now 'tlsenable' which matches what already existed in sip.conf. Since this has the potential to break backwards compatibility, previous options containing the 'ssl' prefix still work, but they are no longer documented in the sample.conf files.  The change is noted in the CHANGES file though.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 14:39:48 +00:00
Joshua Colp 68a9f7aca1 Fix a bug where we tried to send events out when no sessions container was present.
This commit stops a warning message (user_data is NULL) from getting output when
manager events get sent before manager is initialized. This happens because manager
is initialized *after* modules are loaded and the act of loading modules triggers
manager events.

(issue #14974)
Reported by: pj


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-27 15:18:47 +00:00
David Vossel 8f0b88c8c8 TLS/SSL private key option
Adds option to specify a private key .pem file when configuring TLS or SSL in AMI, HTTP, and SIP.  Before this, the certificate file was used for both the public and private key.  It is possible for this file to hold both, but most configurations allow for a separate private key file to be specified.  Clarified in .conf files how these options are to be used.  The current conf files do not explain how the private key is handled at all, so without knowledge of Asterisk's TLS implementation, it would be hard to know for sure what was going on or how to set it up.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24 21:22:31 +00:00
Russell Bryant cba19c8a67 Convert the ast_channel data structure over to the astobj2 framework.
There is a lot that could be said about this, but the patch is a big 
improvement for performance, stability, code maintainability, 
and ease of future code development.

The channel list is no longer an unsorted linked list.  The main container 
for channels is an astobj2 hash table.  All of the code related to searching 
for channels or iterating active channels has been rewritten.  Let n be 
the number of active channels.  Iterating the channel list has gone from 
O(n^2) to O(n).  Searching for a channel by name went from O(n) to O(1).  
Searching for a channel by extension is still O(n), but uses a new method 
for doing so, which is more efficient.

The ast_channel object is now a reference counted object.  The benefits 
here are plentiful.  Some benefits directly related to issues in the 
previous code include:

1) When threads other than the channel thread owning a channel wanted 
   access to a channel, it had to hold the lock on it to ensure that it didn't 
   go away.  This is no longer a requirement.  Holding a reference is 
   sufficient.

2) There are places that now require less dealing with channel locks.

3) There are places where channel locks are held for much shorter periods 
   of time.

4) There are places where dealing with more than one channel at a time becomes 
   _MUCH_ easier.  ChanSpy is a great example of this.  Writing code in the 
   future that deals with multiple channels will be much easier.

Some additional information regarding channel locking and reference count 
handling can be found in channel.h, where a new section has been added that 
discusses some of the rules associated with it.

Mark Michelson also assisted with the development of this patch.  He did the 
conversion of ChanSpy and introduced a new API, ast_autochan, which makes it 
much easier to deal with holding on to a channel pointer for an extended period 
of time and having it get automatically updated if the channel gets masqueraded.
Mark was also a huge help in the code review process.

Thanks to David Vossel for his assistance with this branch, as well.  David 
did the conversion of the DAHDIScan application by making it become a wrapper 
for ChanSpy internally.

The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24 14:04:26 +00:00
Tilghman Lesher ce6ebaef97 Support HTTP digest authentication for the http manager interface.
(closes issue #10961)
 Reported by: ys
 Patches: 
       digest_auth_r148468_v5.diff uploaded by ys (license 281)
       SVN branch http://svn.digium.com/svn/asterisk/team/group/manager_http_auth
 Tested by: ys, twilson, tilghman
 Review: http://reviewboard.digium.com/r/223/
 Reviewed by: tilghman,russellb,mmichelson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23 20:36:35 +00:00
Doug Bailey 9c2ff7bb1e 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/trunk@189419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 19:28:16 +00:00
Tilghman Lesher 1030a25ac9 Modify headers and macros, according to Russell's suggestions on the -dev list
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 03:55:27 +00:00
Tilghman Lesher 39808fa953 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/trunk@187483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 18:40:01 +00:00
Mark Michelson 4d42c73c55 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/trunk@186720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-07 20:46:18 +00:00
Tilghman Lesher be40f3a33c Merge changes from str_substitution that are unrelated to that branch.
Included is a small bugfix to an ast_str helper, but most of these changes
are simply doxygen fixes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-01 20:13:28 +00:00
Mark Michelson f1707e95e5 Address Russell's comments regarding rev 185704.
Use ast_debug and ast_softhangup_nolock.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-01 13:59:34 +00:00
Mark Michelson 378c2e9d2a Allow the AMI Hangup command to accept a Cause header.
(closes issue #14695)
Reported by: mneuhauser
Patches:
      cause-for-hangup-manager-action.patch uploaded by mneuhauser (license 425)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-01 00:39:01 +00:00
Russell Bryant f745326750 Use ast_random() instead of rand() to ensure we use the best RNG available.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 18:04:43 +00:00
Joshua Colp 951cbf11d4 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/trunk@180800 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-10 14:40:38 +00:00
Mark Michelson e909bfcea9 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/trunk@174764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-10 21:45:14 +00:00
Russell Bryant 1d46bb0d0f Resolve a memory leak that would occur on an invalid channel given to Action: Status
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06 10:25:09 +00:00
Mark Michelson c668cbfbfc Reverting commit number 173028 as there are some
potential issues



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-02 23:21:33 +00:00
Mark Michelson 7db67f9ca7 Add a CLI command to log out a manager user
(closes issue #13877)
Reported by: eliel
Patches:
      cli_manager_logout.patch.txt uploaded by eliel (license 64)
Tested by: eliel, putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-02 23:10:47 +00:00
Steve Murphy 268ac221a2 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/trunk@172063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-28 20:31:06 +00:00
Tilghman Lesher 071301029c 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/trunk@169365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-19 20:05:52 +00:00
Russell Bryant c2999a8366 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/trunk@166282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 17:09:36 +00:00
Jeff Peeler 4e4093ab48 (closes issue #13993)
Reported by: mika

Add ActionID response to ping if sent with request.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 21:43:17 +00:00
Russell Bryant 0859a4e30c 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/trunk@164807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 20:41:51 +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
Tilghman Lesher 58716e94ba 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/trunk@161790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-08 18:49:50 +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
Jason Parker 85034a7f8e Another place this is missing
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 20:35:36 +00:00
Jason Parker b147256fb5 Fix typo when ListCategories returns none.
(closes issue #13994)
Reported by: mika
Patches:
      ListCategoriesActionPatch.diff uploaded by mika (license 624)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 20:32:20 +00:00
Sean Bright 4dc60e7560 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/trunk@160172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 23:37:49 +00:00
Michiel van Baak 1b6a5b7524 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/trunk@159898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 14:09:59 +00:00
Kevin P. Fleming aa0e888629 add support for event suppression for AMI-over-HTTP
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-26 21:09:58 +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 f3d086256c 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/trunk@158876 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-24 21:56:22 +00:00
Jason Parker ea1446635e 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/trunk@158414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 19:40:57 +00:00
Tilghman Lesher 777d5ee470 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/trunk@156911 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14 17:02:00 +00:00
Tilghman Lesher c2d30ffaa5 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/trunk@156690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-13 21:30:41 +00:00
Pari Nannapaneni f50966c16a changing comment style to conform coding guidelines
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-11 23:32:31 +00:00
Pari Nannapaneni 7a2b0102f1 Patch by Ryan Brindley -- Make sure that manager refuses any duplicate 'new category' requests in updateconfig
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-11 23:02:43 +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
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
Kevin P. Fleming 1ddc834b39 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/trunk@151101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-19 19:11:28 +00:00
BJ Weschke 09e9b5d208 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/trunk@150817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-18 02:18:33 +00:00
Mark Michelson 4ad187cba4 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/trunk@150305 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 23:41:16 +00:00
Mark Michelson 8a1d9d1678 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/trunk@150302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 23:36:49 +00:00
Mark Michelson 9851feb8fb 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/trunk@148160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-09 23:54:59 +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
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