dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

32 Commits

Author SHA1 Message Date
rmudgett d93fa33a75 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: http://svn.digium.com/svn/asterisk/trunk@276393 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14 16:58:03 +00:00
rmudgett 8202df7633 Make compile again.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276391 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14 16:39:18 +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
rmudgett f42e29b281 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229
ABE-2161

* Ensure chan_local.c:local_call() will not leak cid.cid_dnid when
copying.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256104 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-03 02:12:33 +00:00
kpfleming 4f428997ca Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.
This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the
case where multiple results need to be returned; OBJ_NODATA mode
already was supported). In addition, it converts ast_channel_iterators
(only the targeted versions, not the ones that iterate over all
channels) to use this method.

During this work, I removed the 'ao2_flags' arguments to the
ast_channel_iterator constructor functions; there were no uses of that
argument yet, there is only one possible flag to pass, and it made the
iterators less 'opaque'. If at some point in the future someone really
needs an ast_channel_iterator that does not lock the container, we can
provide constructor(s) for that purpose.

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225244 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 21:08:47 +00:00
tilghman d1ec1aa57d AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211539 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10 19:20:57 +00:00
russell 89175b7e04 Convert the ast_channel data structure over to the astobj2 framework.
There is a lot that could be said about this, but the patch is a big 
improvement for performance, stability, code maintainability, 
and ease of future code development.

The channel list is no longer an unsorted linked list.  The main container 
for channels is an astobj2 hash table.  All of the code related to searching 
for channels or iterating active channels has been rewritten.  Let n be 
the number of active channels.  Iterating the channel list has gone from 
O(n^2) to O(n).  Searching for a channel by name went from O(n) to O(1).  
Searching for a channel by extension is still O(n), but uses a new method 
for doing so, which is more efficient.

The ast_channel object is now a reference counted object.  The benefits 
here are plentiful.  Some benefits directly related to issues in the 
previous code include:

1) When threads other than the channel thread owning a channel wanted 
   access to a channel, it had to hold the lock on it to ensure that it didn't 
   go away.  This is no longer a requirement.  Holding a reference is 
   sufficient.

2) There are places that now require less dealing with channel locks.

3) There are places where channel locks are held for much shorter periods 
   of time.

4) There are places where dealing with more than one channel at a time becomes 
   _MUCH_ easier.  ChanSpy is a great example of this.  Writing code in the 
   future that deals with multiple channels will be much easier.

Some additional information regarding channel locking and reference count 
handling can be found in channel.h, where a new section has been added that 
discusses some of the rules associated with it.

Mark Michelson also assisted with the development of this patch.  He did the 
conversion of ChanSpy and introduced a new API, ast_autochan, which makes it 
much easier to deal with holding on to a channel pointer for an extended period 
of time and having it get automatically updated if the channel gets masqueraded.
Mark was also a huge help in the code review process.

Thanks to David Vossel for his assistance with this branch, as well.  David 
did the conversion of the DAHDIScan application by making it become a wrapper 
for ChanSpy internally.

The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch.

Review: http://reviewboard.digium.com/r/203/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190423 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-24 14:04:26 +00:00
russell 1f57cd4e51 Merge a large set of updates to the Asterisk indications API.
This patch includes a number of changes to the indications API.  The primary
motivation for this work was to improve stability.  The object management
in this API was significantly flawed, and a number of trivial situations could
cause crashes.

The changes included are:

1) Remove the module res_indications.  This included the critical functionality
   that actually loaded the indications configuration.  I have seen many people
   have Asterisk problems because they accidentally did not have an
   indications.conf present and loaded.  Now, this code is in the core,
   and Asterisk will fail to start without indications configuration.

   There was one part of res_indications, the dialplan applications, which did
   belong in a module, and have been moved to a new module, app_playtones.

2) Object management has been significantly changed.  Tone zones are now
   managed using astobj2, and it is no longer possible to crash Asterisk by
   issuing a reload that destroys tone zones while they are in use.

3) The API documentation has been filled out.

4) The API has been updated to follow our naming conventions.

5) Various bits of code throughout the tree have been updated to account
   for the API update.

6) Configuration parsing has been mostly re-written.

7) "Code cleanup"

The code is from svn/asterisk/team/russell/indications/.

Review: http://reviewboard.digium.com/r/149/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176627 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 20:41:24 +00:00
russell 094443d496 Merged revisions 174148 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r174148 | russell | 2009-02-07 10:15:07 -0600 (Sat, 07 Feb 2009) | 2 lines

Fix a race condition that could cause a crash.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@174149 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-07 16:16:50 +00:00
russell d056b18a40 Merged revisions 168561 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r168561 | russell | 2009-01-13 13:13:05 -0600 (Tue, 13 Jan 2009) | 2 lines

