Commit Graph

403 Commits

Author SHA1 Message Date
Matthew Jordan
56549c96ab Review: https://reviewboard.asterisk.org/r/1364/
This update adds a new AMI event, TestEvent, which is enabled when the TEST_FRAMEWORK compiler flag is defined.  It also adds initial usage of this event to app_voicemail.  The TestEvent AMI event is used extensively by the voicemail tests in the Asterisk Test Suite.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22 18:15:51 +00:00
Kinsey Moore
43a5273659 AMI action ModuleReload returns Error if Module: missing or empty
An empty string was not being checked for properly causing identification of
the module to be reloaded to fail and return an Error with message
"No such module."

(closes issue AST-616)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@331315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-10 13:47:46 +00:00
Leif Madsen
d4938a111e Introduce <support_level> tags in MODULEINFO.
This change introduces MODULEINFO into many modules in Asterisk in order to show
the community support level for those modules. This is used by changes committed
to menuselect by Russell Bryant recently (r917 in menuselect). More information about
the support level types and what they mean is available on the wiki at
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@328209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14 20:13:06 +00:00
Kevin P. Fleming
feb182f802 Correct double-free situation in manager output processing.
The process_output() function calls ast_str_append() and xml_translate() on its
'out' parameter, which is a pointer to an ast_str buffer. If either of these
functions need to reallocate the ast_str so it will have more space, they will
free the existing buffer and allocate a new one, returning the address of the
new one. However, because process_output only receives a pointer to the ast_str,
not a pointer to its caller's variable holding the pointer, if the original
ast_str is freed, the caller will not know, and will continue to use it (and
later attempt to free it).

