dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

346 Commits

Author SHA1 Message Date
mmichelson 0e97d64540 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: http://svn.digium.com/svn/asterisk/trunk@185704 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-01 00:39:01 +00:00
russell 34087ec576 Use ast_random() instead of rand() to ensure we use the best RNG available.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184726 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 18:04:43 +00:00
file 2d937baa0d Reset the thread local string buffer when handling the UserEvent action.
(closes issue #14593)
Reported by: JimDickenson


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@180800 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-10 14:40:38 +00:00
mmichelson 960ba29f0e 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: http://svn.digium.com/svn/asterisk/trunk@174764 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-10 21:45:14 +00:00
russell 5994e82077 Resolve a memory leak that would occur on an invalid channel given to Action: Status
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173848 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-06 10:25:09 +00:00
mmichelson c6f0d3482e Reverting commit number 173028 as there are some
potential issues



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173047 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-02 23:21:33 +00:00
mmichelson cdc296ee61 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: http://svn.digium.com/svn/asterisk/trunk@173028 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-02 23:10:47 +00:00
murf a0d8bf45f5 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: http://svn.digium.com/svn/asterisk/trunk@172063 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-28 20:31:06 +00:00
tilghman 47818a9061 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: http://svn.digium.com/svn/asterisk/trunk@169365 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-19 20:05:52 +00:00
russell 87c96dd4d0 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: http://svn.digium.com/svn/asterisk/trunk@166282 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22 17:09:36 +00:00
jpeeler 50bf92cfd8 (closes issue #13993)
Reported by: mika

Add ActionID response to ping if sent with request.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165798 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18 21:43:17 +00:00
russell 297030dbc1 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: http://svn.digium.com/svn/asterisk/trunk@164807 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-16 20:41:51 +00:00
tilghman a41b34a63c Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-13 08:36:35 +00:00
tilghman 54e6bc6e05 Allocate enough space initially for the message.
(closes issue #14027)
 Reported by: junky
 Patches: 
       M14027.diff uploaded by junky (license 177)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@161790 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-08 18:49:50 +00:00
eliel 6e243a5434 Janitor, use ARRAY_LEN() when possible.
(closes issue #13990)
Reported by: eliel
Patches:
      array_len.diff uploaded by eliel (license 64)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@161218 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-05 10:31:25 +00:00
qwell fe0a1261dd Another place this is missing
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@160700 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-03 20:35:36 +00:00
qwell 8127dbd82f Fix typo when ListCategories returns none.
(closes issue #13994)
Reported by: mika
Patches:
      ListCategoriesActionPatch.diff uploaded by mika (license 624)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@160699 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-03 20:32:20 +00:00
seanbright f7c1d2a4bc 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: http://svn.digium.com/svn/asterisk/trunk@160172 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-01 23:37:49 +00:00
mvanbaak 37fd23ecc0 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: http://svn.digium.com/svn/asterisk/trunk@159898 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-01 14:09:59 +00:00
kpfleming 688dbc7fa7 add support for event suppression for AMI-over-HTTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@159629 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-26 21:09:58 +00:00
seanbright 3ce5f8f4ee 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: http://svn.digium.com/svn/asterisk/trunk@158959 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-25 01:01:49 +00:00
mnicholson 56aff74a07 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: http://svn.digium.com/svn/asterisk/trunk@158876 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-24 21:56:22 +00:00
qwell 54ab13f9c0 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: http://svn.digium.com/svn/asterisk/trunk@158414 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-21 19:40:57 +00:00
tilghman 5f8bb934f4 Ping is missing the standard double-newline after the event.
(closes issue #13903)
 Reported by: kebl0155


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@156911 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-14 17:02:00 +00:00
tilghman ca96e392ca 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: http://svn.digium.com/svn/asterisk/trunk@156690 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-13 21:30:41 +00:00
pari d8c640af72 changing comment style to conform coding guidelines
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@156018 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-11 23:32:31 +00:00
pari bf38177783 Patch by Ryan Brindley -- Make sure that manager refuses any duplicate 'new category' requests in updateconfig
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@156017 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-11 23:02:43 +00:00
seanbright a7a95954c8 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: http://svn.digium.com/svn/asterisk/trunk@155401 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-07 22:39:30 +00:00
tilghman cf7ea76646 Slightly optimize ast_devstate_str and rename global functions devstate2str and config_text_file_save to have an ast_ prefix
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@154260 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-04 18:47:20 +00:00
kpfleming cc1b2c100f 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: http://svn.digium.com/svn/asterisk/trunk@153616 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-02 18:52:13 +00:00
kpfleming 2b799006a1 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: http://svn.digium.com/svn/asterisk/trunk@151101 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-19 19:11:28 +00:00
bweschke 8595eb4ab6 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: http://svn.digium.com/svn/asterisk/trunk@150817 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-18 02:18:33 +00:00
mmichelson 83771bab9d 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: http://svn.digium.com/svn/asterisk/trunk@150305 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-16 23:41:16 +00:00
mmichelson 70265ca2bb 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: http://svn.digium.com/svn/asterisk/trunk@150302 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-16 23:36:49 +00:00
mmichelson 5d95332ae8 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: http://svn.digium.com/svn/asterisk/trunk@148160 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-09 23:54:59 +00:00
mvanbaak b6fa2c3b98 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: http://svn.digium.com/svn/asterisk/trunk@145121 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-28 23:32:14 +00:00
tilghman 95bae85759 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: http://svn.digium.com/svn/asterisk/trunk@142992 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-12 23:30:03 +00:00
mmichelson 91df49dd46 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: http://svn.digium.com/svn/asterisk/trunk@140489 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-29 17:47:17 +00:00
jpeeler 3b89fc95e2 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: http://svn.digium.com/svn/asterisk/trunk@139928 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-25 21:48:51 +00:00
jpeeler 3672d01e0e 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: http://svn.digium.com/svn/asterisk/trunk@139624 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-22 21:57:32 +00:00
seanbright 8cb986b936 Another big chunk of changes from the RSW branch. Bunch of stuff from main/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@137082 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-10 19:35:50 +00:00
kpfleming 0891b8a53c 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: http://svn.digium.com/svn/asterisk/trunk@135680 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-05 16:56:11 +00:00
bkruse 41d884e00e 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: http://svn.digium.com/svn/asterisk/trunk@133770 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-25 19:12:17 +00:00
bbryant b29024fb29 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: http://svn.digium.com/svn/asterisk/trunk@132242 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-18 22:19:56 +00:00
tilghman fe3d84bec3 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: http://svn.digium.com/svn/asterisk/trunk@132206 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-18 20:57:47 +00:00
tilghman a8ea2f4cab Fix trunk devmode
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@132203 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-18 20:41:02 +00:00
pari e4b29e53ad updateconfig is not uri decoding variables,values from the GET url
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@132169 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-18 20:14:05 +00:00
tilghman cdc7f99d9a 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: http://svn.digium.com/svn/asterisk/trunk@131044 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-15 18:25:34 +00:00
mvanbaak 3744b47017 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: http://svn.digium.com/svn/asterisk/trunk@130574 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-13 22:50:31 +00:00
tilghman 22bb3309ec Code wasn't ready to be merged - see -dev list discussion
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@129307 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-09 03:39:59 +00:00
bbryant 0110f8c87a 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: http://svn.digium.com/svn/asterisk/trunk@129045 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-08 16:40:28 +00:00
oej b31e96bcd6 Changing name of global api call to ast_*
My mistake, pointed out by Russell.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@128378 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-06 08:28:58 +00:00
oej 80e141d6ff 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: http://svn.digium.com/svn/asterisk/trunk@128240 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-05 20:54:30 +00:00
tilghman 2da25c2375 Keep ast_app_inboxcount API compatible with 1.6.0.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@127609 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-02 21:27:53 +00:00
bbryant 720a492e88 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: http://svn.digium.com/svn/asterisk/trunk@123546 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-17 21:46:57 +00:00
russell 999c5b4af6 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: http://svn.digium.com/svn/asterisk/trunk@119744 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-02 14:41:55 +00:00
bbryant 3342d99a30 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: http://svn.digium.com/svn/asterisk/trunk@118161 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-23 21:19:42 +00:00
rizzo 3bfeb96b29 + 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: http://svn.digium.com/svn/asterisk/trunk@117297 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-20 18:07:24 +00:00
rizzo b19d55996c 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: http://svn.digium.com/svn/asterisk/trunk@116557 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-15 10:56:29 +00:00
oej 8890616992 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: http://svn.digium.com/svn/asterisk/trunk@116229 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-14 12:32:57 +00:00
mmichelson 71a41a28b1 Adding support for "urgent" voicemail messages. Messages which are
marked "urgent" are considered to be higher priority than other messages
and so they will be played before any other messages in a user's mailbox.

There are two ways to leave an urgent message. 
1. send the 'U' option to VoiceMail().
2. Set review=yes in voicemail.conf. This will give instructions for 
   a caller to mark a message as urgent after the message has been recorded.

I have tested that this works correctly with file and ODBC storage, and James
Rothenberger (who wrote initial support for this feature) has tested its use
with IMAP storage.

(closes issue #11817)
Reported by: jaroth
	Based on branch http://svn.digium.com/svn/asterisk/team/jrothenberger/asterisk-urgent
Tested by: putnopvut, jaroth



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115588 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-09 21:22:42 +00:00
tilghman 9844825c4b Optionally display the value of several variables within the Status command.
(Closes issue AST-34)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115301 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-05 19:33:14 +00:00
tilghman d1cc29c9c1 Modify TIMEOUT() to be accurate down to the millisecond.
(closes issue #10540)
 Reported by: spendergrass
 Patches: 
       20080417__bug10540.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115076 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-01 23:06:23 +00:00
russell 06e18514ab Merged revisions 114591 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114591 | russell | 2008-04-23 12:55:31 -0500 (Wed, 23 Apr 2008) | 5 lines

Store the manager session ID explicitly as 4 byte ID instead of a ulong.  The
mansession_id cookie is coded to be limited to 8 characters of hex, and this
could break logins from 64-bit machines in some cases.
(inspired by AST-20)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114592 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-23 18:01:00 +00:00
russell 4ca84b273d Correct action_ping() and action_events() with regards to Manager 1.1
documentation.  Also, fix a bug in xml_translate().

(closes issue #11649)
Reported by: ys
Patches:
      trunk_manager.c.diff uploaded by ys (license 281)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114527 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-22 15:46:01 +00:00
russell d12659fe30 Merged revisions 114284 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114284 | russell | 2008-04-18 16:48:06 -0500 (Fri, 18 Apr 2008) | 2 lines

Don't destroy a manager session if poll() returns an error of EAGAIN.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114285 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-18 21:51:05 +00:00
mmichelson e8da1cc73c Merged revisions 114051 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114051 | mmichelson | 2008-04-10 15:59:49 -0500 (Thu, 10 Apr 2008) | 3 lines

Fix 1.4 build when LOW_MEMORY is enabled.


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114052 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-10 22:02:32 +00:00
mmichelson 6c28f000bf Merged revisions 112468 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r112468 | mmichelson | 2008-04-02 12:36:04 -0500 (Wed, 02 Apr 2008) | 13 lines

Fix a race condition in the manager. It is possible that a new manager event
could be appended during a brief time when the manager is not waiting for input.
If an event comes during this period, we need to set an indicator that there is an
event pending so that the manager doesn't attempt to wait forever for an event that
already happened.

(closes issue #12354)
Reported by: bamby
Patches:
      manager_race_condition.diff uploaded by bamby (license 430)
	  (comments added by me)


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@112469 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-02 17:36:49 +00:00
twilson 03c243323c Re-add HTTP post support by moving to res_http_post.c
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@112426 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-02 15:25:48 +00:00
tilghman f0d1cef621 Add the "config reload <conffile>" command, which allows you to tell Asterisk
to reload any file that references a given configuration file.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@111012 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-26 18:39:06 +00:00
mmichelson 97619eccb1 This ensures that the manager interface is not enabled by default. Prior to this
change, it was possible to start Asterisk with the manager interface enabled, then
either comment out the enabled option or make manager.conf unopenable and the manager
interface would still be enabled.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@110831 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-26 00:02:31 +00:00
kpfleming 528c99ca21 actually implement HTTP request dispatching based on both URI and method; reduce duplication of data when generating responses using ast_http_error()
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@109912 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-19 16:18:29 +00:00
kpfleming 93531c68a2 start the process of changing HTTP request dispatching to do it based on *both* URI and method, so that POST support can move into a module; move http.c's private function prototypes into _private.h
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@109762 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-18 22:32:26 +00:00
twilson 9e8ebe6a94 Go through and fix a bunch of places where character strings were being interpreted as format strings. Most of these changes are solely to make compiling with -Wsecurity and -Wformat=2 happy, and were not
actual problems, per se.  I also added format attributes to any printf wrapper functions I found that didn't have them.  -Wsecurity and -Wmissing-format-attribute added to --enable-dev-mode.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@109447 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-18 15:43:34 +00:00
file 421d5fe685 Make sure values are interpreted as character strings and not format strings.
(AST-2008-004)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@109396 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-18 15:13:07 +00:00
mmichelson d5375df01f Make this compile
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@108586 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-13 21:47:55 +00:00
mmichelson 721d85cdd0 Fixing a potential buffer overflow in the manager command ModuleCheck.
Though this overflow is exploitable remotely, we are NOT issuing a security
advisory for this since in order to exploit the overflow, the attacker would
have to establish an authenticated manager session AND have the system privilege.
By gaining this privilege, the attacker already has more powerful weapons at his
disposal than overflowing a buffer with a malformed manager header, so the vulnerability
in this case really lies with the authentication method that allowed the attacker to 
gain the system privilege in the first place.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@108529 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-13 20:59:00 +00:00
russell f5ce5710ec Rename ast_tcptls_server_instance to session_instance, since this pertains to
server and client usage.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@108295 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-12 22:13:18 +00:00
mmichelson f523ddafbb Adding the Atxfer manager command. With this, you may initiate
an attended transfer over AMI

(closes issue #10585)
Reported by: ornati
Patches:
      atxfer-trunk-r90428.diff uploaded by ornati (license 210)
	  (with modifications from me)
Tested by: putnopvut



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@106236 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-05 22:33:05 +00:00
mmichelson 8e4b2b7d21 There are several places in manager.c where BUFSIZ is used for a buffer
which will contain nowhere near that amount of data. This makes these buffers
more reasonably sized.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105864 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04 23:24:56 +00:00
tilghman 832983e43a Whitespace changes only
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105840 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04 23:04:29 +00:00
russell de432dde0b add a destroy API call for a server instance
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105804 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04 22:28:03 +00:00
russell c2841b668a More public API name changes to use an appropriate ast_ prefix
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105785 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04 22:23:21 +00:00
russell 8ef91aad9e Rename public object server_instance to ast_tcptls_server_instance
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105773 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04 22:15:18 +00:00
tilghman 8b6f404342 Merged revisions 104704 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104704 | tilghman | 2008-02-27 12:15:10 -0600 (Wed, 27 Feb 2008) | 2 lines

Ensure the session ID can't be 0.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104705 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-27 18:20:35 +00:00
russell d5b06adda9 Rename version.h to ast_version.h. Next, I will be re-adding version.h as an
automatically generated file like it used to be.  This still needs to be there
for modules that have to check it to compile against multiple asterisk versions.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104244 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-26 20:02:14 +00:00
tilghman 92539559f8 Move Originate to a separate privilege and require the additional System privilege to call out to a subshell.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104039 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-22 22:55:35 +00:00
kpfleming b296216c68 Merged revisions 104015 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104015 | kpfleming | 2008-02-21 08:33:51 -0600 (Thu, 21 Feb 2008) | 2 lines

reduce the likelihood that HTTP Manager session ids will consist of primarily '1' bits

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104016 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-21 14:44:04 +00:00
qwell 5564e9805b Even more sane permissions. This should be handled via a umask, like in many other places.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103474 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-12 20:27:01 +00:00
qwell 5f51defbd0 Use slight more sane permissions
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103447 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-12 20:02:32 +00:00
russell d77c926d02 Fix build on *BSD. These permissions constants are not available there.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103387 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-12 15:16:39 +00:00
jpeeler 3847faed34 Requested changes from Pari, reviewed by Russell.
Added ability to retrieve list of categories in a config file.
Added ability to retrieve the content of a particular category.
Added ability to empty a context.
Created new action to create a new file.
Updated delete action to allow deletion by line number with respect to category.
Added new action insert to add new variable to category at specified line.
Updated action newcat to allow new category to be inserted in file above another existing category.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103331 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-12 00:24:36 +00:00
file adf32284d7 Just some minor coding style cleanup...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103318 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-11 18:27:47 +00:00
tilghman 26aa0301e6 CoreSettings and CoreStatus are missing the terminating "\r\n". Also, some
miscellaneous spacing and initialization issues.
(closes issue #11909)
 Reported by: srt
 Patches: 
       patch-11909-2.diff uploaded by srt (license 378)
 Tested by: srt


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@102190 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-03 17:40:48 +00:00
russell d6e19bdc91 Merge changes from team/group/sip-tcptls
This set of changes introduces TCP and TLS support for chan_sip.  There are various
new options in configs/sip.conf.sample that are used to enable these features.  Also,
there is a document, doc/siptls.txt that describes some things in more detail.

This code was implemented by Brett Bryant and James Golovich.  It was reviewed
by Joshua Colp and myself.  A number of other people participated in the testing
of this code, but since it was done outside of the bug tracker, I do not have their
names.  If you were one of them, thanks a lot for the help!

(closes issue #4903, but with completely different code that what exists there.)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@99085 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-18 22:04:33 +00:00
file b562c95259 Make sure the user's manager secret exists, even if it is blank.
(closes issue #11749)
Reported by: srt


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@98830 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-14 20:01:19 +00:00
tilghman 0b178b776f Conversion to load manager.conf into memory did not convert the password
functions correctly.  (Closes issue #11749)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@98536 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-12 18:12:56 +00:00
tilghman 928cdf67bc oops, missed the case of a 0 permission (which should mean everybody is allowed, not nobody)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@97655 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-10 00:39:34 +00:00
tilghman 40a3aabbf1 Several manager changes:
1) Add the Dialplan class, for NewExten and VarSet events, which should cut
down on the volume of traffic in the Call class.
2) Permit some commands to be run from multiple classes, such as allowing
DBGet to be run from either the System or the Reporting class.
3) Heavily document each class in the sample config, as there were several
that made no sense to be in the write= line, and two that made no sense to be
in the read= line (since they controlled no permissions there).

(Closes issue #10386)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@97651 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-10 00:12:35 +00:00
file a995706a85 Move ModuleLoad and ModuleCheck manager commands from loader.c to manager.c. Previously they would get registered twice because of the way manager.c operates.
(closes issue #11699)
Reported by: caio1982
Patches:
      manager_module_commands1.diff uploaded by caio1982 (license 22)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@96858 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-07 15:52:55 +00:00