Revert unnecessary indications API change from rev 122314

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168562 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-13 19:22:13 +00:00
seanbright e133c3c22e Use ast_str_strlen() instead of recalculating the string length.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@164054 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-13 18:25:58 +00:00
mvanbaak a27bef90b2 nuke another use of the ast_str internals.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@164028 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-13 13:26:13 +00:00
mvanbaak 65dd912dc1 Make res_snmp.so compile on OpenBSD.
OpenBSD uses an old version of gcc which throws an error
if you use a macro that's not #defined


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@162583 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10 11:34:09 +00:00
mmichelson 5825c7d07d Make res/snmp/agent.c build
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115199 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-02 14:51:59 +00:00
qwell a05d347c35 Merged revisions 105572 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r105572 | qwell | 2008-03-03 12:06:52 -0600 (Mon, 03 Mar 2008) | 7 lines

Fix types for astNumChannels and astConfigCallsProcessed.

(closes issue #12114)
Reported by: jeffg
Patches:
      12114.patch uploaded by jeffg (license 192)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105573 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-03 18:08:05 +00:00
murf c39c4bab13 small change to allow this file to compile. No problem if you don't install the libsnmp package.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104301 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-26 22:14:22 +00:00
russell 16a48590aa Convert this file over the new method of getting the Asterisk version.
(I don't have this building on this machine, so caio1982 on IRC is going to
 test it for me.  :) )


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@96743 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-05 23:05:35 +00:00
rizzo 0a8518b7c8 modify http://svn.digium.com/view/asterisk?view=rev&rev=93603
so that paths and filename are writable by asterisk.c without
causing segfaults.

This involves defining the variables as const char *,
and having them point to as static, writable buffer
defined in asterisk.c

On passing, fix some errors in using these variables
in some files in utils/ , and in res/snmp/agent.c
which was redefining a variable without using paths.h

(not applicable to 1.4)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@94168 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-20 09:55:05 +00:00
rizzo 7c309cc622 make netsmp build under AST_DEVMODE. Description, included in the source,
is below. I should note that the PACKAGE_* macros that asterisk
defines in autoconfig.h are not used anywhere in the tree so
they should just be removed.

 /*
  * There is some collision collision between netsmp and asterisk names,
  * causing build under AST_DEVMODE to fail.
  *
  * The following PACKAGE_* macros are one place.
  * Also netsnmp has an improper check for HAVE_DMALLOC_H, using
  *    #if HAVE_DMALLOC_H   instead of #ifdef HAVE_DMALLOC_H
  * As a countermeasure we define it to 0, however this will fail
  * when the proper check is implemented.
  */

No


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93875 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-19 08:12:33 +00:00
tilghman 35d428bcca Convert ast_verbose to ast_verb.
Reported by: snuffy
Patch by: snuffy
(Closes issue #11547)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92913 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-14 14:48:38 +00:00
qwell 20476ae522 Add count of total number of calls processed by asterisk during it's lifetime.
Add number of total calls and current calls to SNMP.

Closes issue #10057, patch by jcmoore.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91779 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07 16:11:05 +00:00
russell 027ab8b7a4 Fix a typo in the Asterisk MIB and fix astNumChanBridged so it acts as a counter again
(closes issue #10118, patch by jeffg)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80510 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-23 17:27:07 +00:00
tilghman 74c2948c22 Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75706 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-18 19:47:20 +00:00
russell 400adf6bc6 Simplify some logic and convert spaces to tabs
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69068 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-13 16:19:37 +00:00
russell 806622cc37 The variable used for the return value must be declared as static. I broke
this when applying the patch, sorry!
(issue #9637, jeffg)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69067 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-13 16:05:22 +00:00
russell 1370ceac79 Add support for retrieving the number of channels that are currently bridged
via SNMP.
(closes issue #9637, initial patch from jeffg, modified by me)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@68507 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-08 21:31:33 +00:00
rizzo 1b4ffa5248 rename the structs struct tone_zone_sound and struct tone_zone
defined in indications.h to ind_tone_zone_sound and ind_tone_zone,
to avoid conflicts with the structs with the same names
defined in tonezone.h

Hope i haven't missed any instance.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48958 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-25 06:38:09 +00:00
file 447ef934b0 Update res_snmp to use new API declaration of pbx_builtin_serialize_variables (issue #8627 reported by johann8384)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48595 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-19 22:55:26 +00:00
kpfleming d99c6f0cbc make latest header file changes for this file too
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33482 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-11 15:10:26 +00:00
russell 06fbbd1989 a bunch of conversion to ast_channel_*lock (issue #7058)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23355 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-29 14:50:18 +00:00
rizzo 70020a2853 do not export the tzlock and the list head, and introduce a new method,
ast_walk_indications(), to walk through the list of indications.
The new method returns an unlocked record, which is no different from the
behaviour of other existing methods in indications.c
(i.e. they all need to be fixed, with refcounts or some similar
method).

Note that ast_walk_indications() uses the pointer argument only as a
search key, so its implementation is completely safe.

In turn, this change allows the removal of AST_MUTEX_DEFINE_EXPORTED.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@16532 f38db490-d61c-443f-a65b-d21fe96a405b
2006-03-30 17:10:11 +00:00
markster 9dc4503175 Add SNMP support (bug #6439)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@11193 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-26 20:46:11 +00:00