(reported by jkroon on #asterisk-dev)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@327950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-12 22:53:53 +00:00
Leif Madsen
557fe8bc24 Add Username and Secret fields to manager Login action.
Pointed out by Vlad Povorozniuc

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-17 18:51:16 +00:00
Sean Bright
0701feaa95 Merged revisions 323579 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r323579 | seanbright | 2011-06-15 11:22:50 -0400 (Wed, 15 Jun 2011) | 32 lines
  
  Merged revisions 323559 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r323559 | seanbright | 2011-06-15 11:15:30 -0400 (Wed, 15 Jun 2011) | 25 lines
    
    Resolve a segfault/bus error when we try to map memory that falls on a page
    boundary.
    
    The fix for ASTERISK-15359 was incorrect in that it added 1 to the length of the
    mmap'd region.  The problem with this is that reading/writing to that extra byte
    outside of the bounds of the underlying fd causes a bus error.
    
    The real issue is that we are working with both a FILE * and the raw fd
    underneath it and not synchronizing between them.  The code that was removed in
    ASTERISK-15359 was correct, but we weren't flushing the FILE * before mapping
    the fd.
    
    Looking at the manager code in 1.4 reveals that the FILE * in 'struct
    mansession' is never used except to create a temporary file that we immediately
    fdopen.  This means we just need to write a 0 byte to the fd and everything will
    just work.  The other branches require a call to fflush() which, while not a
    guaranteed fix, should reduce the likelihood of a crash.
    
    This all makes sense in my head.
    
    (closes issue ASTERISK-16460)
    Reported by: Ravelomanantsoa Hoby (hoby)
    Patches:
    		issue17747_1.4_svn_markII.patch uploaded by Sean Bright (license #5060)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-15 15:31:53 +00:00
Richard Mudgett
59a41188a8 The AMI Newstate event contains different information between v1.4 and v1.8.
The addition of connected line support in v1.8 changes the behavior of the
channel caller ID somewhat.  The channel caller ID value no longer time
shares with the connected line ID on outgoing call legs.  The timing of
some AMI events/responses output the connected line ID as caller ID.
These party ID's are now separate.

* The ConnectedLineNum and ConnectedLineName headers were added to many
AMI events/responses if the CallerIDNum/CallerIDName headers were also
present.

(closes issue #18252)
Reported by: gje
Tested by: rmudgett

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@320823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-25 17:06:38 +00:00
Richard Mudgett
a5325746cf Add ConnectedLineNum/Name headers to output of AMI action Status.
* Add ConnectedLineNum and ConnectedLineName headers to the output of the
AMI action Status.  This makes it easier to find out who the channel is
connected to without having to lookup BridgedChannel or when they are
connected to an application (e.g.: VoiceMail) which has no bridged
channel.

* Bridged channels with no CallerID had "" instead of "<unknown>" output,
that might be a bug as "<unknown>" was what older versions used.

(closes issue #18158)
Reported by: gareth
Patches:
      svn-292308.diff uploaded by gareth (license 208)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@320650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-23 17:53:44 +00:00
Leif Madsen
acb1bb3026 Filter out blacklisted manager events when using eventfilter.
Merging change from trunk in revision 306432.

(closes issue #19260)
Reported by: dhubbard
Tested by: dhubbard

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@318485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-10 18:46:25 +00:00
Russell Bryant
14b46c79f9 Add missing ActioID handling to Events action.
(closes issue #18949)
Reported by: edersohe
Patches:
      0018949.patch uploaded by edersohe (license 1228)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@317425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 21:53:13 +00:00
Sean Bright
d4a843f8d1 Make sure that tcptls_session is properly initialized.
(issue #18598)
Reported by: ksn


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 02:23:28 +00:00
Sean Bright
1f160df9fe Only return a single error via AMI when requesting a forbidden action.
(closes issue #19216)
Reported by: oej
Patches:
      issue19216-1.8-r316204.patch uploaded by seanbright (license 71)
Tested by: seanbright


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-04 14:35:05 +00:00
Russell Bryant
a82f1bb995 Fix a bunch of compiler warnings generated by gcc 4.6.0.
Most of these are -Wunused-but-set-variable, but there were a few others
mixed in here, as well.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 19:55:49 +00:00
Sean Bright
7eef08532c If we aren't interested in events, don't generate the FullyBooted event on AMI login.
(closes issue #19089)
Reported by: bklang
Patches:
      issue19089-1.8-r316204.patch uploaded by seanbright (license 71)
Tested by: seanbright


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 18:17:36 +00:00
Matthew Nicholson
4468fe047e Merged revisions 314620 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r314620 | mnicholson | 2011-04-21 13:22:19 -0500 (Thu, 21 Apr 2011) | 20 lines
  
  Merged revisions 314607 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r314607 | mnicholson | 2011-04-21 13:19:21 -0500 (Thu, 21 Apr 2011) | 14 lines
    
    Added limits to the number of unauthenticated sessions TCP based protocols are allowed to have open simultaneously.  Also added timeouts for unauthenticated sessions where it made sense to do so.
    
    Unrelated, the manager interface now properly checks if the user has the "system" privilege before executing shell commands via the Originate action. 
    
    AST-2011-005
    AST-2011-006
    
    (closes issue #18787)
    Reported by: kobaz
    
    (related to issue #18996)
    Reported by: tzafrir
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@314628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-21 18:24:05 +00:00
Matthew Nicholson
b5e04b75dc Merged revisions 312764 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r312764 | mnicholson | 2011-04-05 09:13:07 -0500 (Tue, 05 Apr 2011) | 15 lines
  
  Merged revisions 312761 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r312761 | mnicholson | 2011-04-05 09:10:34 -0500 (Tue, 05 Apr 2011) | 8 lines
    
    Limit the number of unauthenticated manager sessions and also limit the time they have to authenticate.
    
    AST-2011-005
    
    (closes issue #18996)
    Reported by: tzafrir
    Tested by: mnicholson
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@312766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-05 14:14:50 +00:00
Matthew Nicholson
0e86babe2f Merged revisions 311140 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r311140 | mnicholson | 2011-03-17 09:58:52 -0500 (Thu, 17 Mar 2011) | 4 lines
  
  Don't write items to the manager socket twice.
  
  AST-2011-003
  
  (closes issue 0018987)
  Reported by: ks-steven
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@311141 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-17 15:00:33 +00:00
Terry Wilson
d37bdd02dc Merged revisions 310992 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r310992 | twilson | 2011-03-16 14:23:03 -0500 (Wed, 16 Mar 2011) | 4 lines
  
  Don't keep trying to write to a closed connection
  
  See security advisory AST-2011-003.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@310993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-16 19:26:57 +00:00
Terry Wilson
8fe14985fb Add \r\n to remaining http headers passed to ast_http_send
r309204 changed the behavior of ast_http_send. It now requires headers
to be passed with trailing \r\n. This change updates the remaining
instances in the code that did not pass the \r\n.

(closes issue #18186)
Reported by: nivaldomjunior
Patches: 
      res_phoneprov.c.diff uploaded by lathama (license 1028)
      manager.diff.txt uploaded by twilson (license 396)
Tested by: lathama


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@310240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-10 16:05:45 +00:00
Terry Wilson
463a39b5d1 Merged revisions 308814 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r308814 | twilson | 2011-02-24 11:54:49 -0600 (Thu, 24 Feb 2011) | 19 lines
  
  Merged revisions 308813 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r308813 | twilson | 2011-02-24 11:42:16 -0600 (Thu, 24 Feb 2011) | 12 lines
    
    Don't broadcast FullyBooted to every AMI connection
    
    The FullyBooted event should not be sent to every AMI connection every
    time someone connects via AMI. It should only be sent to the user who
    just connected.
    
    (closes issue #18168)
    Reported by: FeyFre
    Patches: 
          bug0018168.patch uploaded by FeyFre (license 1142)
    Tested by: FeyFre, twilson
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@308815 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-24 17:57:18 +00:00
Richard Mudgett
a785544090 Merged revisions 305889 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r305889 | rmudgett | 2011-02-02 18:15:07 -0600 (Wed, 02 Feb 2011) | 17 lines
  
  Merged revisions 305888 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r305888 | rmudgett | 2011-02-02 18:02:43 -0600 (Wed, 02 Feb 2011) | 8 lines
  
    Minor AST_FRAME_TEXT related issues.
  
    * Include the null terminator in the buffer length.  When the frame is
    queued it is copied.  If the null terminator is not part of the frame
    buffer length, the receiver could see garbage appended onto it.
  
    * Add channel lock protection with ast_sendtext().
  
    * Fixed AMI SendText action ast_sendtext() return value check.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@305923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 00:24:40 +00:00
Russell Bryant
5537ae9930 Only check container count if it exists.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@302837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-19 23:56:48 +00:00
Russell Bryant
a13d703fe3 Merged revisions 302788 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r302788 | russell | 2011-01-19 17:06:14 -0600 (Wed, 19 Jan 2011) | 4 lines
  
  Turn a noisy verbose message into a debug message.
  
  This can drown your console if you're using the AMI over HTTP.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@302789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-19 23:06:46 +00:00
Russell Bryant
5001983a56 Resolve a memory leak with the manager interface is disabled.
The intent of this check as it stands in previous versions of Asterisk was to
check if there are any active sessions.  If there were no sessions, then the
function would return immediately and not bother with queueing up the manager
event to be processed.  Since the conversion of storing sessions in an astobj2
container, this check will always pass.  I changed it to go back to checking
what was intended.

The side effect of this was that if the AMI is disabled, the manager event
queue is populated anyway, but the code that runs to clear out the queue
never runs.  A producer with no consumer is a bad thing.

Reported internally by kmorgan.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@302785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-19 22:35:15 +00:00
Matthew Nicholson
523aed7d2f Merged revisions 301594 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r301594 | mnicholson | 2011-01-12 12:50:31 -0600 (Wed, 12 Jan 2011) | 15 lines
  
  Removed a usleep(1) that shouldn't be necessary in session_do, and removed the
  ms_t member from the mansession_session structure.
  
  Merged revisions 301591 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r301591 | mnicholson | 2011-01-12 12:39:03 -0600 (Wed, 12 Jan 2011) | 5 lines
    
    Don't store the thread id for the manager session in the structure we pass to
    the thread for the manager session.
    
    ABE-2543
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@301595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-12 18:51:37 +00:00
Paul Belanger
2c98e867f4 If manager and tls are disabled, do not display TCP/TLS Bindaddress.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-02 20:45:09 +00:00
David Vossel
042d5edaa3 Fixes recursive lock problem in manager.c
It is possible for a AMI session to freeze because of invalid
use of recursive locks during the EVENT processing.  This
patch removes the unnecessary locks.

(closes issue #18167)
Reported by: sustav
Patches:
      manager_locking_v1.diff uploaded by dvossel (license 671)
Tested by: sustav




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-21 16:14:33 +00:00
David Vossel
197b033cd7 Fixes manager.c crash.
This issue was caused by improper use of the mansession lock and
manession_session lock.  These two structures are confusing to begin
with so I'm not surprised this occurred.  I fixed this by consistently
making sure we use each of these locks only to protect the data
in the corresponding structure.  We had mismatched usage of these
locks which resulted in no mutual exclusivity occurring at all.


(closes issue #17994)
Reported by: vrban
Patches:
      mansession_locking_fix.diff uploaded by dvossel (license 671)
Tested by: vrban


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-12 15:58:56 +00:00
Olle Johansson
1d937d6cea Merged revisions 289950 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r289950 | oej | 2010-10-02 10:52:03 +0200 (Lör, 02 Okt 2010) | 9 lines
  
  Merged revisions 289949 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r289949 | oej | 2010-10-02 10:50:05 +0200 (Lör, 02 Okt 2010) | 2 lines
    
    Add documentation for undocumented option to AMI action originate
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@289951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-02 08:56:08 +00:00
Terry Wilson
3a3c44251a Make AMI honor enabled=no
(closes issue #18040)
Reported by: twilson

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@288572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-23 18:05:16 +00:00
Olle Johansson
9f3a7a348c Merged revisions 287470 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r287470 | oej | 2010-09-19 18:06:10 +0200 (Sön, 19 Sep 2010) | 14 lines
  
  Merged revisions 287469 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r287469 | oej | 2010-09-19 17:56:50 +0200 (Sön, 19 Sep 2010) | 7 lines
    
    Make sure we always free variables properly in manager originate.
    
    (closes issue #17891)
    reported, solved and tested by oej
    
    Review: https://reviewboard.asterisk.org/r/869/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-19 16:09:28 +00:00
Brett Bryant
781978c65e Merged revisions 284778 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r284778 | bbryant | 2010-09-02 16:54:33 -0400 (Thu, 02 Sep 2010) | 14 lines
  
  Merged revisions 284777 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r284777 | bbryant | 2010-09-02 16:25:03 -0400 (Thu, 02 Sep 2010) | 7 lines
    
    Fixes a bug in manager.c where the default configuration values weren't reset when the manager configuration was reloaded.
    
    (closes issue #17917)
    Reported by: lmadsen
    
    Review: https://reviewboard.asterisk.org/r/883/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@284781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02 21:04:51 +00:00
Russell Bryant
8629c83f71 Be more flexible with whitespace on AMI action headers.
Previously, this code required exactly one space to be after the ':' in headers
for an AMI action.  This now makes whitespace optional, and allows whitespace that
is there to vary in amount.

(closes issue #17862)
Reported by: cmoye
Patches:
      manager.c.patch_trunk uploaded by cmoye (license 858)
      manager.c.patch_1.8 uploaded by cmoye (license 858)
Tested by: cmoye


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@284065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-28 21:29:45 +00:00
Paul Belanger
16921385e3 Default sin_family to AF_INET for TCP / TLS Bindaddress.
Otherwise, 'manager show settings' will generate errors
if manager is not enabled.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@279273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-24 17:36:42 +00:00
Tilghman Lesher
d09cf65ff8 Merged revisions 278023 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r278023 | tilghman | 2010-07-20 11:37:18 -0500 (Tue, 20 Jul 2010) | 7 lines
  
  Off-by-one error
  
  (closes issue #16506)
   Reported by: nik600
   Patches: 
         20100629__issue16506.diff.txt uploaded by tilghman (license 14)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 16:50:11 +00:00
Mark Michelson
6fa79e8f77 Make ACLs IPv6-capable.
ACLs can now be configured to match IPv6 networks. This is only
relevant for ACLs in chan_sip for now since other channel drivers
do not support IPv6 addressing. However, once those channel drivers
are outfitted to support IPv6 addressing, the ACLs will already be
ready for IPv6 support.

https://reviewboard.asterisk.org/r/791



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277814 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-19 14:17:16 +00:00
Tilghman Lesher
d72336e83f Merged revisions 277261 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r277261 | tilghman | 2010-07-16 13:04:11 -0500 (Fri, 16 Jul 2010) | 5 lines
  
  If variable gotten is not set, will segfault on Solaris.
  
  (closes issue #17636)
   Reported by: bklang
........


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

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

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

The new organization adds some new information as well.

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

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

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

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

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


The following items of note were either corrected or enhanced:

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

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

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

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

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

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

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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 15:48:36 +00:00
Mark Michelson
cd4ebd336f Add IPv6 to Asterisk.
This adds a generic API for accommodating IPv6 and IPv4 addresses
within Asterisk. While many files have been updated to make use of the
API, chan_sip and the RTP code are the files which actually support
IPv6 addresses at the time of this commit. The way has been paved for
easier upgrading for other files in the near future, though.

Big thanks go to Simon Perrault, Marc Blanchet, and Jean-Philippe Dionne
for their hard work on this.

(closes issue #17565)
Reported by: russell
Patches: 
      asteriskv6-test-report.pdf uploaded by russell (license 2)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08 22:08:07 +00:00
Matthew Nicholson
a1a08a7338 Fixed whitespace problems
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-01 14:37:37 +00:00
Matthew Nicholson
269989c50f Altered my comment about TCP_NODELAY
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-01 14:34:31 +00:00
Matthew Nicholson
2dc3b3a8c2 Set TCP_NODELAY on manager TCP sockets to prevent delays on outgoing packets. This regression was introduced in r48338.
AST-359


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-30 18:48:21 +00:00
Tilghman Lesher
aed189605b Permission checking for the system application is backwards.
(closes issue #17550)
 Reported by: kenner
 Patches: 
       manager.c.diff uploaded by kenner (license 1040)
 Tested by: kenner


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-30 01:07:02 +00:00
Paul Belanger
c9a0c500ae Correct manager variable 'EventList' case.
(closes issue #17520)
Reported by: kobaz
Patches:
      manager.patch uploaded by kobaz (license 834)
Tested by: lmadsen


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272252 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-23 20:35:45 +00:00
David Vossel
3a875d8524 minor fixes for white/black event filters
This fixes a ref count leak in event filters and checks for
a filter container allocation failure during session creation.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@271905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-22 17:57:28 +00:00
Jeff Peeler
42c24b585a Add regular expression filtering for manager events.
This patch as documented in the sample config allows one to optionally apply
white, black, or both types of filtering to manager events. The new
'eventfilter' option is set per user.

(closes issue #14861)
Reported by: fnordian
Patches: 
      eventfilter3.patch uploaded by fnordian (license 110),
      modified by me

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@271868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-22 16:29:18 +00:00
Tilghman Lesher
de625d9c08 Event well was going dry.
(issue #17234)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-07 18:59:27 +00:00
Tilghman Lesher
0807833f8d Verify event is not NULL before attempting to lower its usecount.
(closes issue #17234)
 Reported by: mav3rick


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

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

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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 18:10:15 +00:00
Richard Mudgett
28264c52b9 Add ETSI Advice Of Charge (AOC) event reporting.
This feature generates AMI events in the new aoc event class from the
events passed up by libpri.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 17:13:53 +00:00