Commit Graph

572 Commits

Author SHA1 Message Date
Richard Mudgett
f2e1640435 Fix deadlock when using dummy channels.
Dummy channels created by ast_dummy_channel_alloc() should be destoyed by
ast_channel_unref().  Using ast_channel_release() needlessly grabs the
channel container lock and can cause a deadlock as a result.

* Analyzed use of ast_dummy_channel_alloc() and made use
ast_channel_unref() when done with the dummy channel.  (Primary reason for
the reported deadlock.)

* Made app_dial.c:dial_exec_full() not call ast_call() holding any channel
locks.  Chan_local could not perform deadlock avoidance correctly.
(Potential deadlock exposed by this issue.  Secondary reason for the
reported deadlock since the held lock was part of the deadlock chain.)

* Fixed some uses of ast_dummy_channel_alloc() not checking the returned
channel pointer for failure.

* Fixed some potential chan=NULL pointer usage in func_odbc.c.  Protected
by testing the bogus_chan value.

* Fixed needlessly clearing a 1024 char auto array when setting the first
char to zero is enough in manager.c:action_getvar().

(closes issue ASTERISK-18613)
Reported by: Thomas Arimont
Patches:
      jira_asterisk_18613_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: Thomas Arimont


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@337973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-26 19:30:39 +00:00
Tilghman Lesher
6c5fd2bc6b Escape commas in keys and values, when keys and values are enumerated by commas.
Review: https://reviewboard.asterisk.org/r/1433


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@337325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-21 16:05:14 +00:00
Terry Wilson
928de8c08a Whitespace fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 22:10:56 +00:00
Terry Wilson
19992c7246 Add missing frame types to func_frame_trace
Also casts control frames to the proper enum so that the compile will catch
new additions.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 22:04:25 +00:00
Matthew Jordan
7dc49195d8 Updated SIP 484 handling; added Incomplete control frame
When a SIP phone uses the dial application and receives a 484 Address 
Incomplete response, if overlapped dialing is enabled for SIP, then
the 484 Address Incomplete is forwarded back to the SIP phone and the
HANGUPCAUSE channel variable is set to 28.  Previously, the Incomplete
application dialplan logic was automatically triggered; now, explicit
dialplan usage of the application is required.

Additionally, this patch adds a new AST_CONTOL_FRAME type called
AST_CONTROL_INCOMPLETE.  If a channel driver receives this control frame,
it is an indication that the dialplan expects more digits back from the
device.  If the device supports overlap dialing it should attempt to 
notify the device that the dialplan is waiting for more digits; otherwise,
it can handle the frame in a manner appropriate to the channel driver.

(closes issue ASTERISK-17288)
Reported by: Mikael Carlsson
Tested by: Matthew Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09 16:09:09 +00:00
Richard Mudgett
c00ab8a6ed Segfault in shell_helper in func_shell.c.
The return value of popen() was not checked for failure to open.

(closes issue ASTERISK-18109)
JIRA SWP-3633
Reported by: Michael Myles
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@331575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-11 21:39:58 +00:00
Tilghman Lesher
b0b45db756 Typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@328540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-18 07:10:15 +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
Tilghman Lesher
9a3fd9a994 Removing type attributes, as a change to menuselect makes them no longer necessary.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@326469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-06 14:35:01 +00:00
Tilghman Lesher
d104b4e701 Add the attribute "type" to each "<use>" for menuselect.
This matters only when autoconf fails to detect that weak linking is supported.
External optional dependencies will become optional in both cases, as they are
removed at compile time when not detected.  However, runtime-optional modules
are made mandatory when weak linking is not found.  This change affects only
the external optional dependencies; previously, they were incorrectly required
when weak linking support was not detected.

