asterisk/main
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
..
db1-ast Merged revisions 209879 via svnmerge from 2009-08-01 11:29:25 +00:00
editline Add gar to the check for AR for those silly OSes (Solaris) that don't have ar. 2010-04-27 21:13:01 +00:00
stdtime Support setting locale per-mailbox (changes date/time languages for email, pager messages). 2010-06-01 21:28:19 +00:00
Makefile Ensure the -Wno-strict-aliasing flag makes it, even if ASTCFLAGS has been specified. 2010-06-02 21:41:54 +00:00
abstract_jb.c Fix jitterbuffer logging not creating logfiles. 2010-03-10 18:25:18 +00:00
acl.c Add IPv6 to Asterisk. 2010-07-08 22:08:07 +00:00
adsistub.c remove a bunch of useless #include "options.h" 2007-11-21 23:09:02 +00:00
aescrypt.c Spacing changes only 2009-03-04 20:48:42 +00:00
aeskey.c use the OpenSSL AES implementation if it's available (unless configured not to) 2007-05-24 22:07:50 +00:00
aesopt.h merge new_loader_completion branch, including (at least): 2006-08-21 02:11:39 +00:00
aestab.c use the OpenSSL AES implementation if it's available (unless configured not to) 2007-05-24 22:07:50 +00:00
alaw.c Fix compile when certain G711 menuselect options are enabled. 2009-08-19 22:38:46 +00:00
aoc.c Generic Advice of Charge. 2010-06-02 18:10:15 +00:00
app.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
ast_expr2.c Allow "REMAINDER" to function properly in expressions. 2009-12-28 22:09:40 +00:00
ast_expr2.fl Merged revisions 245496 via svnmerge from 2010-02-08 20:41:05 +00:00
ast_expr2.h Merged revisions 179807 via svnmerge from 2009-03-03 22:12:02 +00:00
ast_expr2.y Merged revisions 267009 via svnmerge from 2010-06-02 17:25:05 +00:00
ast_expr2f.c Fix some doxygen warnings. 2010-06-08 14:38:18 +00:00
asterisk.c Merged revisions 272925 via svnmerge from 2010-06-28 21:50:57 +00:00
asterisk.dynamics Export dynamic (weak-linked) symbols correctly. 2009-11-30 16:53:10 +00:00
asterisk.exports.in Add SRTP support for Asterisk 2010-06-08 05:29:08 +00:00
astfd.c Merged revisions 228338 via svnmerge from 2009-11-06 15:42:46 +00:00
astmm.c Two more minor fixes due to constification 2009-05-22 16:53:41 +00:00
astobj2.c Improve some very confusing structure names in astobj2.c 2010-05-16 11:14:37 +00:00
audiohook.c Fix some doxygen warnings. 2010-06-08 14:38:18 +00:00
autochan.c Convert the ast_channel data structure over to the astobj2 framework. 2009-04-24 14:04:26 +00:00
autoservice.c Merged revisions 273717 via svnmerge from 2010-07-02 17:10:59 +00:00
bridging.c pthread_join to assure the thread is really gone 2010-06-02 13:32:22 +00:00
buildinfo.c fix a few small things found by using sparse 2008-10-30 16:49:02 +00:00
callerid.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
ccss.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
cdr.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
cel.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
channel.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
chanvars.c Add additional memory debugging to several core APIs, and fix several memory 2008-10-14 22:38:06 +00:00
cli.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
config.c Add IPv6 to Asterisk. 2010-07-08 22:08:07 +00:00
cryptostub.c Don't include logger.h in asterisk.h by default as it is causing problems building 2008-10-10 00:42:13 +00:00
cygload.c Doxygen updates, formatting. 2007-12-11 22:20:22 +00:00
data.c Kill some startup warnings and errors and make some messages more helpful in tracking down the source. 2010-07-09 17:00:22 +00:00
datastore.c Merged revisions 273565 via svnmerge from 2010-07-01 22:16:23 +00:00
db.c Add DBGetComplete event after a DBGetResponse. 2010-06-11 18:17:28 +00:00
devicestate.c Merged revisions 263639 via svnmerge from 2010-05-17 22:08:01 +00:00
dial.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
dns.c Fix a few compilation problems found when building Asterisk against uClibc. 2009-07-08 16:43:12 +00:00
dnsmgr.c Add IPv6 to Asterisk. 2010-07-08 22:08:07 +00:00
dsp.c Set threshold for silence detection defaults to 256 2010-06-07 17:34:45 +00:00
ecdisa.h merge new_loader_completion branch, including (at least): 2006-08-21 02:11:39 +00:00
enum.c Extend max call limit duration from 24.8 days to 292+ million years. 2010-01-18 22:31:25 +00:00
event.c Resolve an invalid memory read on an event. 2010-06-09 21:11:43 +00:00
features.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
file.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
fixedjitterbuf.c Fix various typos reported by Lintian 2010-07-02 15:57:02 +00:00
fixedjitterbuf.h Merged revisions 135841,135847,135850 via svnmerge from 2008-08-06 00:30:53 +00:00
frame.c adds speex 16khz audio support 2010-06-17 17:23:43 +00:00
fskmodem.c (Step 2 of 2) 2008-07-21 21:00:47 +00:00
fskmodem_float.c Optionally build integer-based routines for FSK tone decoding (but default 2008-07-21 20:59:03 +00:00
fskmodem_int.c Optionally build integer-based routines for FSK tone decoding (but default 2008-07-21 20:59:03 +00:00
global_datastores.c Add SRTP support for Asterisk 2010-06-08 05:29:08 +00:00
hashtab.c Add MALLOC_DEBUG to various utility APIs, so that memory leaks can be tracked back to their source. 2009-03-11 00:29:59 +00:00
heap.c Fix handling of removing nodes from the middle of a heap. 2010-05-06 13:58:07 +00:00
http.c Add IPv6 to Asterisk. 2010-07-08 22:08:07 +00:00
image.c More 'static' qualifiers on module global variables. 2009-06-15 17:34:30 +00:00
indications.c Implement AstData API data providers as part of the GSOC 2010 project, 2010-07-08 14:48:42 +00:00
io.c Merged revisions 182810 via svnmerge from 2009-03-18 02:28:55 +00:00
jitterbuf.c Merged revisions 174583 via svnmerge from 2009-02-10 18:16:31 +00:00
loader.c Merged revisions 275182 via svnmerge from 2010-07-09 18:24:03 +00:00
lock.c Attempt to fix FreeBSD build problem. 2010-06-09 23:56:08 +00:00
logger.c Remove lines from the output related to the backtrace itself. 2010-06-11 18:04:54 +00:00
manager.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
md5.c Start untangling header inclusion in a way that does not affect 2007-11-16 20:04:58 +00:00
netsock.c fixes an ast_netsock_list memory leak. 2009-10-08 19:35:30 +00:00
netsock2.c Allow netsock2.c to compile on systems that do not define AI_NUMERICSERV. 2010-07-12 14:55:23 +00:00
pbx.c ast_callerid restructuring 2010-07-14 15:48:36 +00:00
plc.c Start untangling header inclusion in a way that does not affect 2007-11-16 20:04:58 +00:00
poll.c MAX() moved to utils.h 2010-01-13 10:45:19 +00:00
privacy.c remove a bunch of useless #include "options.h" 2007-11-21 23:09:02 +00:00
rtp_engine.c Add IPv6 to Asterisk. 2010-07-08 22:08:07 +00:00
say.c Fix various typos reported by Lintian 2010-07-02 15:57:02 +00:00
sched.c Initialize counters in ast_sched_report so that resulting data is not bogus. 2010-02-03 19:26:53 +00:00
security_events.c Add an API for reporting security events, and a security event logging module. 2009-07-11 19:15:03 +00:00
sha1.c more header removal/normalization 2007-11-21 00:23:49 +00:00
slinfactory.c Expand codec bitfield from 32 bits to 64 bits. 2009-11-04 14:05:12 +00:00
srv.c func_srv and explicit specification of a remote IP for SIP. 2010-04-09 14:37:50 +00:00
ssl.c pthread_self returns a pthread_t which is not an unsigned int on all 2009-07-09 08:31:24 +00:00
strcompat.c Don't allow file descriptors to go above 64k, when we're closing them in a fork(2). 2010-04-30 06:19:35 +00:00
strings.c fixes segfault on logging 2010-05-18 22:48:51 +00:00
stun.c This commit introduces COLP/CONP and Redirecting party information into Asterisk. 2009-04-03 22:41:46 +00:00
syslog.c Add functions to map syslog facilities and priorities constants to strings. 2009-06-26 13:00:35 +00:00
taskprocessor.c Minor tweaks to comment blocks and includes. 2010-02-22 06:45:52 +00:00
tcptls.c Add IPv6 to Asterisk. 2010-07-08 22:08:07 +00:00
tdd.c Merge changes from str_substitution that are unrelated to that branch. 2009-04-01 20:13:28 +00:00
term.c Merged revisions 269334 via svnmerge from 2010-06-09 17:32:52 +00:00
test.c Kill some startup warnings and errors and make some messages more helpful in tracking down the source. 2010-07-09 17:00:22 +00:00
threadstorage.c Fixed an issue in the threadstorage cli functions resulting from the constification of struct ast_cli_args in r196072. 2009-06-01 15:23:21 +00:00
timing.c Extend max call limit duration from 24.8 days to 292+ million years. 2010-01-18 22:31:25 +00:00
translate.c Remove unnecessary code relating to PLC. 2010-06-03 17:09:11 +00:00
udptl.c fixes infinite loop during udptl.c's decode_open_type 2010-05-19 20:30:33 +00:00
ulaw.c Fix compile when certain G711 menuselect options are enabled. 2009-08-19 22:38:46 +00:00
utils.c Fix various typos reported by Lintian 2010-07-02 15:57:02 +00:00
xml.c Asterisk data retrieval API. 2010-04-22 18:07:02 +00:00
xmldoc.c Fix various typos reported by Lintian 2010-07-02 15:57:02 +00:00