dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

202 Commits

Author SHA1 Message Date
dvossel 4aca3187a3 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@306010 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-03 16:22:10 +00:00
seanbright db926891c2 Merged revisions 302412 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r302412 | seanbright | 2011-01-19 10:31:39 -0500 (Wed, 19 Jan 2011) | 10 lines
  
  Use appropriate type for requested format in chan_local.
  
  We were passing and storing the requested format as an int instead of format_t
  resulting in truncation.
  
  (closes issue #18238)
  Reported by: whizemen
  Patches:
        0018238_speex16.patch uploaded by whizemen (license 1143)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@302413 f38db490-d61c-443f-a65b-d21fe96a405b
2011-01-19 15:34:07 +00:00
tilghman 5d93f54097 Merged revisions 299626 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r299626 | tilghman | 2010-12-25 04:07:15 -0600 (Sat, 25 Dec 2010) | 19 lines
  
  Merged revisions 299625 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r299625 | tilghman | 2010-12-25 04:05:00 -0600 (Sat, 25 Dec 2010) | 12 lines
    
    Merged revisions 299624 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r299624 | tilghman | 2010-12-25 04:04:06 -0600 (Sat, 25 Dec 2010) | 5 lines
      
      Move check for extension existence below variable inheritance, due to the possible use of an eswitch.
      
      (closes issue #16228)
       Reported by: jlaguilar
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@299627 f38db490-d61c-443f-a65b-d21fe96a405b
2010-12-25 10:08:04 +00:00
dvossel 543fbef437 Merged revisions 292868 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r292868 | dvossel | 2010-10-25 14:07:50 -0500 (Mon, 25 Oct 2010) | 39 lines
  
  Merged revisions 292867 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r292867 | dvossel | 2010-10-25 14:06:21 -0500 (Mon, 25 Oct 2010) | 32 lines
    
    Merged revisions 292866 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r292866 | dvossel | 2010-10-25 14:05:07 -0500 (Mon, 25 Oct 2010) | 27 lines
      
      This patch turns chan_local pvts into astobj2 objects.
      
      chan_local does some dangerous things involving deadlock avoidance.
      tech_pvt functions like hangup and queue_frame are provided with a
      locked channel upon entry.  Those functions are completely safe as
      long as you don't attempt to give up that channel lock, but that is
      impossible to guarantee due to the required deadlock avoidance necessary
      to lock both the tech_pvt and both channels involved.
      
      In the past, we have tried to account for this by doing things like
      setting a "glare" flag that indicates what function should destroy the
      pvt.  This was used in local_hangup and local_queue_frame to decided
      who should destroy the pvt if they collided in separate threads.  I
      have removed the need to do this by converting all chan_local tech_pvts
      to astobj2.  This means we can ref a pvt before deadlock avoidance
      and not have to worry about that pvt possibly getting destroyed under
      us.  It also cleans up where we destroy the tech_pvt.  The only unlink
      from the tech_pvt container occurs in local_hangup now, which is where
      it should occur.
      
      Since there still may be thread collisions on some functions like
      local_hangup after deadlock avoidance, I have added some checks to detect
      those collisions and exit appropriately.  I think this patch is going to
      solve quite a bit of weirdness we have had with local channels in the past.
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@292869 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-25 19:11:42 +00:00
twilson 4f35ec29d0 Merged revisions 288748 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r288748 | twilson | 2010-09-24 09:02:27 -0700 (Fri, 24 Sep 2010) | 19 lines
  
  Merged revisions 288747 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r288747 | twilson | 2010-09-24 08:37:39 -0700 (Fri, 24 Sep 2010) | 12 lines
    
    Merged revisions 288746 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r288746 | twilson | 2010-09-24 08:26:09 -0700 (Fri, 24 Sep 2010) | 5 lines
      
      Don't fail a masquerade if it is already being hung up
      
      This avoids noise on some Local channel situations where we don't use /n.
      Thanks to Alec Davis for the suggestion.
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@288749 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-24 16:11:19 +00:00
twilson f6b4f75aac Merged revisions 288507 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r288507 | twilson | 2010-09-22 16:18:27 -0700 (Wed, 22 Sep 2010) | 22 lines
  
  Merged revisions 288500 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r288500 | twilson | 2010-09-22 16:10:09 -0700 (Wed, 22 Sep 2010) | 15 lines
    
    Merged revisions 288499 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r288499 | twilson | 2010-09-22 16:00:30 -0700 (Wed, 22 Sep 2010) | 8 lines
      
      Don't let a Local channel get bridged to itself
      
      If a local channel gets bridged to itself, it becomes orphaned with no devices
      left to actually tell it to hang up. This patch modifies local_fixup() to detect
      this case and deny it.
      
      Review: https://reviewboard.asterisk.org/r/934
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@288519 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-22 23:20:27 +00:00
twilson 83c8d81101 Merged revisions 286189 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r286189 | twilson | 2010-09-10 17:04:53 -0500 (Fri, 10 Sep 2010) | 30 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@286190 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-10 22:15:47 +00:00
jpeeler a665e2a7ad Merged revisions 281466 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r281466 | jpeeler | 2010-08-09 18:04:02 -0500 (Mon, 09 Aug 2010) | 2 lines
  
  Add some more stuff to copy from 281429.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@281467 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-09 23:04:59 +00:00
jpeeler dbc3315429 Merged revisions 281429 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r281429 | jpeeler | 2010-08-09 15:43:54 -0500 (Mon, 09 Aug 2010) | 27 lines
  
  Merged revisions 281391 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r281391 | jpeeler | 2010-08-09 15:07:29 -0500 (Mon, 09 Aug 2010) | 20 lines
    
    Merged revisions 281390 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r281390 | jpeeler | 2010-08-09 15:04:30 -0500 (Mon, 09 Aug 2010) | 13 lines
      
      Prevent loss of Caller ID information set on local channel after masquerade.
      
      Caller ID set on the channel before a masquerade occurs when using a local
      channel would cause the information to be lost. The problem was that the
      information was set on a channel destined to be hung up. The somewhat confusing
      fix is to detect if any Caller ID has been set on the channel and if so 
      preswap the Caller ID data so that basically the masquerade puts the data back.
      
      (closes issue #17138)
      Reported by: kobaz
      
      Review: https://reviewboard.asterisk.org/r/847/
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@281431 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-09 20:46:50 +00:00
mnicholson 4a8a7f428d Merged revisions 280307 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r280307 | mnicholson | 2010-07-29 08:56:35 -0500 (Thu, 29 Jul 2010) | 11 lines
  
  Merged revisions 280306 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r280306 | mnicholson | 2010-07-29 08:45:11 -0500 (Thu, 29 Jul 2010) | 2 lines
    
    Implement support for ast_channel_queryoption on local channels.  Currently only AST_OPTION_T38_STATE is supported.

    ABE-2229
    Review: https://reviewboard.asterisk.org/r/813/
  ........
  
  Additionally, pass AST_CONTROL_T38_PARAMETERS control frames through generic bridges.  This change appears to have been unintentionally left out of rev 203699.
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@280308 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-29 14:03:59 +00:00
tilghman 771cdeecd1 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278132 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-20 19:35:02 +00:00
russell fd7e8d53f7 Only call ast_channel_cc_params_init() if allocating a channel succeeds.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278051 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-20 17:22:36 +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 6ceebe0705 Merged revisions 273793 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r273793 | tilghman | 2010-07-02 16:36:39 -0500 (Fri, 02 Jul 2010) | 9 lines
  
  Have the DEADLOCK_AVOIDANCE macro warn when an unlock fails, to help catch potentially large software bugs.
  
  (closes issue #17407)
   Reported by: pdf
   Patches: 
         20100527__issue17407.diff.txt uploaded by tilghman (license 14)
   
  Review: https://reviewboard.asterisk.org/r/751/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@273830 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-03 02:36:31 +00:00
tringenbach 8890bab8a6 Add new AMI command LocalOptimizeAway.
This command lets you request a "/n" local channel
optimize itself out of the way anyway.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@272218 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-23 19:59:43 +00:00
mmichelson 82c8ef7415 Enhancements to connected line and redirecting work.
From reviewboard:

Digium has a commercial customer who has made extensive use of the connected party and
redirecting information present in later versions of Asterisk Business Edition and which
is to be in the upcoming 1.8 release. Through their use of the feature, new problems and solutions
have come about. This patch adds several enhancements to maximize usage of the connected party
and redirecting information functionality.

First, Asterisk trunk already had connected line interception macros. These macros allow you to
manipulate connected line information before it was sent out to its target. This patch adds the
same feature except for redirecting information instead.

Second, the ast_callerid and ast_party_id structures have been enhanced to provide a "tag." This
tag can be set with func_callerid, func_connectedline, func_redirecting, and in the case of DAHDI,
mISDN, and SIP channels, can be set in a configuration file. The idea behind the callerid tag is
that it can be set to whatever value the administrator likes. Later, when running connected line
and redirecting macros, the admin can read the tag off the appropriate structure to determine what
action to take. You can think of this sort of like a channel variable, except that instead of having
the variable associated with a channel, the variable is associated with a specific identity within
Asterisk.

Third, app_dial has two new options, s and u. The s option lets a dialplan writer force a specific
caller ID tag to be placed on the outgoing channel. The u option allows the dialplan writer to force
a specific calling presentation value on the outgoing channel.

Fourth, there is a new control frame subclass called AST_CONTROL_READ_ACTION added. This was added
to correct a very specific situation. In the case of SIP semi-attended (blond) transfers, the party
being transferred would not have the opportunity to run a connected line interception macro to
possibly alter the transfer target's connected line information. The issue here was that during a
blond transfer, the SIP transfer code has no bridged channel on which to queue the connected line
update. The way this was corrected was to add this new control frame subclass. Now, we queue an
AST_CONTROL_READ_ACTION frame on the channel on which the connected line interception macro should
be run. When ast_read is called to read the frame, ast_read responds by calling a callback function
associated with the specific read action the control frame describes. In this case, the action taken
is to run the connected line interception macro on the transferee's channel.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@263541 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-17 15:36:31 +00:00
dvossel 0a1173cfc8 Merged revisions 259858 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r259858 | dvossel | 2010-04-28 16:16:03 -0500 (Wed, 28 Apr 2010) | 33 lines
  
  resolves deadlocks in chan_local
  
  Issue_1.
  In the local_hangup() 3 locks must be held at the same time... pvt, pvt->chan,
  and pvt->owner.  Proper deadlock avoidance is done when the channel to hangup
  is the outbound chan_local channel, but when it is not the outbound channel we
  have an issue... We attempt to do deadlock avoidance only on the tech pvt, when
  both the tech pvt and the pvt->owner are locked coming into that loop.  By
  never giving up the pvt->owner channel deadlock avoidance is not entirely possible.
  This patch resolves that by doing deadlock avoidance on both the pvt->owner and the pvt
  when trying to get the pvt->chan lock.
  
  Issue_2.
  ast_prod() is used in ast_activate_generator() to queue a frame on the channel
  and make the channel's read function get called.  This function is used in
  ast_activate_generator() while the channel is locked, which mean's the channel
  will have a lock both from the generator code and the frame_queue code by the
  time it gets to chan_local.c's local_queue_frame code... local_queue_frame
  contains some of the same crazy deadlock avoidance that local_hangup requires,
  and this recursive lock prevents that deadlock avoidance from happening correctly.
  This patch removes ast_prod() from the channel lock so only one lock is held during
  the local_queue_frame function.
  
  (closes issue #17185)
  Reported by: schmoozecom
  Patches:
        issue_17185_v1.diff uploaded by dvossel (license 671)
        issue_17185_v2.diff uploaded by dvossel (license 671)
  Tested by: schmoozecom, GameGamer43
  
  Review: https://reviewboard.asterisk.org/r/631/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@259870 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-28 21:20:03 +00:00
mmichelson 77c798dc69 Prevent crash when originating a call to a local channel.
Call completion code tries to grab the call completion parameters
from the requesting channel during local_request. When originating
a call to a local channel, however, this channel is NULL. This
was causing an issue for me when trying to run a test script.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256646 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-09 21:41:30 +00:00
mmichelson 0eb1e5407a Merge Call completion support into trunk.
From Reviewboard:
CCSS stands for Call Completion Supplementary Services. An admittedly out-of-date
overview of the architecture can be found in the file doc/CCSS_architecture.pdf
in the CCSS branch. Off the top of my head, the big differences between what is
implemented and what is in the document are as follows:

1. We did not end up modifying the Hangup application at all.
2. The document states that a single call completion monitor may be used across
   multiple calls to the same device. This proved to not be such a good idea
   when implementing protocol-specific monitors, and so we ended up using one
   monitor per-device per-call.
3. There are some configuration options which were conceived after the document
   was written. These are documented in the ccss.conf.sample that is on this
   review request.
		      
For some basic understanding of terminology used throughout this code, see the
ccss.tex document that is on this review.

This implements CCBS and CCNR in several flavors.

First up is a "generic" implementation, which can work over any channel technology
provided that the channel technology can accurately report device state. Call
completion is requested using the dialplan application CallCompletionRequest and can
be canceled using CallCompletionCancel. Device state subscriptions are used in order
to monitor the state of called parties.

Next, there is a SIP-specific implementation of call completion. This method uses the
methods outlined in draft-ietf-bliss-call-completion-06 to implement call completion
using SIP signaling. There are a few things to note here:

* The agent/monitor terminology used throughout Asterisk sometimes is the reverse of
  what is defined in the referenced draft.

* Implementation of the draft required support for SIP PUBLISH. I attempted to write
  this in a generic-enough fashion such that if someone were to want to write PUBLISH
  support for other event packages, such as dialog-state or presence, most of the effort
  would be in writing callbacks specific to the event package.

* A subportion of supporting PUBLISH reception was that we had to implement a PIDF
  parser. The PIDF support added is a bit minimal. I first wrote a validation
  routine to ensure that the PIDF document is formatted properly. The rest of the
  PIDF reading is done in-line in the call-completion-specific PUBLISH-handling
  code. In other words, while there is PIDF support here, it is not in any state
  where it could easily be applied to other event packages as is.

Finally, there are a variety of ISDN-related call completion protocols supported. These
were written by Richard Mudgett, and as such I can't really say much about their
implementation. There are notes in the CHANGES file that indicate the ISDN protocols
over which call completion is supported.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256528 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-09 15:31:32 +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
russell 135b05634c Merged revisions 256014 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r256014 | russell | 2010-04-02 18:45:56 -0500 (Fri, 02 Apr 2010) | 9 lines
  
  Resolve a deadlock that occurs due to a pointless call to ast_bridged_channel()
  
  (closes issue #16840)
  Reported by: bzing2
  Patches:
        patch.txt uploaded by bzing2 (license 902)
        issue_16840.rev1.diff uploaded by russell (license 2)
  Tested by: bzing2, russell
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256015 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-02 23:46:45 +00:00
rmudgett 869624a523 Removed cdrflags from ast_channel structure.
Only chan_dahdi set a value in cdrflags.  Everyone else just copied it
around the system.  Noone cared about any value it may have contained.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250565 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-03 19:38:06 +00:00
dvossel 3b12e80473 fixes adaptive jitterbuffer configuration
When configuring the adaptive jitterbuffer, the target_extra
value not only could not be set from the configuration, but was
not even being set to its proper default.  This value is required
in order for the adaptive jitterbuffer to work correctly.  To resolve
this a config option has been added to expose this value to the conf
files, and a default value is provided when no config specific value
is present.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@249893 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-02 19:08:38 +00:00
jpeeler 494af9cc38 Merged revisions 249536 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r249536 | jpeeler | 2010-03-01 11:02:03 -0600 (Mon, 01 Mar 2010) | 11 lines
  
  Modify queued frames from local channels to not set the other side to up
  
  In this case, attended transfers were broken due to ast_feature_request_and_dial
  detecting the channel being set to up before the answer frame could be read and
  therefore failing to mark the channel as ready. This fix is a regression fix for
  244785, which should continue to work properly as well.
  
  (closes issue #16816)
  Reported by: jamhed
  Tested by: jamhed, corruptor
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@249538 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-01 17:11:31 +00:00
jpeeler 83050d844b Change channel state on local channels for busy,answer,ring.
Previously local channels channel state never changed. This became problematic
when the state of the other side of the local channel was lost, for example
during a masquerade. Changing the state of the local channel allows for the
scenario to be detected when the channel state is set to ringing, but the peer
isn't ringing. The specific problem scenario is described in 164201. Although
this was noted on one of the issues, here is the tested dialplan verified to
work:

exten => 9700,1,Dial(Local/*9700@default&Local/0009700@default)

exten => *9700,1,Set(GLOBAL(TESTCHAN)=${CHANNEL:0:${MATH(${LEN(${CHANNEL})}-1):0:2}}1)
exten => *9700,n,wait(3) ;3 works, 1 did not
exten => *9700,n,Dial(SIP/5001)

exten => 0009700,1,Wait(1) ;1 works, 3 did not
exten => 0009700,n,ChannelRedirect(${TESTCHAN},parkedcalls,701,1)

(closes issue #14992)
Reported by: davidw


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246070 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-10 16:47:37 +00:00
tilghman d280a37ed6 Merged revisions 244070 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r244070 | tilghman | 2010-02-01 11:46:31 -0600 (Mon, 01 Feb 2010) | 16 lines
  
  Revert previous chan_local fix (r236981) and fix instead by destroying expired frames in the queue.
  
  (closes issue #16525)
   Reported by: kobaz
   Patches: 
         20100126__issue16525.diff.txt uploaded by tilghman (license 14)
         20100129__issue16525__1.6.0.diff.txt uploaded by tilghman (license 14)
   Tested by: kobaz, atis
  
  (closes issue #16581)
   Reported by: ZX81
  
  (closes issue #16681)
   Reported by: alexr1
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@244071 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-01 17:53:39 +00:00
tilghman 62f128dded Merged revisions 237318 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237318 | tilghman | 2010-01-04 10:18:59 -0600 (Mon, 04 Jan 2010) | 3 lines
  
  It's also possible for the Local channel to directly execute an Application.
  Reviewboard: https://reviewboard.asterisk.org/r/452/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237319 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 16:20:03 +00:00
tilghman 67e91a0f7c Merged revisions 236981 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r236981 | tilghman | 2009-12-30 15:57:10 -0600 (Wed, 30 Dec 2009) | 9 lines
  
  Don't queue frames to channels that have no means to process them.
  (closes issue #15609)
   Reported by: aragon
   Patches: 
         20091230__issue16521__1.4__chan_local_only.diff.txt uploaded by tilghman (license 14)
   Tested by: aragon
   
  Review: https://reviewboard.asterisk.org/r/452/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236982 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-30 21:59:18 +00:00
file 9681dd52dd Merged revisions 230038 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r230038 | file | 2009-11-13 13:44:07 -0600 (Fri, 13 Nov 2009) | 9 lines
  
  Fix a crash caused by two threads thinking they should both free the
  chan_local private structure when only one should.
  
  (closes issue #15314)
  Reported by: sroberts
  Patches:
        Issue15314_Move_Nulling_owner.patch uploaded by davidw (license 780)
  Tested by: davidw, lottc
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230039 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 19:44:53 +00:00
twilson 21f1734963 Don't crash when bridge->tech_pvt == NULL
This is a similar solution to what is in place for chan_agent

(closes issue #16003)
Reported by: atis
Tested by: twilson


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@229015 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-09 22:50:22 +00:00
tilghman 3bacd4082e Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227580 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 14:05:12 +00:00
file 29706c54df Merged revisions 226531 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r226531 | file | 2009-10-29 15:11:26 -0300 (Thu, 29 Oct 2009) | 6 lines
  
  Add an option to enabling passing music on hold start and stop requests through instead of
  acting on them in chan_local.
  
  (closes issue #14709)
  Reported by: dimas
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226532 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-29 18:13:42 +00:00
oej 2bf61510db Doxygen documentation update
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226490 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-29 12:20:16 +00:00
tilghman 63bb16a721 Merged revisions 214940 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r214940 | tilghman | 2009-08-31 11:16:52 -0500 (Mon, 31 Aug 2009) | 7 lines
  
  Also unlock the "other" channel, when returning, due to glare.
  (closes issue #15787)
   Reported by: tim_ringenbach
   Patches: 
         chan_local.diff uploaded by tim ringenbach (license 540)
   Tested by: tim_ringenbach
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214945 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-31 16:18:33 +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
mmichelson 94226ca1dc Fix some bad locking stemming from trying to forward a call to a non-existent
extension from a queue.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200326 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-12 15:37:30 +00:00
mmichelson 95f584e2e9 Remove extra lock from local_indicate in connected line case.
Oh, and this fixes a deadlock I was seeing.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198529 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-01 14:42:57 +00:00
mmichelson c3001c1521 Add missing unlock of local pvt.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198511 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-01 14:19:49 +00:00
mmichelson a9296071c7 Add missing lock to local_indicate function for connected line frames.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197701 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-28 18:48:56 +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
file c052997dcc Merged revisions 190286 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r190286 | file | 2009-04-23 16:13:18 -0300 (Thu, 23 Apr 2009) | 6 lines
  
  Fix a bug in chan_local glare hangup detection.
  
  If both sides of a Local channel were hung up at around the same time it was
  possible for one thread to destroy the local private structure and have the other thread
  immediately try to remove the already freed structure from the local channel list.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190287 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-23 19:15:30 +00:00
mmichelson 44dce428af Indicating connected line or redirecting updates were missing a call to lock the local_pvt.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187830 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-10 18:56:52 +00:00
mmichelson 0fdeed176c ast_strdup failures aren't really failures if the original value was NULL.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187714 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-10 16:26:48 +00:00
mmichelson f00656db9e This commit introduces COLP/CONP and Redirecting party information into Asterisk.
The channel drivers which have been most heavily tested with these enhancements are
chan_sip and chan_misdn. Further work is being done to add Q.SIG support and will be
introduced in a later commit. chan_skinny has code added to it here, but according
to user pj, the support on chan_skinny is not working as of now. This will be fixed in
a later commit.

A special thanks goes out to bugtracker user gareth for getting the ball rolling and
providing the initial support for this work. Without his initial work on this, this would
not have been nearly as painless as it was.

This functionality has been tested by Digium's product quality department, as well as a
customer site running thousands of calls every day. In addition, many many many many bugtracker
users have tested this, too.

(closes issue #8824)
Reported by: gareth

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186525 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-03 22:41:46 +00:00
file 0eb1480fe0 Merge in the RTP engine API.
This API provides a generic way for multiple RTP stacks to be
integrated into Asterisk. Right now there is only one present, res_rtp_asterisk,
which is the existing Asterisk RTP stack. Functionality wise this commit
performs the same as previously. API documentation can be viewed in the
rtp_engine.h header file.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186078 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-02 17:20:52 +00:00
tilghman b4eb19c371 Merged revisions 182208 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r182208 | tilghman | 2009-03-16 10:39:15 -0500 (Mon, 16 Mar 2009) | 7 lines
  
  Fixup glare detection, to fix a memory leak of a local pvt structure.
  (closes issue #14656)
   Reported by: caspy
   Patches: 
         20090313__bug14656__2.diff.txt uploaded by tilghman (license 14)
   Tested by: caspy
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182211 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-16 15:50:55 +00:00
tilghman 4b22e504ec Prior to masquerade, move the group definitions to the channel performing the
masq, so that the group count lingers past the bridge.
(closes issue #14275)
 Reported by: kowalma
 Patches: 
       20090216__bug14275.diff.txt uploaded by Corydon76 (license 14)
 Tested by: kowalma


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176642 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 21:14:18 +00:00
oej 1c2618a19a Revert two lines that was extra, but only on fridays.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172319 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-29 17:10:43 +00:00
oej 10712d118c Fix "cancel answered elsewhere" through app_queue with members in chan_local.
Also, implement a private cause code (as suggested by Tilghman). This works with
chan_sip, but doesn't propagate through chan_local.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172318 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-29 17:08:22 +00:00
mmichelson 696e944241 Merged revisions 169210 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r169210 | mmichelson | 2009-01-19 09:52:15 -0600 (Mon, 19 Jan 2009) | 13 lines

Prevent a crash in chan_local due to a potential NULL pointer dereference

Move the check for if both channels on a local_pvt have generators to below
where p->chan is checked for NULLity (NULLness?). This prevents a crash from
occurring if p->chan is NULL.

(closes issue #14189)
Reported by: sascha
Patches:
      14189.patch uploaded by putnopvut (license 60)
Tested by: sascha


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@169211 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-19 15:54:06 +00:00