Patches:
	20110702__issue18062__asterisk_trunk.diff.txt by tilghman (License #5003)

Tested by: iasgoscouk


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@326411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-05 22:08:29 +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
Tilghman Lesher
082850f4c9 Merged revisions 316093 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r316093 | tilghman | 2011-05-02 14:04:36 -0500 (Mon, 02 May 2011) | 8 lines
  
  More possible crashes based upon invalid inputs.
  
  (closes issue #18161)
   Reported by: wdoekes
   Patches: 
         20110301__issue18161.diff.txt uploaded by tilghman (license 14)
   Tested by: wdoekes
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-02 19:09:55 +00:00
Leif Madsen
328e93edd0 Merged revisions 314205 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r314205 | lmadsen | 2011-04-19 09:27:50 -0500 (Tue, 19 Apr 2011) | 6 lines
  
  Remove duplicate documentation from func_channel.c
  
  (closes issue #18970)
  Reported by: IgorG
  Patches: 
        func_channel.c.doc.diff uploaded by IgorG (license 20)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@314206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-19 14:28:15 +00:00
Jonathan Rose
7ea558865a Merged revisions 310585 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r310585 | jrose | 2011-03-14 08:56:22 -0500 (Mon, 14 Mar 2011) | 8 lines
  
  Adds 'p' as an option to func_volume.  When it is on, the old behavior with DTMF controlling volume adjustment will be enforced.
  When it is off, DTMF will not be processed by the function.
  
  Programmed by Jonathan Rose
  Reviewed by David Vossel, Leif Madsen, and Russell Bryant
  
  http://reviewboard.digium.internal/r/93/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@310587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-14 15:27:57 +00:00
Tilghman Lesher
782d757faf Merged revisions 310414 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r310414 | tilghman | 2011-03-12 13:51:23 -0600 (Sat, 12 Mar 2011) | 7 lines
  
  Transactional handles should be used for the insertbuf, if available.
  
  Also, fix a possible resource leak.
  
  (closes issue #18943)
   Reported by: irroot
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@310415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-12 20:05:46 +00:00
Tilghman Lesher
15641c348e Merged revisions 310141 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r310141 | tilghman | 2011-03-09 23:51:37 -0600 (Wed, 09 Mar 2011) | 12 lines
  
  Merged revisions 310140 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r310140 | tilghman | 2011-03-09 23:38:44 -0600 (Wed, 09 Mar 2011) | 5 lines
    
    Initialize column size to 0 to deal with a potential UnixODBC bug on 64-bit systems.
    
    (closes issue #18295)
     Reported by: pruiz
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@310142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-10 05:53:29 +00:00
Richard Mudgett
5b9f9f78ca Get real channel of a DAHDI call.
Starting with Asterisk v1.8, the DAHDI channel name format was changed for
ISDN calls to: DAHDI/i<span>/<number>[:<subaddress>]-<sequence-number>

There were several reasons that the channel name had to change.

1) Call completion requires a device state for ISDN phones.  The generic
device state uses the channel name.

2) Calls do not necessarily have B channels.  Calls placed on hold by an
ISDN phone do not have B channels.

3) The B channel a call initially requests may not be the B channel the
call ultimately uses.  Changes to the internal implementation of the
Asterisk master channel list caused deadlock problems for chan_dahdi if it
needed to change the channel name.  Chan_dahdi no longer changes the
channel name.

4) DTMF attended transfers now work with ISDN phones because the channel
name is "dialable" like the chan_sip channel names.

For various reasons, some people need to know which B channel a DAHDI call
is using.

* Added CHANNEL(dahdi_span), CHANNEL(dahdi_channel), and
CHANNEL(dahdi_type) so the dialplan can determine the B channel currently
in use by the channel.  Use CHANNEL(no_media_path) to determine if the
channel even has a B channel.

* Added AMI event DAHDIChannel to associate a DAHDI channel with an
Asterisk channel so AMI applications can passively determine the B channel
currently in use.  Calls with "no-media" as the DAHDIChannel do not have
an associated B channel.  No-media calls are either on hold or
call-waiting.

(closes issue #17683)
Reported by: mrwho
Tested by: rmudgett

(closes issue #18603)
Reported by: arjankroon
Patches:
      issue17683_18603_v1.8_v2.patch uploaded by rmudgett (license 664)
Tested by: stever28, rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@309445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-04 15:22:04 +00:00
Richard Mudgett
5413ea1c8c Document CHANNEL(keypad_digits) and CHANNEL(no_media_path).
* Added XML documentation for CHANNEL(keypad_digits) and
CHANNEL(no_media_path).

* Tweaked XML documentation for CHANNEL(reversecharge).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@309170 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-01 21:57:26 +00:00
Tilghman Lesher
f14ba8fa19 Merged revisions 308990 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r308990 | tilghman | 2011-02-28 03:32:22 -0600 (Mon, 28 Feb 2011) | 7 lines
  
  Statements updating zero rows may return SQL_NO_DATA.  This is fine; it's handled.
  
  (closes issue #18815)
   Reported by: irroot
   Patches: 
         func_odbc.insert_nodata.patch uploaded by irroot (license 52)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@308991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-28 09:33:22 +00:00
Tilghman Lesher
bff7dd69e0 Merged revisions 307836 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r307836 | tilghman | 2011-02-15 01:01:37 -0600 (Tue, 15 Feb 2011) | 8 lines
  
  Need to retrieve the rows affected before using the associated variable.
  
  (closes issue #18795)
   Reported by: irroot
   Patches: 
         20110211__issue18795.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@307837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-15 07:02:45 +00:00
Tilghman Lesher
70edcdef43 Eliminate a file descriptor leak when using the FILE() dialplan function.
(closes issue #18731)
Reported by: marioabajo


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@305844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-02 20:05:43 +00:00
Andrew Latham
69e83f1a72 Replacing doc/* and asterisk.pdf with wiki links
Adding links to http(s)://wiki.asterisk.org



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@305838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-02 19:27:19 +00:00
Andrew Latham
b7d7fc94c2 Add Function and Application Relationships to documentation
Add and extend the see-also sections to the documentation for applications
and functions in an effort to expand the online documentation of the wiki.
Also check for and update any links to moved documentation in the doc folder.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@304908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-30 00:11:56 +00:00
Andrew Latham
6c43f3925b Add relationships to function documentation.
Fix amatuer type mistake 


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@301849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-14 20:05:08 +00:00
Andrew Latham
1490caf3f0 Add relationships to function documentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@301844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-14 19:35:20 +00:00
Tilghman Lesher
66f8326ee1 Merged revisions 298477 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r298477 | tilghman | 2010-12-16 02:54:23 -0600 (Thu, 16 Dec 2010) | 8 lines
  
  Eliminate duplicates from container.
  
  (closes issue #18091)
   Reported by: bunny
   Patches: 
         20101006__issue18091.diff.txt uploaded by tilghman (license 14)
   Tested by: bunny
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@298478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-16 08:56:13 +00:00
Tilghman Lesher
ab199924ac Merged revisions 294988 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r294988 | tilghman | 2010-11-15 01:42:39 -0600 (Mon, 15 Nov 2010) | 8 lines
  
  It is possible to crash Asterisk by feeding the curl engine invalid data.
  
  (closes issue #18161)
   Reported by: wdoekes
   Patches: 
         20101029__issue18161.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-15 07:44:38 +00:00
Jeff Peeler
971db9fc4e Merged revisions 293158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r293158 | jpeeler | 2010-10-28 11:09:40 -0500 (Thu, 28 Oct 2010) | 11 lines
  
  Fix infinite loop in FILTER(). 
  
  Specifically when you're using characters above \x7f or invalid character
  escapes (e.g. \xgg).
  
  (closes issue #18060)
  Reported by: wdoekes
  Patches: 
        issue18060_func_strings_filter_infinite_loop.patch uploaded by wdoekes (license 717)
  Tested by: wdoekes
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-28 16:11:08 +00:00
Tilghman Lesher
32d3205f0e Solaris fixes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@289581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-30 20:23:10 +00:00
Tilghman Lesher
92badf5e9b Merged revisions 288712 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r288712 | tilghman | 2010-09-24 08:53:30 -0500 (Fri, 24 Sep 2010) | 5 lines
  
  Solaris won't printf a NULL.
  
  (closes issue #18041)
   Reported by: asgaroth
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@288713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-24 13:54:17 +00:00
David Vossel
ecabd15422 Addition of the FrameHook API (AKA AwesomeHooks)
So far all our tools for viewing and manipulating media streams
within Asterisk have been entirely focused on audio.  That made
sense then, but is not scalable now.  The FrameHook API lets us
tap into and manipulate _ANY_ type of media or signaling passed
on a channel present today or in the future.  This tool is a step
in the direction of expanding Asterisk's boundaries and will help
generate some rather interesting applications in the future.

In addition to the FrameHook API, a simple dialplan function
exercising the api has been included as well.  This function
is called FRAME_TRACE().  FRAME_TRACE() allows for the internal
ast_frames read and written to a channel to be output.  Filters
can be placed on this function to debug only certain types of frames.
This function could be thought of as an internal way of doing
ast_frame packet captures.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-20 22:09:16 +00:00
Terry Wilson
e72b55f3cf Merged revisions 286115 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r286115 | twilson | 2010-09-10 15:35:25 -0500 (Fri, 10 Sep 2010) | 23 lines
  
  Merged revisions 286059 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r286059 | twilson | 2010-09-10 14:25:08 -0500 (Fri, 10 Sep 2010) | 16 lines
    
    Inherit CHANNEL() writes to both sides of a Local channel
    
    Having Local (/n) channels as queue members and setting the language in the
    extension with Set(CHANNEL(language)=fr) sets the language on the Local/...,2
    channel. Hold time report playbacks happen on the Local/...,1 channel and
    therefor do not play in the specified language.
    
    This patch modifies func_channel_write to call the setoption callback and pass
    the CHANNEL() write info to the callback. chan_local uses this information to
    look up the other side of the channel and apply the same changes to it.
    
    (closes issue #17673)
    Reported by: Guggemand
    
    Review: https://reviewboard.asterisk.org/r/903/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@286189 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-10 22:04:53 +00:00
Tilghman Lesher
4be40d5cab Documentation only
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@285484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-08 07:14:17 +00:00
Tilghman Lesher
dbe6dde6da Add CHANNEL(checkhangup) to check whether a channel is in the process of being hanged up.
(closes issue #17652)
 Reported by: kobaz
 Patches: 
       func_channel.patch uploaded by kobaz (license 834)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@285373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-07 21:14:03 +00:00
Tilghman Lesher
7e3f95e00a When optional_api is non-optional, force dependent modules to be loaded.
(closes issue #17707)
 Reported by: ira
 Patches: 
       20100819__issue17707__asterisk1.8.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman
 
Review: https://reviewboard.asterisk.org/r/876/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@284610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02 05:20:59 +00:00
Russell Bryant
9d1909c9b4 Don't attempt to release a NULL ODBC handle.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@283350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-24 12:49:41 +00:00
Tilghman Lesher
a5b7f2ce04 Sneak FIELDNUM() into 1.8. Returns a 1-based index into a list of a specified item.
Matches up with FIELDQTY() and CUT().

(closes issue #17713)
 Reported by: gareth
 Patches: 
       svn-279754.diff uploaded by gareth (license 208)
 Tested by: gareth, tilghman

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@280809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-03 20:25:10 +00:00
Terry Wilson
d6e1c724e5 Remove built-in AES code and use optional_api instead
Review: https://reviewboard.asterisk.org/r/793/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-21 19:11:32 +00:00
Tilghman Lesher
b4e18d5660 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 19:35:02 +00:00
Richard Mudgett
cf7bbcc4c6 Expand the caller ANI field to an ast_party_id
Expand the ani field in ast_party_caller and ast_party_connected_line to
an ast_party_id.

This is an extension to the ast_callerid restructuring patch in review:
https://reviewboard.asterisk.org/r/702/

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 16:58:03 +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
Tilghman Lesher
0ae9097e3e Oops, XML documentation fix.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-13 19:05:17 +00:00
Tilghman Lesher
fc9efc4ff5 It really cannot fail in the places below, but the stupid compiler doesn't know that.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-13 19:00:02 +00:00
Tilghman Lesher
e939dfea9d Weird compiler error on Bamboo.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-13 18:41:59 +00:00
Tilghman Lesher
50d5f134c8 FILE() now supports line-mode and writing (altering) files.
(closes issue #16461)
 Reported by: skyman
 Patches: 
       20100622__issue16461.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman
 
Review: https://reviewboard.asterisk.org/r/737/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-13 18:31:41 +00:00
Tilghman Lesher
da8450323f Kill some startup warnings and errors and make some messages more helpful in tracking down the source.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 17:00:22 +00:00
Bradley Latus
4405813297 Add High Resolution Times to CDRs for Asterisk
People expressed an interest in having access to the exact length of calls to a finer degree than seconds. See the CHANGES and UPGRADE.txt for usage also updated the sample configs to note the change.

Patch by snuffy.

(closes issue #16559)
Reported by: cianmaher
Tested by: cianmaher, snuffy

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08 23:48:17 +00:00
Terry Wilson
857814f435 Add SRTP support for Asterisk
After 5 years in mantis and over a year on reviewboard, SRTP support is finally
being comitted. This includes generic CHANNEL dialplan functions that work for
getting the status of whether a call has secure media or signaling as defined
by the underlying channel technology and for setting whether or not a new
channel being bridged to a calling channel should have secure signaling or
media. See doc/tex/secure-calls.tex for examples.

Original patch by mikma, updated for trunk and revised by me.

(closes issue #5413)
Reported by: mikma
Tested by: twilson, notthematrix, hemanshurpatel

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08 05:29:08 +00:00
Tilghman Lesher
da0138932e Handle OOM errors more gracefully.
(closes issue #17084)
 Reported by: falves11
 Patches: 
       issue17084_162_A.diff uploaded by falves11 (license 374)
 Tested by: falves11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-03 19:46:42 +00:00
Tilghman Lesher
4eaea01cad Needs to be wrapped in <para>
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-30 20:18:03 +00:00