dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

17 Commits

Author SHA1 Message Date
mnicholson bdb6e57e72 use printf instead of echo -n in substitution test
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327684 f38db490-d61c-443f-a65b-d21fe96a405b
2011-07-11 20:06:28 +00:00
mnicholson 959deafb08 Merged revisions 327512 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r327512 | mnicholson | 2011-07-11 08:53:59 -0500 (Mon, 11 Jul 2011) | 2 lines
  
  reset our buffer each iteration when doing variable substitution
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327513 f38db490-d61c-443f-a65b-d21fe96a405b
2011-07-11 13:55:28 +00:00
mnicholson 66a5c9a88c Merged revisions 327106 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r327106 | mnicholson | 2011-07-08 14:52:51 -0500 (Fri, 08 Jul 2011) | 11 lines
  
  Reset our ast_str before passing it on to dialplan function backends.
  
  It is possible for a dialplan backend to not modify the given buffer or ast_str
  and still return success. This causes any previous value stored in the buffer
  to be used as if the new function call provided it. Some functions also append
  to the given buffer assuming it is empty.
  
  The test_substitution unit test has also been modified to detect this problem.
  
  (closes issue ASTERISK-17878)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327107 f38db490-d61c-443f-a65b-d21fe96a405b
2011-07-08 19:54:23 +00:00
rmudgett ad58aa92a2 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: http://svn.digium.com/svn/asterisk/trunk@276347 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14 15:48:36 +00:00
tilghman cc07f75cb0 Kill some startup warnings and errors and make some messages more helpful in tracking down the source.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@275105 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09 17:00:22 +00:00
russell 3af10453ac test_substitution expects func_curl to be present to work.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256783 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-12 02:19:02 +00:00
tilghman d07d6eea8b It's amazing what writing a test will find.
(issue #16900)
 Reported by: bluecrow76


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@251677 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-10 20:30:34 +00:00
russell d8d63de328 Various updates to the unit test API.
1) It occurred to me that the difference in usage between the error ast_str and
the ast_test_update_status() usage has turned out to be a bit ambiguous in
practice.  In a lot of cases, the same message was being sent to both.
In other cases, it was only sent to one or the other.  My opinion now is that
in every case, I think it makes sense to do both; we should output it to the
CLI as well as save it off for logging purposes.

This change results in most of the changes in this diff, since it required
changes to all existing unit tests.  It also allowed for some simplifications
of unit test API implementation code.

2) Update ast_test_status_update() to include the file, function, and line
number for the code providing the update.

3) There are some formatting tweaks here and there.  Hopefully they aren't too
distracting for code review purposes.  Reviewboard's diff viewer seems to do a
pretty good job of pointing out when something is a whitespace change.

4) I moved the md5_test and sha1_test into the test_utils module.  It seemed
like a better approach since these tests are so tiny.

5) I changed the number of nodes used in heap_test_2 from 1 million to
100 thousand.  The only reason for this was to reduce the time it took
for this test to run.

6) Remove an unused function prototype that was at the bottom of utils.h.

7) Simplify test_insert() using the LIST_INSERT_SORTALPHA() macro.  The one
minor difference in behavior is that it no longer checks for a test registered
with the same name.

8) Expand the code in test_alloc() to provide specific error messages for each
failure case, to clearly inform developers if they forget to set the name,
summary, description, etc.

9) Tweak the output of the "test show registered" CLI command.  I swapped the
name and category to have the category first.  It seemed more natural since
that is the sort key.

10) Don't output the status ast_str in the "test show results" CLI command.
This is going to tend to be pretty verbose, so just leave that for the
detailed test logs (test generate results).

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@245864 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-09 23:32:14 +00:00
russell 7f9286a9d2 Log the variable name being tested.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243158 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-26 15:46:53 +00:00
russell 3cd7f1195a Update test_substitution to show failures in the test log.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243157 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-26 15:35:40 +00:00
tilghman b5bbff260e Fixing last errors in the conversion, though it appears that the AES_* functions are still broken.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243077 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-26 01:56:24 +00:00
tilghman c13a9d3f08 Using a dummy channel causes CDR() testing to fail.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243076 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-26 01:41:47 +00:00
tilghman 4287cfb917 Wish I had gotten to the review before this got submitted, because there's failures we need to address.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243075 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-26 01:35:19 +00:00
russell b4c7d7f709 Make unit test modules depend on TEST_FRAMEWORK instead of off by default.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242965 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-25 21:32:38 +00:00
russell 41579a3b9c Convert test_substitution module to the unit test API.
Review: https://reviewboard.asterisk.org/r/474/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242954 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-25 21:25:23 +00:00
russell ac3b35dcc7 Merge the new Channel Event Logging (CEL) subsystem.
CEL is the new system for logging channel events.  This was inspired after
facing many problems trying to represent what is possible to happen to a call
in Asterisk using CDR records.  For more information on CEL, see the built in
HTML or PDF documentation generated from the files in doc/tex/.

Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard
work developing this code.  Also, thanks to Matt Nicholson (mnicholson) and
Sean Bright (seanbright) for their assistance in the final push to get this
code ready for Asterisk trunk.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203638 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 15:28:53 +00:00
tilghman 8fc2c0f724 Merge str_substitution branch.
This branch adds additional methods to dialplan functions, whereby the result
buffers are now dynamic buffers, which can be expanded to the size of any
result.  No longer are variable substitutions limited to 4095 bytes of data.
In addition, the common case of needing buffers much smaller than that will
enable substitution to only take up the amount of memory actually needed.
The existing variable substitution routines are still available, but users
of those API calls should transition to using the dynamic-buffer APIs.
Reviewboard: http://reviewboard.digium.com/r/174/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191140 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29 18:53:01 +00:00