Commit Graph

340 Commits

Author SHA1 Message Date
Tilghman Lesher 77433168ea Merged revisions 286528 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r286528 | tilghman | 2010-09-13 18:12:21 -0500 (Mon, 13 Sep 2010) | 9 lines
  
  Merged revisions 286527 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r286527 | tilghman | 2010-09-13 18:03:26 -0500 (Mon, 13 Sep 2010) | 2 lines
    
    Refactor conversion to ast_poll() to fix callparking regression.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@286529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-13 23:15:50 +00:00
Olle Johansson 3335c96157 Whitespace cleanup and reformatting with { and }
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@286329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-11 17:31:42 +00:00
Richard Mudgett 4e0612340e Merged revisions 285371 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r285371 | rmudgett | 2010-09-07 16:08:35 -0500 (Tue, 07 Sep 2010) | 1 line
  
  Fix cut-n-paste error.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-07 21:12:58 +00:00
Tilghman Lesher 5eae9f44f7 Merged revisions 284597 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r284597 | tilghman | 2010-09-02 00:00:34 -0500 (Thu, 02 Sep 2010) | 29 lines
  
  Merged revisions 284593,284595 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r284593 | tilghman | 2010-09-01 17:59:50 -0500 (Wed, 01 Sep 2010) | 18 lines
    
    Merged revisions 284478 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r284478 | tilghman | 2010-09-01 13:49:11 -0500 (Wed, 01 Sep 2010) | 11 lines
      
      Ensure that all areas that previously used select(2) now use poll(2), with implementations that need poll(2) implemented with select(2) safe against 1024-bit overflows.
      
      This is a followup to the fix for the pthread timer in 1.6.2 and beyond, fixing
      a potential crash bug in all supported releases.
      
      (closes issue #17678)
       Reported by: russell
      Branch: https://origsvn.digium.com/svn/asterisk/team/tilghman/ast_select 
      
      Review: https://reviewboard.asterisk.org/r/824/
    ........
  ................
    r284595 | tilghman | 2010-09-01 22:57:43 -0500 (Wed, 01 Sep 2010) | 2 lines
    
    Failed to rerun bootstrap.sh after last commit
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02 05:02:54 +00:00
Russell Bryant a9e49f4e45 Update documentation for 'comebacktoorigin' in featuers.conf.
The documentation for this option did not match the code.  Fix that along with
some minor cleanups to the code along the way.  Document a slight change in
behavior (to something that was previously undocumented) in UPGRADE.txt.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-21 13:02:46 +00:00
Tilghman Lesher ef95349d1c Merged revisions 278167 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r278167 | tilghman | 2010-07-20 15:59:06 -0500 (Tue, 20 Jul 2010) | 4 lines
  
  Do not queue up DTMF frames while a call is on hold.
  
  (Fixes ABE-2110)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 22:26:23 +00:00
Jean Galarneau e533a48c16 Merged revisions 277906 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r277906 | jeang | 2010-07-19 15:16:36 -0500 (Mon, 19 Jul 2010) | 7 lines
  
  Avoid trying to pickup a parked extension before the park operation is completed.
  
  A crash could occur if the extension is picked up while the parking extension is
  being announced. Testing pu->notquiteyet while searching for a parked extension
  resolves this crash.
  
  (ABE-2418)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-19 21:07:08 +00:00
Tim Ringenbach 3442f13da4 Merged revisions 277625 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r277625 | tringenbach | 2010-07-16 17:43:39 -0500 (Fri, 16 Jul 2010) | 9 lines
  
  Save and restore AST_FLAG_BRIDGE_HANGUP_DONT on attended transfer.
  
  ast_bridge_call() clears AST_FLAG_BRIDGE_HANGUP_DONT. But during an attended
  transfer, ast_bridge_call() is called for a second bridge on the same channel,
  and it clears that flag, which still needs to get set for when the original
  ast_bridge_call() gets control back and checks it.
  
  Review: https://reviewboard.asterisk.org/r/741
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16 23:23:15 +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
Russell Bryant 8ae46b53a8 Merged revisions 276123 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r276123 | russell | 2010-07-13 14:06:53 -0500 (Tue, 13 Jul 2010) | 2 lines
  
  Use chan->cdr instead of chan_cdr (just like peer->cdr instead of peer_cdr in the last commit).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-13 19:09:42 +00:00
Russell Bryant ea1307d9ad Merged revisions 275994 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r275994 | russell | 2010-07-13 11:51:18 -0500 (Tue, 13 Jul 2010) | 14 lines
  
  Access peer->cdr directly instead of through a saved off reference.
  
  At this point in the code, it is possible that peer_cdr may be invalid.
  Specifically, in the blind transfer code, CDRs are swapped between channels.
  So, peer_cdr is no longer == peer->cdr.
  
  The scenario that exposed a crash in this code was a blind transfer that hit
  the system call limit, causing the transferee channel to get destroyed after
  the transfer attempt failed.  Even if it succeeds and this code doesn't crash,
  this code was still trying to reset a CDR on a channel that was now owned by
  a different thread, which is a BadThing(tm).
  
  (ABE-2417)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275995 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-13 16:53:44 +00:00
Russell Bryant b4ba8548e1 Fix some issues related to dynamic feature groups in features.conf.
The bridge handling code did not properly consider feature groups when setting
parameters that would affect whether or not a native bridge would be attempted.
If DYNAMIC_FEATURES only include a feature group, a native bridge would occur
that may prevent features from working.

Fix a bug in verbose output that would show the key mapping as empty if it was
using the default mapping and not a custom mapping in the feature group.

Add feature groups to the output of "features show".

Adjust the feature execution logic to match that of the logic when executing
a feature that was not configured through a feature group.

Update features.conf.sample to show that an '=' is still required if using
the default key mapping from [applicationmap].

Finally, clean up a little bit of formatting to better coform to coding
guidelines while in the area.

(closes issue #17589)
Reported by: lmadsen
Patches:
      issue_17589.rev4.txt uploaded by russell (license 2)
Tested by: russell, lmadsen


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 21:57:21 +00:00
Russell Bryant eaaeb7a1bc Add missing ao2_iterator_destroy().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 19:58:06 +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
David Vossel 6d82dbb905 fixes attended transfer behavior when both transferee and transferer hung up
If both the transferer and transferee of a attended transfer hangup before
the new channel picks up, the new channel should be hung up as well as it
has no endpoint to talk to.  This mirrors the expected behavior used in 1.4. 

(closes issue #17444)
Reported by: corruptor



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@271831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-22 15:46:22 +00:00
Leif Madsen c672763af8 Fix some doxygen warnings.
(closes issue #17336)
Reported by: snuffy
Patches:
      doxygen-fixes1.diff uploaded by snuffy (license 35)
Tested by: russell

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08 14:38:18 +00:00
Richard Mudgett afd4454c44 Generic Advice of Charge.
Asterisk Generic AOC Representation
- Generic AOC encode/decode routines.
  (Generic AOC must be encoded to be passed on the wire in the AST_CONTROL_AOC frame)
- AST_CONTROL_AOC frame type to represent generic encoded AOC data
- Manager events for AOC-S, AOC-D, and AOC-E messages

Asterisk App Support
- app_dial AOC-S pass-through support on call setup
- app_queue AOC-S pass-through support on call setup

AOC Unit Tests
- AOC Unit Tests for encode/decode routines
- AOC Unit Test for manager event representation.

SIP AOC Support
- Pass-through of generic AOC-D and AOC-E messages to snom phones via the
  snom AOC specification.
- Creation of chan_sip page3 flags for the addition of the new
  'snom_aoc_enabled' sip.conf option.

IAX AOC Support
- Natively supports AOC pass-through through the use of the new
  AST_CONTROL_AOC frame type

DAHDI AOC Support
- ETSI PRI full AOC Pass-through support
- 'aoc_enable' chan_dahdi.conf option for independently enabling
  pass-through of AOC-S, AOC-D, AOC-E.
- 'aoce_delayhangup' option for retrieving AOC-E on disconnect.
- DAHDI A() dial string option for requesting AOC services.
  example usage:
  ;requests AOC-S, AOC-D, and AOC-E on call setup
  exten=>1111,1,Dial(DAHDI/g1/1112/A(s,d,e))

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 18:10:15 +00:00
Mark Michelson b5d5cc565f 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: https://origsvn.digium.com/svn/asterisk/trunk@263541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-17 15:36:31 +00:00
Matthew Nicholson 8c41f2db82 Merged revisions 193391,258670 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r193391 | mnicholson | 2009-05-08 16:01:25 -0500 (Fri, 08 May 2009) | 8 lines
  
  Set the proper disposition on originated calls.
  
  (closes issue #14167)
  Reported by: jpt
  Patches:
        call-file-missing-cdr2.diff uploaded by mnicholson (license 96)
  Tested by: dlotina, rmartinez, mnicholson
........
  r258670 | mnicholson | 2010-04-22 16:49:07 -0500 (Thu, 22 Apr 2010) | 11 lines
  
  Fix broken CDR behavior.
  
  This change allows a CDR record previously marked with disposition ANSWERED to be set as BUSY or NO ANSWER.
  
  Additionally this change partially reverts r235635 and does not set the AST_CDR_FLAG_ORIGINATED flag on CDRs generated from ast_call().  To preserve proper CDR behavior, the AST_CDR_FLAG_DIALED flag is now cleared from all brige CDRs in ast_bridge_call().
  
  (closes issue #16797)
  Reported by: VarnishedOtter
  Tested by: mnicholson
........

(closes issue #16222)
Reported by: telles
Tested by: mnicholson



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-22 21:57:59 +00:00
Terry Wilson 9674766487 Fix incomplete CDR merge from r195881
Because res/res_features.c was removed and main/cdr.c added, these changes
didn't make it to trunk and the 1.6.x branches


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@257810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-19 17:57:41 +00:00
Tilghman Lesher 8b7a90a026 Yet another issue where the conversion of the application delimiter to comma caused an issue.
Application arguments within the feature map could possibly contain a comma,
which conflicts with the syntax of the features.conf configuration file.  This
patch allows the argument to be wrapped in parentheses or quoted, to allow the
application arguments to be interpreted as a single configuration parameter.

(closes issue #16646)
 Reported by: pinga-fogo
 Patches: 
       20100414__issue16646.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman
 
Review: https://reviewboard.asterisk.org/r/547/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@257262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-14 22:57:35 +00:00
Matthew Nicholson 8acef966ef Merged revisions 253799 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r253799 | mnicholson | 2010-03-22 14:50:00 -0500 (Mon, 22 Mar 2010) | 4 lines
  
  Unconditionally copy the caller's account code to the called party.
  
  (related to issue #16331)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253800 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-22 19:52:52 +00:00
Russell Bryant 3da9f8ed19 Resolve more compiler warnings on FreeBSD.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-20 12:03:07 +00:00
Jeff Peeler 9620ccf057 Fix ParkAndAnnounce not respecting parking options.
The patch ensures that if a peer does not exist, parking settings are read from
the channel. A unit test has been written to ensure proper operation for both
standard parking and parking using masquerades.

(closes issue #16592)
Reported by: mwyres
Patches: 
      bug_16592.diff uploaded by snuffy (license 35)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10 20:51:23 +00:00
Leif Madsen 78fdaa6865 Add missing description of the PARKINGLOT variable in XML documentation.
(closes issue #16743)
Reported by: snuffy
Patches: 
      parkingdoc.diff uploaded by snuffy (license 35)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02 19:24:43 +00:00
Mark Michelson da96c84c67 Send a manager event when the manager BridgeAction command is used.
(closes issue #16769)
Reported by: syspert
Patches:
      bridgeaction.patch uploaded by syspert (license 938)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 17:13:36 +00:00
Matthew Nicholson 469fed1cd3 Merged revisions 247651 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r247651 | mnicholson | 2010-02-18 13:38:09 -0600 (Thu, 18 Feb 2010) | 6 lines
  
  Copy the calling party's account code to the called party if they don't already have one.
  
  (closes issue #16331)
  Reported by: bluefox
  Tested by: mnicholson
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18 19:39:37 +00:00
David Vossel 57c819fd5e addition of dynamic parkinglots feature
This feature allows for parkinglots to be created dynamically within
the dialplan.  Thanks to all who were involved with getting this patch
written and tested!

(closes issue #15135)
Reported by: IgorG
Patches:
      features.dynamic_park.v3.diff uploaded by IgorG (license 20)
      2009090400_dynamicpark.diff.txt uploaded by mvanbaak (license 7)
      dynamic_parkinglot.diff uploaded by dvossel (license 671)
Tested by: eliel, IgorG, acunningham, mvanbaak, zktech

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 18:29:48 +00:00
Jeff Peeler b527525ffc Add some additional option support for non-default parking lots.
The options are: parkedcallparking, parkedcallhangup, parkedcallrecording, and
parkedcalltransfers. Previously these options were only available for the 
default parking lot.

(closes issue #16641)
Reported by: bluecrow76
Patches: 
      asterisk-1.6.2.1-features.c.diff uploaded by bluecrow76 (license 270)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-03 20:48:36 +00:00
David Vossel 7662c7fed2 Merged revisions 243390 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r243390 | dvossel | 2010-01-26 17:55:49 -0600 (Tue, 26 Jan 2010) | 9 lines
  
  fixes bug with channel receiving wrong privileges after call parking 
  
  (closes issue #16429)
  Reported by: Yasuhiro Konishi
  Patches:
        features.c.diff uploaded by Yasuhiro Konishi (license 947)
  Tested by: dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26 23:56:57 +00:00
Jeff Peeler 568c057c4c Extend max call limit duration from 24.8 days to 292+ million years.
If the limit was set past MAX_INT upon answering, the call was immediately
hung up due to overflow from the return of ast_tvdiff_ms (in ast_check_hangup).
The time calculation functions ast_tvdiff_sec and ast_tvdiff_ms have been
changed to return an int64_t to prevent overflow. Also the reporter suggested
adding a message indicating the reason for the call hanging up. Given that the
new limit is so much higher, the message (which would only really be useful in
the overflow scenario) has been made a debug message only.

(closes issue #16006)
Reported by: viraptor


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 22:31:25 +00:00
Tilghman Lesher e8a6d2995e Add pickup event to AMI. Also, fix AMI documentation.
(closes issue #16431)
 Reported by: syspert
 Patches: 
       20100112__issue16431.diff.txt uploaded by tilghman (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 21:04:34 +00:00
Sean Bright e612d87695 Convert a few places to use ast_calloc_with_stringfields where applicable.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 18:21:50 +00:00
Jeff Peeler 495b701a85 Merged revisions 239838 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r239838 | jpeeler | 2010-01-13 13:43:33 -0600 (Wed, 13 Jan 2010) | 11 lines
  
  Fix regression for timed out parked call returning to caller
  
  This issue seems to have been exposed by the fix in 160390 whereby using a
  masquerade prevented a crash. The new channel used in the masquerade was
  not copying the macro information from the old channel.
  
  (closes issue #15459)
  Reported by: djrodman
  Patches: 
        patch_15459.txt uploaded by mnick (license )
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13 19:48:16 +00:00
Jeff Peeler cde1057ec3 Merged revisions 238834 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r238834 | jpeeler | 2010-01-08 17:28:37 -0600 (Fri, 08 Jan 2010) | 4 lines
  
  Stop a crash when no peer is passed to masq_park_call.
  
  (distantly related to issue #16406)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238835 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 23:30:55 +00:00
Jeff Peeler 7df5564a61 Stop trying to find a parking space after traversing the parkinglot one time.
(closes issue #16428)
Reported by: Yasuhiro Konishi


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 17:18:41 +00:00
Jeff Peeler 0a4f80cbcf Fix channel name comparison for bridge application.
The channel name comparison was not comparing the whole string and therefore
if one channel name was a substring of the other, the bridge would fail.

(closes issue #16528)
Reported by: telecos82
Patches: 
      res_features_r236843.diff uploaded by telecos82 (license 687)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-06 19:05:06 +00:00
Tilghman Lesher 128e4022d0 Merged revisions 235821 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r235821 | tilghman | 2009-12-21 10:45:03 -0600 (Mon, 21 Dec 2009) | 8 lines
  
  Send parking lot announcement to the channel which parked the call, not the park-ee.
  (closes issue #16234)
   Reported by: yeshuawatso
   Patches: 
         20091210__issue16234.diff.txt uploaded by tilghman (license 14)
         20091221__issue16234__1.4.diff.txt uploaded by tilghman (license 14)
   Tested by: yeshuawatso
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235822 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-21 17:00:46 +00:00
Jeff Peeler c10288ec01 Fix erroneous hangup extension execution
ast_spawn_extension behaves differently from 1.4 in that hangups and extensions
that do not exist do not return an error, whereas in 1.6 it does. This is now 
taken into account so that the AST_FLAG_BRIDGE_HANGUP_RUN flag gets set
properly.

(closes issue #16106)
Reported by: ajohnson
Tested by: ajohnson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-24 18:50:36 +00:00
Matthew Nicholson cab2253d34 Merged revisions 230627 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r230627 | mnicholson | 2009-11-20 14:53:06 -0600 (Fri, 20 Nov 2009) | 8 lines
  
  Copy the peer CDR's userfield to the bridge CDR if it exists.  This is necessary for the recordagentcalls option in chan_agent to store the recorded file name in the bridge CDR.
  
  (closes issue #14590)
  Reported by: msetim
  Patches:
        queue_agent_userfield.patch uploaded by Laureano (license 265)
  Tested by: Laureano, mnicholson
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-20 21:01:10 +00:00
Tilghman Lesher 5e2aa190fe Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 20:42:03 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
Matthew Nicholson 7ed425ec80 This patch adds a sequence field to CDRs that can be combined with the linkedid or uniqueid field to uniquely identify a CDR.
(closes issue #15180)
Reported by: Nick_Lewis
Patches:
      cdr-sequence10.diff uploaded by mnicholson (license 96)
Tested by: mnicholson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 21:21:09 +00:00
Joshua Colp b518c7b9a7 Merged revisions 224773 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224773 | file | 2009-10-20 14:46:37 -0300 (Tue, 20 Oct 2009) | 5 lines
  
  Add support for relaying early media in the features attended transfer option.
  
  (closes issue #14828)
  Reported by: licedey
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-20 17:47:34 +00:00
David Vossel 9456ab2724 Deadlock in channel masquerade handling
Channels are stored in an ao2_container.  When accessing an item within
an ao2_container the proper locking order is to first lock the container,
and then the items within it.

In ast_do_masquerade both the clone and original channel must be locked
for the entire duration of the function.  The problem with this is that
it attemptes to unlink and link these channels back into the ao2_container
when one of the channel's name changes.  This is invalid locking order as
the process of unlinking and linking will lock the ao2_container while
the channels are locked!!! Now, both the channels in do_masquerade are
unlinked from the ao2_container and then locked for the entire function.
At the end of the function both channels are unlocked and linked back
into the container with their new names as hash values.

This new method of requiring all channels and tech pvts to be unlocked
before ast_do_masquerade() or ast_change_name() required several
changes throughout the code base.

(closes issue #15911)
Reported by: russell
Patches:
      masq_deadlock_trunk.diff uploaded by dvossel (license 671)
Tested by: dvossel, atis

(closes issue #15618)
Reported by: lmsteffan
Patches:
      deadlock_local_attended_transfers_trunk.diff uploaded by dvossel (license 671)
Tested by: lmsteffan, dvossel

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07 22:58:38 +00:00
Jeff Peeler f150b48bc0 Add bridge related dial flags to the bridge app
Most of the functionality here is gained simply by setting the feature flag
on the bridge config. However, the dial limit functionality has been moved from
app_dial to the features code and has been made public so both app_dial and
the bridge app can use it.

(closes issue #13165)
Reported by: tim_ringenbach
Patches:
      app_bridge_options_r138998.diff uploaded by tim ringenbach (license 540),
      modified by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-24 20:29:51 +00:00
Joshua Colp 3031ca468d Do not attempt to add a parking extension if an error occurred while reading the configuration.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-14 18:16:39 +00:00
Michiel van Baak f914f65634 - lock channel before looking for a channel variable
- Init the parkings list member of struct parkinglot.
Thanks Sean for the explanation why this should be here.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-02 20:21:51 +00:00
Jeff Peeler 29e1e05e13 Add two new dialplan variables when using features
Added DYNAMIC_FEATURENAME which holds the last triggered dynamic feature.
Added DYNAMIC_PEERNAME which holds the unique channel name on the other side
and is set when a dynamic feature is triggered.

(closes issue #14663)
Reported by: tamiel
Patches:
      20090313_features.diff uploaded by tamiel (license 712)
Tested by: tamiel


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@214309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-26 23:13:19 +00:00
Matthew Nicholson 53fd27c005 Fix a crash by checking the proper pointer for validity before deferencing it.
(closes issue #15751)
Reported by: atis
Patches:
      ast_bridge_call_peer_cdr.patch uploaded by atis (license 242)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-20 20:29:32 +00:00
Russell Bryant 8fa685ece2 Don't blow up on a NULL cdr.
Reported in #asterisk-dev.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-19 15:32:18 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Jeff Peeler b0f0110b16 Fix broken call pickup
The find_channel_by_group callback was only looking at the channel that was
attempting to make the pickup instead of the other channels in the container.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-04 15:35:49 +00:00
David Brooks d81d6d3415 Fixing typos. Replaces "recieved" with "received" and "initilize" with "initialize"
(closes issue #15571)
Reported by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27 16:33:50 +00:00
David Brooks 174c36ad41 Fixes Park() argument handling
Park() was not respecting the arguments passed to it. Any extension/context/priority
given to it was being ignored. This patch remedies this.

(closes issue #15380)
Reported by: DLNoah


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 17:26:26 +00:00
Matthew Nicholson fd6a49beac Moved trigger for BRIDGE_END CEL event so that it is more accurate.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-02 20:37:16 +00:00
Russell Bryant 0264eef115 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: https://origsvn.digium.com/svn/asterisk/trunk@203638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 15:28:53 +00:00
Russell Bryant bd2e4dc229 Merged revisions 203375 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r203375 | russell | 2009-06-25 16:02:18 -0500 (Thu, 25 Jun 2009) | 9 lines
  
  Fix a case where CDR answer time could be before the start time involving parking.
  
  (closes issue #13794)
  Reported by: davidw
  Patches:
        13794.patch uploaded by murf (license 17)
        13794.patch.160 uploaded by murf (license 17)
  Tested by: murf, dbrooks
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 21:04:55 +00:00
Tilghman Lesher ad0d1bfd9e Merged revisions 201828 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r201828 | tilghman | 2009-06-18 19:40:41 -0500 (Thu, 18 Jun 2009) | 6 lines
  
  If the "h" extension fails, give it another chance in main/pbx.c.
  If the "h" extension fails, give it another chance in main/pbx.c, when it
  returns from the bridge code.  Fixes an issue where the "h" extension may
  occasionally not fire, when a Dial is executed from a Macro.
  Debugged in #asterisk with user tompaw.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-19 00:43:41 +00:00
Kevin P. Fleming 82fb56886e More 'static' qualifiers on module global variables.
The 'pglobal' tool is quite handy indeed :-)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 17:34:30 +00:00
David Vossel 3830c415c7 Generic call forward api, ast_call_forward()
The function ast_call_forward() forwards a call to an extension specified in an ast_channel's call_forward string.  After an ast_channel is called, if the channel's call_forward string is set this function can be used to forward the call to a new channel and terminate the original one.  I have included this api call in both channel.c's ast_request_and_dial() and feature.c's feature_request_and_dial().  App_dial and app_queue already contain call forward logic specific for their application and options.

(closes issue #13630)
Reported by: festr

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-02 21:17:49 +00:00
Mark Michelson 298d745fb4 Add the ability to execute connected line interception macros.
When connected line updates are received or generated in the middle
of an application call, it is now possible to execute a macro to
manipulate the connected line data. This way, phone numbers may be
manipulated to be more presentable to users, names may be changed 
for...whatever reason, or whatever else needs to be done may be.

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

AST-165



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01 20:57:31 +00:00
Eliel C. Sardanons 2c882626a0 Implement a new element in AstXML for AMI actions documentation.
A new xml element was created to manage the AMI actions documentation,
using AstXML.
To register a manager action using XML documentation it is now possible
using ast_manager_register_xml().
The CLI command 'manager show command' can be used to show the parsed
documentation.

Example manager xml documentation:
<manager name="ami action name" language="en_US">
    <synopsis>
        AMI action synopsis.
    </synopsis>
    <syntax>
        <xi:include xpointer="xpointer(...)" /> <-- for ActionID
        <parameter name="header1" required="true">
	    <para>Description</para>
	</parameter>
	...
    </syntax>
    <description>
        <para>AMI action description</para>
    </description>
    <see-also>
    	...
    </see-also>
</manager>



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22 17:52:35 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
Mark Michelson 1e3ac401f4 Pass connected line updates along during a bridge.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 19:06:08 +00:00
Joshua Colp b4c24d2da1 Merged revisions 195688 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r195688 | file | 2009-05-20 14:30:25 -0300 (Wed, 20 May 2009) | 5 lines
  
  Fix some code that wrongly assumed a pointer would always be non-NULL when dealing with CDRs after a bridge.
  
  (closes issue #15079)
  Reported by: barryf
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-20 17:33:02 +00:00
Russell Bryant 23f54f4c76 Fix a typo where an equality check should be an assignment.
(closes issue #15103)
Reported by: lmsteffan
Patches:
      transfer_crash.patch uploaded by lmsteffan (license 779)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-14 21:24:17 +00:00
Kevin P. Fleming 1c988d8996 add 'const' qualifiers in various places where they should have been
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 13:59:35 +00:00
Jeff Peeler 1c05448f5a Merged revisions 192858 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r192858 | jpeeler | 2009-05-06 17:15:19 -0500 (Wed, 06 May 2009) | 10 lines
  
  Make ParkedCall application stop execution of the dialplan after hang up
  
  Just changed park_exec to always return non-zero. I really wasn't entirely sure
  at first if this was a bug. Decided it was since it would be surprising when 
  not using ParkedCall in the dialplan to hang up and have dialplan execution
  continue.
  
  (closes issue #14555)
  Reported by: francesco_r
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-06 22:17:27 +00:00
Richard Mudgett 7019ff68db Fixed crashes from issue8824 review board channel locking changes.
The local struct ast_party_connected_line connected_caller variable
was uninitialized when the copy function was called.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 20:54:07 +00:00
Joshua Colp 77e9d51c93 Merged revisions 192454 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r192454 | file | 2009-05-05 15:22:27 -0300 (Tue, 05 May 2009) | 8 lines
  
  Fix an incorrect assumption that certain values on the channel will always exist when they may not.
  
  The CDR code involved with bridges wrongly assumed that the currently executing application and data
  values will always exist. It is possible for this to be false when call forwarding is involved.
  
  (closes issue #14984)
  Reported by: gincantalupo
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 18:23:58 +00:00
Russell Bryant cba19c8a67 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: https://origsvn.digium.com/svn/asterisk/trunk@190423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24 14:04:26 +00:00
Russell Bryant 559f908016 Fix call parking callback. Pipes -> Commas.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@189951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-22 16:56:43 +00:00
Tilghman Lesher 1030a25ac9 Modify headers and macros, according to Russell's suggestions on the -dev list
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 03:55:27 +00:00
Jeff Peeler f57fddb5bb Add timer for features so that backup bridge config can go away
The biggest change done here was elimination of the backup_config for use with
features. Previously, the bridging code upon detecting a feature would set the
start time of the bridge to the start time of the feature. Then after the 
feature had either expired or timed out the start time would be reset to the
true bridge start time from the backup_config. Now, the time differences are
calculated with respect to the newly added feature_start_time timeval instead.

There should be no behavior changes from the previous functionality aside from
the bridge timing being unaffected by either valid or partial feature matches.
Previously the timing would be increased by the length of time configured for
featuredigittimeout, which was probably never noticed.

(closes issue #14503)
Reported by: KNK
Tested by: jpeeler

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 21:00:39 +00:00
Mark Michelson 6f53ed4c67 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: https://origsvn.digium.com/svn/asterisk/trunk@186525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 22:41:46 +00:00
David Vossel 9d3527bddf Merged revisions 183386 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r183386 | dvossel | 2009-03-19 14:40:07 -0500 (Thu, 19 Mar 2009) | 6 lines
  
  Cleaning up a few things in detect disconnect patch
  
  Initialized ast_call_feature in detect_disconnect to avoid accessing uninitialized memory.  Cleaned up /param tags in features.h.  No longer send dynamic features in ast_feature_detect. 
  
  issue #11583
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 20:30:39 +00:00
David Vossel 2764c2821f Merged revisions 183126 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r183126 | dvossel | 2009-03-19 11:15:16 -0500 (Thu, 19 Mar 2009) | 17 lines
  
  Allow disconnect feature before a call is bridged
  
  feature.conf has a disconnect option.  By default this option is set to '*', but it could be anything.  If a user wishes to disconnect a call before the other side answers, only '*' will work, regardless if the disconnect option is set to something else.  This is because features are unavailable until bridging takes place.  The default disconnect option, '*', was hardcoded in app_dial, which doesn't make any sense from a user perspective since they may expect it to be something different.  This patch allows features to be detected from outside of the bridge, but not operated on.  In this case, the disconnect feature can be detected before briding and handled outside of features.c.
  
  (closes issue #11583)
  Reported by: sobomax
  Patches:
  	patch-apps__app_dial.c uploaded by sobomax (license 359)
  	11583.latest-patch uploaded by murf (license 17)
  	detect_disconnect.diff uploaded by dvossel (license 671)
  Tested by: sobomax, dvossel
  Review: http://reviewboard.digium.com/r/195/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 16:28:33 +00:00
Kevin P. Fleming d11b6386a5 Improve behavior of ast_answer() to not lose incoming frames
ast_answer(), when supplied a delay before returning to the caller, use ast_safe_sleep() to implement the delay. Unfortunately during this time any incoming frames are discarded, which is problematic for T.38 re-INVITES and other sorts of channel operations.

When a delay is not passed to ast_answer(), it still delays for up to 500 milliseconds, waiting for media to arrive. Again, though, it discards any control frames, or non-voice media frames.

This patch rectifies this situation, by storing all incoming frames during the delay period on a list, and then requeuing them onto the channel before returning to the caller.

http://reviewboard.digium.com/r/196/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-17 14:38:11 +00:00
Mark Michelson 0892cdb958 Remove ast_ prefix from functions which are not public.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-13 17:49:01 +00:00
Mark Michelson 88e3279f83 Merged revisions 181990 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r181990 | mmichelson | 2009-03-13 12:12:32 -0500 (Fri, 13 Mar 2009) | 35 lines
  
  Check the DYNAMIC_FEATURES of both the chan and peer when interpreting DTMF.
  
  Dynamic features defined in the applicationmap section of features.conf allow
  one to specify whether the caller, callee, or both have the ability to use the
  feature. The documentation in the features.conf.sample file could be interpreted
  to mean that one only needs to set the DYNAMIC_FEATURES channel variable on the
  calling channel in order to allow for the callee to be able to use the features
  which he should have permission to use. However, the DYNAMIC_FEATURES variable
  would only be read from the channel of the participant that pressed the DTMF
  sequence to activate the feature. The result of this was that the callee was
  unable to use dynamic features unless the dialplan writer had taken measures
  to be sure that the DYNAMIC_FEATURES variable was set on the callee's channel.
  
  This commit changes the behavior of ast_feature_interpret to concatenate the
  values of DYNAMIC_FEATURES from both parties involved in the bridge. The features
  themselves determine who has permission to use them, so there is no reason to believe
  that one side of the bridge could gain the ability to perform an action that they
  should not have the ability to perform.
  
  Kevin Fleming pointed out on the asterisk-users list that the typical way that this
  was worked around in the past was by setting _DYNAMIC_FEATURES on the calling channel
  so that the value would be inherited by the called channel. While this works, the
  documentation alone is not enough to figure out why this is necessary for the callee
  to be able to use dynamic features. In this particular case, changing the code to match
  the documentation is safe, easy, and will generally make things easier for people for
  future installations.
  
  This bug was originally reported on the asterisk-users list by David Ruggles.
  
  (closes issue #14657)
  Reported by: mmichelson
  Patches:
        14657.patch uploaded by mmichelson (license 60)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-13 17:26:43 +00:00
Jeff Peeler 58cf8b69da Fix malloc debug macros to work properly with h323.
The main problem here was that cstdlib was undefining free thereby causing the
proper debug macros to not be used. ast_h323.cxx has been changed to call
ast_free instead to avoid the issue. 

A few other issues were addressed:
- There were a few instances of functions improperly passing ast_free instead
of ast_free_ptr.
- Some clean up was done to avoid the debug macros intentionally being redefined.
(copied below from Kevin's commit, appreciate the help)
- disable astmm.h from doing anything when STANDALONE is defined, which is used
by the tools in the utils/ directory that use parts of Asterisk header files in
hackish ways; also ensure that utils/extconf.c and utils/conf2ael.c are
compiled with STANDALONE defined.

(closes issue #13593)
Reported by: pj



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 04:06:44 +00:00
Joshua Colp bcf5ecde90 Merged revisions 179840 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r179840 | file | 2009-03-03 14:27:09 -0400 (Tue, 03 Mar 2009) | 9 lines
  
  Do not assume that the bridge_cdr is still attached to the channel when the 'h' exten is finished executing.
  
  It is possible for a masquerade operation to occur when the 'h' exten is operating. This operation moves
  the CDR records around causing the bridge_cdr to no longer exist on the channel where it is expected to.
  We can not safely modify it afterwards because of this, so don't even try.
  
  (closes issue #14564)
  Reported by: meric
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@179841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 18:28:46 +00:00
Steve Murphy ec6101595e Merged revisions 178956 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

In this case, it's just a matter of reducing the default timeouts from 2000
to 1000 msec, as the max def feature digit timeout is no longer halved.

........
  r178956 | murf | 2009-02-26 14:27:32 -0700 (Thu, 26 Feb 2009) | 18 lines
  
  This change moves the default feature digit timeout to 1000 ms from the previous default of 500.
  
  As per bug 14515, a dev discussion arrived at a "mediated concensus" 
  of a default feature digit timeout of 1.0 sec. Some voted for 1300;
  ctooley thought 1500 for distracted phone users in phone booths; 
  kpfleming put his foot down at 1.0 sec. 
  
  Users who found the previous default max delay of 250 msec perfect,
  are welcome to override the new default. Notice that I said that
  250 msec was the default; wait a minute, you might say, the config
  file said it was 500 msec!; well, because of the bug fix for 14515,
  we found that 500 msec was actually enforcing a max of 250. The bug
  fix would restore 500 msec, but we felt even that was a bit tight
  for most users... 2000 msec was pushed earlier by mmichelson, so
  that reduces to 1000 msec after the bug fix. Enjoy!
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-27 03:45:58 +00:00
Tilghman Lesher 63561aea00 Sound confirmation of call pickup success.
(closes issue #13826)
 Reported by: azielke
 Patches: 
       pickupsound2-trunk.patch uploaded by azielke (license 548)
       __20081124_bug_13826_updated.patch uploaded by lmadsen (license 10)
 Tested by: lmadsen


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-26 18:41:28 +00:00
Steve Murphy fe216b2f9d Merged revisions 178804 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r178804 | murf | 2009-02-26 10:09:03 -0700 (Thu, 26 Feb 2009) | 28 lines
  
  This patch prevents the feature detection timeout from being cut in half.
  
  Because the ast_channel_bridge() call will return 0 and pass
  a frame pointer for both DTMF_BEGIN and DTMF_END, the feature_timer
  field in hte config struct is getting decremented twice, which 
  effectively cuts the digittimeout in half. I added conditions
  to the if statement to only let DTMF_END frames to flow thru,
  which solved the problem. Also, when the frame pointer is null,
  let control flow thru-- this usually happens on timeouts. I added
  a comment to the code to explain what's going on and why.
  
  Many thanks to sodom for reporting this problem. Personnally, it always seemed
  like something was wrong with the featuredigittimeout, but I never
  could quite decide what... and was too busy to investigate.
  This bug forced the issue, and now we know.
  
  Sodom had other issues in 14515, but I couldn't reproduce them. If
  he still has problems, and wants to get them solved, he is welcome
  to reopen 14515.
  
  
  (closes issue #14515)
  Reported by: sodom
  Patches:
        14515.patch uploaded by murf (license 17)
  Tested by: murf, sodom
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-26 17:22:11 +00:00
Jeff Peeler 90a6374871 Fix mismerge from revision 176708 pointed out by Kaloyan Kovachev on the
asterisk-dev mailing list. Thanks!



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-19 15:56:31 +00:00
David Vossel e30d2c1d45 Locking issue in action_bridge and bridge_exec
action_bridge() and bridge_exec() both search for the channels to bridge to, and then immediately drop the lock.  Instead, they should hold the lock until the masquerade is complete.  This will guarantee the channel remains and prevent any other weirdness from occurring.  In action_bridge() some more weirdness comes into play.  Both channels are needlessly locked at the same time and perform the exact same logic.  It makes sense from a coding organizational standpoint, but could cause a theoretical deadlock so I split the code up.  There is an issue associated with this, but since its a rather complicated thing to reproduce I'm not certain this alone will close it.

issue# 14296
Review: http://reviewboard.digium.com/r/167/




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18 22:51:38 +00:00
Jeff Peeler f40edf2793 Merged revisions 176701 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r176701 | jpeeler | 2009-02-17 15:54:34 -0600 (Tue, 17 Feb 2009) | 17 lines
  
  Modify bridging to properly evaluate DTMF after first warning is played
  
  The main problem is currently if the Dial flag L is used with a warning sound,
  DTMF is not evaluated after the first warning sound. To fix this, a flag has 
  been added in ast_generic_bridge for playing the warning which ensures that if
  a scheduled warning is missed, multiple warrnings are not played back (due to a
  feature evaluation or waiting for digits). ast_channel_bridge was modified to
  store the nexteventts in the ast_bridge_config structure as that information
  was lost every time ast_channel_bridge was reentered, causing a hangup due to
  incorrect time calculations.
  
  (closes issue #14315)
  Reported by: tim_ringenbach
 
  Reviewed on reviewboard:
  http://reviewboard.digium.com/r/163/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 22:08:00 +00:00
Jeff Peeler a46d290802 Merged revisions 175294 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r175294 | jpeeler | 2009-02-12 14:34:36 -0600 (Thu, 12 Feb 2009) | 9 lines
  
  Fix ParkedCall event information for From field in the case of a blind transfer
  
  If the parker information can not be obtained from the peer, try and see if
  the BLINDTRANSFER channel variable has been set. Previously, a blind transfer
  to the ParkAndAnnounce app would return nothing for the From.
  
  Closes AST-189
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 20:48:56 +00:00
Jeff Peeler 66e88633a5 Merged revisions 175187 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r175187 | jpeeler | 2009-02-12 11:57:10 -0600 (Thu, 12 Feb 2009) | 6 lines
  
  Fix crash in event of failed attempt to transfer to parking
  
  The peer may not necessarily exist, such as in the case of a transfer to 
  ParkAndAnnounce. In this case don't try to play a sound to it.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 18:00:11 +00:00
Jeff Peeler 39ec5d1576 Merged revisions 173211 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r173211 | jpeeler | 2009-02-03 15:57:01 -0600 (Tue, 03 Feb 2009) | 17 lines
  
  Parking attempts made to one end of a bridge no longer will hang up due to a
  parking failure.
  
  Parking attempts made using either one-touch, or doing either a blind or 
  assisted transfer to the parking extension now keep up the bridge instead of
  hanging up the attempted parked party. Normal causes for the parking attempt
  to fail includes the specific specified extension (via PARKINGEXTEN) not being 
  available or if all the parking spaces are currently in use. To avoid having
  to reverse a masquerade park_space_reserve was made to provide foresight if
  a parking attempt will succeed and if so reserve the parking space.
  
  (closes issue #13494)
  Reported by: mdu113
  
  Reviewed by Russell: http://reviewboard.digium.com/r/133/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-04 21:17:53 +00:00
Terry Wilson 34be09bf5c Merged revisions 173066 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r173066 | twilson | 2009-02-02 17:48:06 -0600 (Mon, 02 Feb 2009) | 2 lines
  
  Fix a feature inheritance bug I added after code review
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-02 23:57:25 +00:00
Steve Murphy 53d9b77898 This reverts the changes I made for 11583; will
reviewboard this before committing again...
reopened 11583 until all Russell's issues are
resolved.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-02 19:02:24 +00:00
Steve Murphy c61e8a7865 This change allows the disconnect feature (as in "one-touch" in features.c)
to be used within the dial app, before a call is bridged.

Many thanks to sobomax for submitting this patch. 

Quoting from bug 11582:

  "So the goal of the patch was to use the user configured feature code during the 
   call setup phase. The original ast_feature_interpret() function is not well suited 
   for this purpose as it uses much call bridge specific data and doesn't separate a 
   detection of feature from a feature handler call. So a new function ast_feature_detect() 
   has been extracted off the ast_feature_interpret() function but keeping the original 
   logic intact except some insignificant changes to locking.

  "Having created the ast_feature_detect() function the possibility to use feature detection 
   in almost any place of the asterisk code. So a call to this function has been added to 
   wait_for_answer() function of app_dial.so module. This code doesn't call the feature handler 
   however and uses old call leg disconnect logic to make the changes as small and simple as 
   possible to prevent unexpected problems. A disconnect feature currently is the only one 
   supported during call setup as other features as call parking and call transfer don't make much 
   sense during call setup. However if need in some of the features would arise it is much easier to 
   implement as the infrastructure changes are already in place with this patch."

I have cleaned up the patch somewhat, and verified that the existing functionality is not
harmed, and that the new functionality works. Terry has committed his stuff, and there were
no conflicts (see 14274).

(closes issue #11583)
Reported by: sobomax
Patches:
      patch-apps__app_dial.c uploaded by sobomax (license 359)
      patch-include__asterisk__features.h uploaded by sobomax (license 359)
      patch-res__res_features.c uploaded by sobomax (license 359)
      enable-features-during-call-setup.diff uploaded by sobomax (license 359)
      11583.newdiff uploaded by murf (license 17)
      enable-features-during-call-setup-1.diff uploaded by sobomax (license 359)
      11583.latest-patch uploaded by murf (license 17)
Tested by: sobomax, murf




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-02 17:37:15 +00:00
Terry Wilson 8d782f96b8 Merged revisions 172517 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r172517 | twilson | 2009-01-30 11:47:41 -0600 (Fri, 30 Jan 2009) | 37 lines
  
  Fix feature inheritance with builtin features
  
  When using builtin features like parking and transfers, the AST_FEATURE_* flags
  would not be set correctly for all instances when either performing a builtin
  attended transfer, or parking a call and getting the timeout callback.  Also,
  there was no way on a per-call basis to specify what features someone should
  have on picking up a parked call (since that doesn't involve the Dial() command).
  There was a global option for setting whether or not all users who pickup a
  parked call should have AST_FEATURE_REDIRECT set, but nothing for DISCONNECT,
  AUTOMON, or PARKCALL.
  
  This patch:
  1) adds the BRIDGE_FEATURES dialplan variable which can be set either in the
  dialplan or with setvar in channels that support it.  This variable can be set
  to any combination of 't', 'k', 'w', and 'h' (case insensitive matching of the
  equivalent dial options), to set what features should be activated on this
  channel.  The patch moves the setting of the features datastores into the
  bridging code instead of app_dial to help facilitate this.
  
  2) adds global options parkedcallparking, parkedcallhangup, and
  parkedcallrecording to be similar to the parkedcalltransfers option for
  globally setting features.
  
  3) has builtin_atxfer call builtin_parkcall if being transfered to the parking
  extension since tracking everything through multiple masquerades, etc. is
  difficult and error-prone
  
  4) attempts to fix all cases of return calls from parking and completed builtin
  transfers not having the correct permissions
  (closes issue #14274)
  Reported by: aragon
  Patches: 
        fix_feature_inheritence.diff.txt uploaded by otherwiseguy (license 396)
  Tested by: aragon, otherwiseguy
  
  Review http://reviewboard.digium.com/r/138/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-30 21:29:12 +00:00
Steve Murphy 268ac221a2 Merged revisions 172030 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r172030 | murf | 2009-01-28 11:51:16 -0700 (Wed, 28 Jan 2009) | 46 lines
  
  This patch fixes h-exten running misbehavior in manager-redirected 
  situations.
  
  What it does:
  1. A new Flag value is defined in include/asterisk/channel.h,
   AST_FLAG_BRIDGE_HANGUP_DONT, which used as a messenge to the
   bridge hangup exten code not to run the h-exten there (nor
   publish the bridge cdr there). It will done at the pbx-loop
   level instead.
  2. In the manager Redirect code, I set this flag on the channel
   if the channel has a non-null pbx pointer. I did the same for the
   second (chan2) channel, which gets run if name2 is set...
   and the first succeeds.
  3. I restored the ending of the cdr for the pbx loop h-exten
   running code. Don't know why it was removed in the first place.
  4. The first attempt at the fix for this bug was to place code
     directly in the async_goto routine, which was called from a
     large number of places, and could affect a large number of
     cases, so I tested that fix against a fair number of transfer
     scenarios, both with and without the patch. In the process,
     I saw that putting the fix in async_goto seemed not to affect
     any of the blind or attended scenarios, but still, I was
     was highly concerned that some other scenarios I had not tested
     might be negatively impacted, so I refined the patch to 
     its current scope, and jmls tested both. In the process, tho,
     I saw that blind xfers in one situation, when the one-touch
     blind-xfer feature is used by the peer, we got strange 
     h-exten behavior.  So, I  inserted code to swap CDRs and
     to set the HANGUP_DONT field, to get uniform behavior.
  5. I added code to the bridge to obey the HANGUP_DONT flag,
     skipping both publishing the bridge CDR, and running
     the h-exten; they will be done at the pbx-loop (higher)
     level instead.
  6. I removed all the debug logs from the patch before committing.
  7. I moved the AUTOLOOP set/reset in the h-exten code in res_features
     so it's only done if the h-exten is going to be run. A very
     minor performance improvement, but technically correct.
  
  
  (closes issue #14241)
  Reported by: jmls
  Patches:
        14241_redirect_no_bridgeCDR_or_h_exten_via_transfer uploaded by murf (license 17)
  Tested by: murf, jmls
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-28 20:31:06 +00:00
Terry Wilson 01b95990b0 Make a proper builtin attended transfer to parking work
This is an ugly hack from 1.4 that allows the timeout callback from a parked
call to use the right channel name for the callback when the park is done with
a builtin attended transfer (that isn't completed early).  This hasn't ever
worked in trunk and no one has complained yet, so eh.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-20 19:22:24 +00:00
Terry Wilson a6855a48b2 Merged revisions 169485 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r169485 | twilson | 2009-01-20 12:40:56 -0600 (Tue, 20 Jan 2009) | 6 lines
  
  Don't play audio to the channel if we've masqueraded
  
  (closes issue #14066)
  Reported by: bluefox
  Tested by: otherwiseguy, bluefox
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-20 18:48:14 +00:00
Terry Wilson ec1cfe02d1 Merged revisions 168716 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r168716 | twilson | 2009-01-15 12:22:49 -0600 (Thu, 15 Jan 2009) | 12 lines
  
  Convert call to park_call_full to masq_park_call_announce
  
  Since we removed the AST_PBX_KEEPALIVE return value, we need to use masqueraded
  parking, otherwise we will try to call ast_hangup() in __pbx_run() and in
  do_parking_thread() and then promptly crash.
  (closes issue #14215)
  	Reported by: waverly360	
  	Tested by: otherwiseguy
  (closes issue #14228)
  	Reported by: kobaz
  	Tested by: otherwiseguy
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-16 22:16:23 +00:00
Steve Murphy aa905e347e Merged revisions 166093 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

In order to merge this 1.4 patch into trunk,
I had to resolve some conflicts and wait for
Russell to make some changes to res_agi.
I re-ran all the tests; 39 calls in all, and
made fairly careful notes and comparisons: I
don't want this to blow up some aspect of 
asterisk; I completely removed the KEEPALIVE
from the pbx.h decls. The first 3 scenarios
involving feature park; feature xfer to 700;
hookflash park to Park() app call all behave
the same, don't appear to leave hung channels,
and no crashes.

........
  r166093 | murf | 2008-12-19 15:30:32 -0700 (Fri, 19 Dec 2008) | 131 lines
  
  This merges the masqpark branch into 1.4
  
  These changes eliminate the need for (and use of)
  the KEEPALIVE return code in res_features.c;
  There are other places that use this result code
  for similar purposes at a higher level, these appear
  to be left alone in 1.4, but attacked in trunk.
  
  The reason these changes are being made in 1.4, is
  that parking ends a channel's life, in some situations,
  and the code in the bridge (and some other places),
  was not checking the result code properly, and dereferencing
  the channel pointer, which could lead to memory corruption
  and crashes.
  
  Calling the masq_park function eliminates this danger 
  in higher levels.
  
  A series of previous commits have replaced some parking calls
  with masq_park, but this patch puts them ALL to rest,
  (except one, purposely left alone because a masquerade
  is done anyway), and gets rid of the code that tests
  the KEEPALIVE result, and the NOHANGUP_PEER result codes.
  
  While bug 13820 inspired this work, this patch does
  not solve all the problems mentioned there.
  
  I have tested this patch (again) to make sure I have
  not introduced regressions. 
  
  Crashes that occurred when a parked party hung up
  while the parking party was listening to the numbers
  of the parking stall being assigned, is eliminated.
  
  These are the cases where parking code may be activated:
  
  1. Feature one touch (eg. *3)
  2. Feature blind xfer to parking lot (eg ##700)
  3. Run Park() app from dialplan (eg sip xfer to 700)
     (eg. dahdi hookflash xfer to 700)
  4. Run Park via manager.
  
  The interesting testing cases for parking are:
  I. A calls B, A parks B
      a. B hangs up while A is getting the numbers announced.
      b. B hangs up after A gets the announcement, but 
         before the parking time expires
      c. B waits, time expires, A is redialed,
         A answers, B and A are connected, after
         which, B hangs up.
      d. C picks up B while still in parking lot.
  
  II. A calls B, B parks A
      a. A hangs up while B is getting the numbers announced.
      b. A hangs up after B gets the announcement, but 
         before the parking time expires
      c. A waits, time expires, B is redialed,
         B answers, A and B are connected, after
         which, A hangs up.
      d. C picks up A while still in parking lot.
  
  Testing this throroughly involves acting all the permutations
  of I and II, in situations 1,2,3, and 4.
  
  Since I added a few more changes (ALL references to KEEPALIVE in the bridge
  code eliimated (I missed one earlier), I retested
  most of the above cases, and no crashes.
  
  H-extension weirdness.
  
  Current h-extension execution is not completely
  correct for several of the cases.
  
  For the case where A calls B, and A parks B, the
  'h' exten is run on A's channel as soon as the park
  is accomplished. This is expected behavior.
  
  But when A calls B, and B parks A, this will be
  current behavior:
  
  After B parks A, B is hung up by the system, and
  the 'h' (hangup) exten gets run, but the channel
  mentioned will be a derivative of A's...
  
  Thus, if A is DAHDI/1, and B is DAHDI/2,
  the h-extension will be run on channel
  Parked/DAHDI/1-1<ZOMBIE>, and the 
  start/answer/end info will be those 
  relating to Channel A.
  
  And, in the case where A is reconnected to
  B after the park time expires, when both parties
  hang up after the joyful reunion, no h-exten
  will be run at all.
  
  In the case where C picks up A from the 
  parking lot, when either A or C hang up,
  the h-exten will be run for the C channel.
  
  CDR's are a separate issue, and not addressed
  here.
  
  As to WHY this strange behavior occurs, 
  the answer lies in the procedure followed
  to accomplish handing over the channel
  to the parking manager thread. This procedure
  is called masquerading. In the process,
  a duplicate copy of the channel is created,
  and most of the active data is given to the
  new copy. The original channel gets its name
  changed to XXX<ZOMBIE> and keeps the PBX
  information for the sake of the original
  thread (preserving its role as a call 
  originator, if it had this role to begin
  with), while the new channel is without
  this info and becomes a call target (a
  "peer").
  
  In this case, the parking lot manager
  thread is handed the new (masqueraded)
  channel. It will not run an h-exten
  on the channel if it hangs up while
  in the parking lot. The h exten will
  be run on the original channel instead,
  in the original thread, after the bridge
  completes.
  
  See bug 13820 for our intentions as
  to how to clean up the h exten behavior.

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

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-23 18:13:49 +00:00
Russell Bryant c9eb01c899 Merged revisions 164201 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r164201 | russell | 2008-12-15 08:31:37 -0600 (Mon, 15 Dec 2008) | 31 lines

Handle a case where a call can be bridged to a channel that is still ringing.

The issue that was reported was about a case where a RINGING channel got 
redirected to an extension to pick up a call from parking.  Once the parked 
call got taken out of parking, it heard silence until the other side answered.  
Ideally, the caller that was parked would get a ringing indication.  This patch
fixes this case so that the caller receives ringback once it comes out of 
parking until the other side answers.

The fixes are:

 - Make sure we remember that a channel was an outgoing channel when doing 
   a masquerade.  This prevents an erroneous ast_answer() call on the channel,
   which causes a bogus 200 OK to be sent in the case of SIP.

 - Add some additional comments to explain related parts of code.

 - Update the handling of the ast_channel visible_indication field.  Storing 
   values that are not stateful is pointless.  Control frames that are events 
   or commands should be ignored.

 - When a bridge first starts, check to see if the peer channel needs to be 
   given ringing indication because the calling side is still ringing.

 - Rework ast_indicate_data() a bit for the sake of readability.

(closes issue #13747)
Reported by: davidw
Tested by: russell
Review: http://reviewboard.digium.com/r/90/

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 14:40:24 +00:00
Mark Michelson 7828e7a966 Add an appropriate goto if ast_call fails
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 20:21:44 +00:00
Mark Michelson 62130ba876 Reduce indentation level of ast_feature_request_and_dial
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 19:40:18 +00:00
Russell Bryant 31e068ade2 Merged revisions 163092 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r163092 | russell | 2008-12-11 10:54:51 -0600 (Thu, 11 Dec 2008) | 11 lines

Fix an issue that made it so you could only have a single caller executing
a custom feature at a time.  This was especially problematic when custom
features ran for any appreciable amount of time.

The fix turned out to be quite simple.  The dynamic features are now stored
in a read/write list instead of a list using a mutex.

(closes issue #13478)
Reported by: neutrino88
Fix suggested by file

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 17:06:16 +00:00
Eliel C. Sardanons 1e8e12efcf Janitor, use ARRAY_LEN() when possible.
(closes issue #13990)
Reported by: eliel
Patches:
      array_len.diff uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 10:31:25 +00:00
Kevin P. Fleming 887e28d7aa incorporates r159808 from branches/1.4:
------------------------------------------------------------------------
r159808 | kpfleming | 2008-11-29 10:58:29 -0600 (Sat, 29 Nov 2008) | 7 lines

update dev-mode compiler flags to match the ones used by default on Ubuntu Intrepid, so all developers will see the same warnings and errors

since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them

format attributes in a consistent way


------------------------------------------------------------------------

in addition:

move some format attributes from main/utils.c to the header files they belong in, and fix up references to the relevant functions based on new compiler warnings



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-29 17:57:39 +00:00
Jeff Peeler 1abffcee9f Always parse arguments in park_call_exec so that app_args is valid. This prevents a crash when executing Park from the dialplan with no arguments.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-26 03:18:01 +00:00
Sean Bright fd8caa1778 This is basically a complete rollback of r155401, as it was determined that
it would be best to maintain API compatibility.  Instead, this commit introduces
ao2_callback_data() which is functionally identical to ao2_callback() except
that it allows you to pass arbitrary data to the callback.

Reviewed by Mark Michelson via ReviewBoard:
	http://reviewboard.digium.com/r/64


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 01:01:49 +00:00
Steve Murphy 11e22239cc Merged revisions 158603 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r158603 | murf | 2008-11-21 16:14:50 -0700 (Fri, 21 Nov 2008) | 11 lines

In reference to the fix made for 13871, I was
merging the fix into 1.6.0 and realized I missed
the code in the h-exten block, and didn't catch it
because my test case had the h-exten commented out.

So, this corrects the code I missed, as a 
preventative against another crash report.
Tested with the h-exten defined, all is well.



........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 23:40:46 +00:00
Steve Murphy 3c01868040 Merged revisions 158483 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r158483 | murf | 2008-11-21 14:19:47 -0700 (Fri, 21 Nov 2008) | 11 lines

(closes issue #13871)
Reported by: mdu113

This one is totally my fault. The code doesn't even
create a bridge CDR if the channel CDR has POST_DISABLED.
I didn't check for that at the end of the bridge.
Fixed with a few small insertions. Tested. Looks
good. No cdr generated, no crash, no unnecc. data
objects created either.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 21:47:16 +00:00
Mark Michelson d91f1df3e0 Merged revisions 157305 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r157305 | mmichelson | 2008-11-18 12:25:55 -0600 (Tue, 18 Nov 2008) | 12 lines

Fix a crash in the end_bridge_callback of app_dial and
app_followme which would occur at the end of an attended
transfer. The error occurred because we initially stored
a pointer to an ast_channel which then was hung up due
to a masquerade.

This commit adds a "fixup" callback to the bridge_config
structure to allow for end_bridge_callback_data to be
changed in the case that a new channel pointer is needed
for the end_bridge_callback.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-18 18:31:08 +00:00
Russell Bryant 1148e648b8 Fix a few more places where the case insensitive hash should be used since
the comparison is case insensitive.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-15 04:25:57 +00:00
Sean Bright 48522988ab In order to move away from nested function use, some changes to the recently introduced
ast_channel_search_locked need to be made.  Specifically, the caller needs to be able to
pass arbitrary data which in turn is passed to the callback.  This patch addresses all
of the nested functions currently in asterisk trunk.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-09 01:59:59 +00:00
Sean Bright 9ef09ad1d4 Merged revisions 155553 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r155553 | seanbright | 2008-11-08 20:08:07 -0500 (Sat, 08 Nov 2008) | 6 lines

Use static functions here instead of nested ones.  This requires a small
change to the ast_bridge_config struct as well.  To understand the reason
for this change, see the following post:

    http://gcc.gnu.org/ml/gcc-help/2008-11/msg00049.html

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-09 01:27:00 +00:00
Sean Bright 30d1744ffc Add ability to pass arbitrary data to the ao2_callback_fn (called from
ao2_callback and ao2_find).  Currently, passing OBJ_POINTER to either
of these mandates that the passed 'arg' is a hashable object, making
searching for an ao2 object based on outside criteria difficult.

Reviewed by Russell and Mark M. via ReviewBoard:
    http://reviewboard.digium.com/r/36/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07 22:39:30 +00:00
Sean Bright 6ac794074e Update a couple places to use the new ast_channel_search_locked API call.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05 22:19:22 +00:00
Eliel C. Sardanons 990a6bebe8 Add more SeeAlso references based on TFOT.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05 14:37:07 +00:00
Tilghman Lesher 2cc8e25222 Slightly optimize ast_devstate_str and rename global functions devstate2str and config_text_file_save to have an ast_ prefix
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04 18:47:20 +00:00
Russell Bryant 5b168ee34b Merge changes from team/group/appdocsxml
This commit introduces the first phase of an effort to manage documentation of the
interfaces in Asterisk in an XML format.  Currently, a new format is available for
applications and dialplan functions.  A good number of conversions to the new format
are also included.

For more information, see the following message to asterisk-dev:

http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01 21:10:07 +00:00
Terry Wilson 5fe37e47c6 Recent CDR fixes moved execution of the 'h' exten into the bridging code, so variables that were set after ast_bridge_call was called would not show up in the 'h' exten. Added a callback function to handle setting variables, etc. from w/in the bridging code. Calls back into a nested function within the function calling ast_bridge_call
(closes issue #13793)
Reported by: greenfieldtech


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31 18:55:33 +00:00
Mark Michelson de90c84b1a After seeing another problem in #asterisk stemming from
the low default value of featuredigittimeout, I decided it
was high time to change it. I have changed the default to
2000 ms based on a suggestion from Leif Madsen.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30 16:38:19 +00:00
Steve Murphy 6fad66dfb3 Merged revisions 152535 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r152535 | murf | 2008-10-28 22:36:32 -0600 (Tue, 28 Oct 2008) | 46 lines

The magic trick to avoid this crash is not to
try to find the channel by name in the list,
which is slow and resource consuming, but rather
to pay attention to the result codes from the
ast_bridge_call, to which I added the 
AST_PBX_NO_HANGUP_PEER_PARKED value, which
now are returned when a channel is parked.
Why? because CDR's aren't generated via parking,
so nothing is needed, but if a transfer occurred,
there are critical things I need.

If you get AST_PBX_KEEPALIVE,
then don't touch the channel pointer.

If you get AST_PBX_NO_HANGUP_PEER, or
AST_PBX_NO_HANGUP_PEER_PARKED, then don't
touch the peer pointer.

Updated the several places where the results
from a bridge were not being properly obeyed,
and fixed some code I had introduced so that
the results of the bridge were not overridden 
(in trunk).

All the places that previously tested for 
AST_PBX_NO_HANGUP_PEER now have to check for
both AST_PBX_NO_HANGUP_PEER and AST_PBX_NO_HANGUP_PEER_PARKED.

I tested this against the 4 common parking
scenarios:


1. A calls B; B answers; A parks B; B hangs up while A is getting the parking
slot announcement, immediately after being put on hold.

2. A calls B; B answers; A parks B; B hangs up after A has been hung up, but
before the park times out.

3. A calls B; B answers; B parks A; A hangs up while B is getting the parking slot announcement, immediately after being put on hold.

4. A calls B; B answers; B parks A; A hangs up after B has been hung up, but before the park times out.


No crash.

I also ran the scenarios above against valgrind, and accesses looked good.



........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:01:00 +00:00
Mark Michelson 6d70f45506 Merged revisions 146026 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r146026 | murf | 2008-10-03 12:12:54 -0500 (Fri, 03 Oct 2008) | 18 lines

(closes issue #13579)
Reported by: dwagner

(closes issue #13584)
Reported by: dwagner
Tested by: murf, putnopvut

The thought occurred to me that the res= from the extension spawn
was ending up being returned from the bridge.

"Thou shalt not poison the return value". Made the change
and it appears to allow blind xfers to work as normal.

If I'm wrong, reopen the bugs. But it looks good to me!

Many thanks to putnopvut for helping me reproduce this!


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@148112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-09 23:15:33 +00:00
Jeff Peeler c897b4e630 (closes issue #13139)
Reported by: krisk84
Tested by: krisk84

This change prevents a call that is placed in the parkinglot to be picked up before the PBX is finished. If another extension dials the parking extension before the PBX thread has completed at minimum warnings will occur about the PBX not properly being terminated. At worst, a crash could occur.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-09 19:27:32 +00:00
Jeff Peeler 0dc7ac9a6c Explicitly setting these fields to NULL was done because I wasn't sure if they would be NULL otherwise. Since they will be set automatically, removing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-07 16:04:45 +00:00
Jeff Peeler 2ec290b09d Similar to r143204, masquerade the channel in the case of Park being called from AGI.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06 23:08:21 +00:00
Jeff Peeler 50923eab5d This commit squashes together three commits because the wrong approach was originally used. (One of the commits was only one line.)
1) r143204:
The main change here was to masquerade the channel if the channel that was to be parked was running a PBX on it. The PBX thread can then maintain full control of the channel (the zombie) as it expects to while allowing the parking thread full control of the real (parked) channel.

2) r143270:
Changed park_call_full to hold the parkinglot lock a little longer, which protects the parkeduser struct from being freed out from underneath. Made sure that the parking extension is added to the parking context while holding the lock thereby ensuring that there are no spurious warnings from removal attempts when a hangup occurs while the parking lot is being announced.

3) r143475: (the one liner)
compare peer and chan instead of looking at the parked user (pu), which could have possibly already have been freed by the parking thread



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06 22:26:25 +00:00
Jeff Peeler abc88c1d61 fix some comment placement
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06 22:08:40 +00:00
Jeff Peeler 7d8d1f50bb Explicitly set args in park_call_exec NULL so in the case of no options being passed in, there
is no garbage attempted to be used. Also, do not set args to unknown value again if there are
 no options passed in.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146875 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06 22:03:01 +00:00
Jeff Peeler 4b22fb221c remove superfluous reference counting operations in manage_parkinglot since ao2_interator_next increments the ref count automatically
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-03 22:40:59 +00:00
Mark Michelson 7eae109418 Okay, this should really do it now. While I did manage
to fix blind transfers with my last commit here, I also
caused an unwanted side-effect. That is, only the first
priority of the 'h' extension would be executed when
a blind transfer occurred instead of all priorities.

Essentially, my last commit corrected the return value
of ast_bridge_call. However, the implementation still
was not 100% correct. Now it is.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-01 22:23:50 +00:00
Mark Michelson e6799e1c99 if (!(x) == 0) is the same as
if (x).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-01 21:33:11 +00:00
Mark Michelson a23b8c9158 The logic surrounding the return value of ast_spawn_extension
within ast_bridge_call was reversed.

This problem was observed when a blind transfer placed from
the callee channel of a test call failed.

While the problem I am solving here is exactly the same
as what was reported in issue #13584, the difference is
that this fix I am applying is trunk-only. Issue #13584
was reported against the 1.4 branch, and my tests
of 1.4's blind transfers appear to work fine.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-01 21:06:26 +00:00
Steve Murphy 8343faed0e Merged revisions 144066 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r144066 | murf | 2008-09-23 10:41:49 -0600 (Tue, 23 Sep 2008) | 29 lines

(closes issue #13489)
Reported by: DougUDI
Tested by: murf

(closes issue #13490)
Reported by: seanbright
Tested by: murf

(closes issue #13467)
Reported by: edantie
Tested by: murf, edantie, DougUDI


This crash happens because we are unsafely handling old pointers.
The channel whose cdr is being handled, has been hung up and 
destroyed already. I reorganized the code a bit, and tried not
to lose the fork-cdr-chain concepts of the previous code.
I now verify that the 'previous' channel (the channel we
had when the bridge was started), still exists, by looking it up
by name in the channel list. I also do not try to reset the
CDR's of channels involved in bridges. 

Testing shows it solves the crash problem, and should not
negatively impact previous fixes involving CDR's generated
during/after blind transfers. (The reason we need to reset
the CDR's on the "beginning" channels in the first place).



........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@144067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-23 16:52:32 +00:00
Tilghman Lesher 08af5bb312 Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiating
when a file is invalid from when a file is missing.  This is most important when
we have two configuration files.  Consider the following example:

Old system:
sip.conf     users.conf     Old result               New result
========     ==========     ==========               ==========
Missing      Missing        SIP doesn't load         SIP doesn't load
Missing      OK             SIP doesn't load         SIP doesn't load
Missing      Invalid        SIP doesn't load         SIP doesn't load
OK           Missing        SIP loads                SIP loads
OK           OK             SIP loads                SIP loads
OK           Invalid        SIP loads incompletely   SIP doesn't load
Invalid      Missing        SIP doesn't load         SIP doesn't load
Invalid      OK             SIP doesn't load         SIP doesn't load
Invalid      Invalid        SIP doesn't load         SIP doesn't load

So in the case when users.conf doesn't load because there's a typo that
disrupts the syntax, we may only partially load users, instead of failing with
an error, which may cause some calls not to get processed.  Worse yet, the old
system would do this with no indication that anything was even wrong.

(closes issue #10690)
 Reported by: dtyoo
 Patches: 
       20080716__bug10690.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 23:30:03 +00:00
Steve Murphy 67f7ac0499 Merged revisions 142675 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r142675 | murf | 2008-09-11 22:29:34 -0600 (Thu, 11 Sep 2008) | 29 lines

Tested by: sergee, murf, chris-mac, andrew, KNK

This is a "second attempt" to restore the previous "endbeforeh" behavior
in 1.4 and up. In order to capture information concerning all the
legs of transfers in all their infinite combinations, I was forced
to this particular solution by a chain of logical necessities, the
first being that I was not allowed to rewrite the CDR mechanism from 
the ground up!

This change basically leaves the original machinery alone, which allows
IVR and local channel type situations to generate CDR's as normal, but
a channel flag can be set to suppress the normal running of the h exten.
That flag would be set by the code that runs the h exten from the
ast_bridge_call routine, to prevent the h exten from being run twice.
Also, a flag in the ast_bridge_config struct passed into ast_bridge_call
can be used to suppress the running of the h exten in that routine. This
would happen, for instance, if you use the 'g' option in the Dial app.

Running this routine 'early' allows not only the CDR() func to be used
in the h extension for reading CDR variables, but also allows them to
be modified before the CDR is posted to the backends.

While I dearly hope that this patch overcomes all problems, and 
introduces no new problems, reality suggests that surely someone
will have problems. In this case, please re-open 13251 (or 13289),
and we'll see if we can't fix any remaining issues.

** trunk note: some code to suppress the h exten being run 
from app_queue was added; for the 'continue' option available
only in trunk/1.6.x.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 04:50:48 +00:00
Steve Murphy c4fc8fe4be Merged revisions 142575 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r142575 | murf | 2008-09-11 16:55:49 -0600 (Thu, 11 Sep 2008) | 20 lines

(closes issue #13364)
Reported by: mdu113

Well, fundamentally, the problems revealed in 13364 are
because of the ForkCDR call that is done before the dial. 
When the bridge is in place, it's dealing with the first
(and wrong) cdr in the list.

So, I wrote a little func to zip down to the first non-locked
cdr in the chain, and thru-out the ast_bridge_call, these
results are used instead of raw chan->cdr and peer->cdr pointers.
This shouldn't affect anyone who isn't forking cdrs before a
dial, and should correct the cdr's of those that do.

So, this change ends up correcting the dstchannel
and userfield; the disposition was fixed by a previous
patch, it was OK coming into this problem.



........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-11 23:12:53 +00:00
Steve Murphy 4fc65a69a2 Merged revisions 142474 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r142474 | murf | 2008-09-10 15:58:17 -0600 (Wed, 10 Sep 2008) | 30 lines

(closes issue #12318)
Reported by: krtorio

I made a small change to the code that handles local channel situations.
In that code, I copy the answer time from the peer cdr, to the bridge_cdr,
but I wasn't also copying the disposition from the peer cdr.

So, Now I copy the disposition, and I've tested against 
these cases:

1. phone 1 never answers the phone; no cdr is generated at all.
   this should show up as a manager command failure or something.

2. phone 2 never answers. CDR is generated, says NO ANSWER

3. phone 2 is busy. CDR is generated, says BUSY

4. phone 2 answers: CDR is generated, times are correct; disposition
   is ANSWERED, which is correct. The start time is the time that
   the manager dialed the first phone. The answer time is the time
   the second phone picks up.

I purposely left the cid and src fields blank; since this call really
originates from the manager, there is no 'easy' data to put in these
fields. If you feel strongly that these fields should be filled in,
re-open this bug and I'll dig further.




........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-10 22:11:27 +00:00
Russell Bryant 4f077691bc Merged revisions 142063 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r142063 | russell | 2008-09-09 10:40:24 -0500 (Tue, 09 Sep 2008) | 5 lines

Ensure that the stored CDR reference is still valid after the bridge before
poking at it.  Also, keep the channel locked while messing with this CDR.

(fixes crashes reported in issue #13409)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-09 15:44:10 +00:00
Jeff Peeler f7efe4a1f7 Merged revisions 141028 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r141028 | jpeeler | 2008-09-04 12:00:29 -0500 (Thu, 04 Sep 2008) | 7 lines

(closes issue #11979)
Fixes multiple parking problems:
Crash when executing a park on an extension dialed by AGI due to not returning the proper return code.
Crash when using a builtin feature that was a subset of a enabled dynamic feature.
Crash due to always hanging up the peer despite the fact that the peer was supposed to be parked.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@141039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-04 17:27:56 +00:00
Jeff Peeler 8fc9d6d6fa Added the option s to the Park application which will silence the announcement of the parking space number. Also, fixes the bug of just clearing the flags instead of actually parsing the arguments to Park.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-29 17:53:32 +00:00
Mark Michelson 5dfefa5ee6 Merged revisions 140488 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r140488 | mmichelson | 2008-08-29 12:34:17 -0500 (Fri, 29 Aug 2008) | 22 lines

After working on the ao2_containers branch, I noticed
something a bit strange. In all cases where we provide
a callback function to ao2_container_alloc, the callback
function would only return 0 or CMP_MATCH. After inspecting
the ao2_callback() code carefully, I found that if you're
only looking for one specific item, then you should return
CMP_MATCH | CMP_STOP. Otherwise, astobj2 will continue
traversing the current bucket until the end searching for
more matches.

In cases like chan_iax2 where in 1.4, all the peers are
shoved into a single bucket, this makes for potentially
terrible performance since the entire bucket will be
traversed even if the peer is one of the first ones come
across in the bucket.

All the changes I have made were for cases where the 
callback function defined was passed to ao2_container_alloc
so that calls to ao2_find could find a unique instance
of whatever object was being stored in the container.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-29 17:47:17 +00:00
Steve Murphy ea898dc6c3 Merged revisions 139764 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r139764 | murf | 2008-08-25 09:33:14 -0600 (Mon, 25 Aug 2008) | 9 lines

This patch reverts the changes made via 139347, and 139635, as users
are seeing adverse difference. 

I will un-close 13251.

Back to the drawing board/ concept/ beginning/ whatever!



........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 15:54:18 +00:00
Steve Murphy de1af295c8 Merged revisions 139635 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r139635 | murf | 2008-08-22 16:24:02 -0600 (Fri, 22 Aug 2008) | 6 lines

I found some problems with the code I committed earlier, when
I merged them into trunk, so I'm coming back to clean up.
And, in the process, I found an error in the code I added
to trunk and 1.6.x, that I'll fix using this patch also.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 22:32:35 +00:00
Steve Murphy 2488366a75 Merged revisions 139347 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r139347 | murf | 2008-08-21 17:03:50 -0600 (Thu, 21 Aug 2008) | 47 lines


(closes issue #13251)
Reported by: sergee
Tested by: murf



THis is a bold move for a static release fix, but I wouldn't have
made it if I didn't feel confident (at least a *bit* confident)
that it wouldn't mess everyone up.

The reasoning goes something like this:

1. We simply cannot do anything with CDR's at the current point
(in pbx.c, after the __ast_pbx_run loop). It's way too late to
have any affect on the CDRs. The CDR is already posted and gone,
and the remnants have been cleared.

2. I was very much afraid that moving the running of the 'h'
extension down into the bridge code (where it would be now
practical to do it), would result in a lot more calls to the
'h' exten, so I implemented it as another exten under another
name, but found, to my pleasant surprise, that there was a 
1:1 correspondence to the running of the 'h' exten in the
pbx_run loop, and the new spot at the end of the bridge.
So, I ifdef'd out the current 'h' loop, and moved it into
the bridge code. The only difference I can see is the stuff
about the AST_PBX_KEEPALIVE, and hopefully, if this 
is still an important decision point, I can replicate it
if there are complaints. To be perfectly honest,
the KEEPALIVE situation is not totally clear to me,
and how it relates to a post-bridge situation is less
clear. I suspect the users will point out everything
in total clarity if this steps on anyone's toes!

3. I temporarily swap the bridge_cdr into the channel
before running the 'h' exten, which makes it possible
for users to edit the cdr before it goes out the door.
And, of course, with the endbeforehexten config var set,
the users can also get at the billsec/duration vals.
After the h exten finishes, the cdr is swapped back
and processing continues as normal.

Please, all who deal with CDR's, please test this version
of Asterisk, and file bug reports as appropriate!


........

I also made a little fix to the app_dial's 'e' option,
that is related to my updates.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 22:03:13 +00:00
Jeff Peeler ea788c02e7 remove extra comma typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 21:52:20 +00:00
Mark Michelson 060f6d5c3d Add missing unique id to ParkedCallGiveUp and ParkedCallTimeOut
manager events

(closes issue #13358)
Reported by: srt
Patches:
      13358_parking_events.diff uploaded by srt (license 378)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 20:02:35 +00:00
Sean Bright 642dd656eb Move Uniqueid to the end of the event for those that rely on the position
of the name/value pairs, pointed out by snuffy-home on #asterisk-commits.

For those of you who rely on the position of name/value pairs in manager
events... stop... that is why associative arrays were invented.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@138482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-17 14:12:11 +00:00
Sean Bright c8c264b9ad Add Uniqueid header to ParkedCall manager event.
(closes issue #13323)
Reported by: srt
Patches:
      13323_unique_id_for_parkedcalls_event.diff uploaded by srt (license 378)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@138479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-17 13:51:08 +00:00
Sean Bright b69c8e6ab5 Another big chunk of changes from the RSW branch. Bunch of stuff from main/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-10 19:35:50 +00:00
Mark Michelson e12e97a640 Bump a LOG_NOTICE message to LOG_DEBUG since it appears
once for every bridged call



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 20:25:43 +00:00
Steve Murphy 5eaf8450d6 Merged revisions 135799 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r135799 | murf | 2008-08-05 17:13:20 -0600 (Tue, 05 Aug 2008) | 34 lines

(closes issue #12982)
Reported by: bcnit
Tested by: murf

I discovered that also, in the previous bug fixes and changes,
the cdr.conf 'unanswered' option is not being obeyed, so
I fixed this.

And, yes, there are two 'answer' times involved in this
scenario, and I would agree with you, that the first 
answer time is the time that should appear in the CDR.
(the second 'answer' time is the time that the bridge
was begun).

I made the necessary adjustments, recording the first
answer time into the peer cdr, and then using that to
override the bridge cdr's value.

To get the 'unanswered' CDRs to appear, I purposely
output them, using the dial cmd to mark them as
DIALED (with a new flag), and outputting them if
they bear that flag, and you are in the right mode.

I also corrected one small mention of the Zap device
to equally consider the dahdi device.

I heavily tested 10-sec-wait macros in dial, and
without the macro call; I tested hangups while the
macro was running vs. letting the macro complete
and the bridge form. Looks OK. Removed all the
instrumentation and debug.



........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05 23:45:32 +00:00
Steve Murphy 9051edfa4a (closes issue #13202)
Reported by: falves11
Tested by: murf

falves11 ==

The changes I introduce here seem to clear up the problem
for me. However, if they do not for you, please reopen this
bug, and we'll keep digging.

The root of this problem seems to be a subtle memory corruption
introduced when creating an extension with an empty extension
name. While valgrind cannot detect it outside of DEBUG_MALLOC
mode, when compiled with DEBUG_MALLOC, this is certain death.

The code in main/features.c is a puzzle to me. On the initial
module load, the code is attempting to add the parking extension
before the features.conf file has even been opened!

I just wrapped the offending call with an if() that will not
try to add the extension if the extension name is empty. THis
seems to solve the corruption, and let the "memory show allocations"
work as one would expect.

But, really, adding an extension with an empty name is a seriously
bad thing to allow, as it will mess up all the pattern matching 
algorithms, etc. So, I added a statement to the add_extension2 code to return
a -1 if this is attempted.




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-02 04:51:29 +00:00
Steve Murphy 5aa43c0afe Merged revisions 134883 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r134883 | murf | 2008-07-31 13:23:42 -0600 (Thu, 31 Jul 2008) | 51 lines

(closes issue #11849)
Reported by: greyvoip
Tested by: murf

OK, a few days of debugging, a bunch of instrumentation
in chan_sip, main/channel.c, main/pbx.c, etc. and 5 solid 
notebook pages of notes later, I  have made the small
tweek necc. to get the start time right on the second 
CDR when:

  A Calls B
  B answ.
  A hits Xfer button on sip phone,
  A dials C and hits the OK button,
  A hangs up
  C answers ringing phone
  B and C converse
  B and/or C hangs up

But does not harm the scenario where:

  A Calls B
  B answ.
  B hits xfer button on sip phone,
  B dials C and hits the OK button,
  B hangs up
  C answers ringing phone
  A and C converse
  A and/or C hangs up

The difference in start times on the second CDR is because
of a Masquerade on the B channel when the xfer number is 
sent. It ends up replacing the CDR on the B channel with
a duplicate, which ends up getting tossed out. We keep 
a pointer to the first CDR, and update *that* after the
bridge closes. But, only if the CDR has changed.

I hope this change is specific enough not to muck
up any current CDR-based apps. In my defence, I 
assert that the previous information was wrong,
and this change fixes it, and possibly other
similar scenarios.

I wonder if I should be doing the same thing
for the channel, as I did for the peer, but
I can't think of a scenario this might affect.
I leave it, then, as an exersize for the users,
to find the scenario where the chan's CDR 
changes and loses the proper start time.


........

and as to 1.4 to trunk; have I expressed my 
feelings about code shifting from one file
to another? Good.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 19:48:08 +00:00
Tilghman Lesher 853f6a8b3e Move implementation of an attended-transfer-complete sound from one channel
driver into a common place for multiple channel drivers.
(closes issue #13152)
 Reported by: caio1982
 Patches: 
       atxfer_complete_sound3.diff uploaded by caio1982 (license 22)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 16:40:43 +00:00
Brett Bryant d032448c61 Merged revisions 131915 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r131915 | bbryant | 2008-07-18 10:34:42 -0500 (Fri, 18 Jul 2008) | 4 lines

Fix a bug in blind transfers where the BLINDTRANSFER variable isn't always set to the other end of the blind transfer.

(closes issue #12586)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 15:38:22 +00:00
Brett Bryant aca8e1abe9 Fix a memory leak in register_group_feature when attempting to register
a feature without specifying a group or feature to register.

(closes issue #13101)
Reported by: eliel
Patches:
      features.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-17 18:14:42 +00:00
Michiel van Baak 9d5160cc42 Remove deprecated 'show parkedcalls' CLI command
(closes issue #13038)
Reported by: eliel
Patches:
      finish.deprecate.patch uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-10 16:21:16 +00:00
Steve Murphy bc2cfb3e81 Merged revisions 127663 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r127663 | murf | 2008-07-02 18:16:25 -0600 (Wed, 02 Jul 2008) | 30 lines

The CDRfix4/5/6 omnibus cdr fixes.

(closes issue #10927)
Reported by: murf
Tested by: murf, deeperror

(closes issue #12907)
Reported by: falves11
Tested by: murf, falves11


(closes issue #11849)
Reported by: greyvoip

As to 11849, I think these changes fix the core problems 
brought up in that bug, but perhaps not the more global
problems created by the limitations of CDR's themselves
not being oriented around transfers.

Reopen if necc, but bug reports are not the best
medium for enhancement discussions. We need to start
a second-generation CDR standardization effort to cover
transfers.

(closes issue #11093)
Reported by: rossbeer
Tested by: greyvoip, murf



........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 17:16:44 +00:00
Steve Murphy f4c85ebd22 (closes issue #12689)
Reported by: ys

Many thanks to ys for doing the research on this problem.
I didn't think it would be best to unlock the contexts
and then relock them after the remove_extension2() call,
so I added an extra arg to remove_extension2() and set it
appropriately in each call. There were not that many.

I considered forcing the code to lock the contexts before
the call to remove_extension2(), but that would require
a slightly greater degree of changes, especially since
the find_context_locked is local to pbx.c

I did a simple sanity test to make sure the code doesn't
mess things up in general.




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 20:43:46 +00:00
Jeff Peeler 84d0404ed5 (closes issue 0012193)
Reported by: davidw
Patch by: Corydon76, modified by me to work properly with ParkAndAnnounce app


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 23:08:37 +00:00
Jeff Peeler ef3b214728 Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 17:27:55 +00:00
Terry Wilson 65a1460c51 Initialize parkingtime to DEFAULT_PARK_TIME instead of 0
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-11 21:38:40 +00:00
Jeff Peeler 5934801d84 Merged revisions 120863,120885 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r120863 | jpeeler | 2008-06-06 10:33:15 -0500 (Fri, 06 Jun 2008) | 3 lines

This fixes a crash when LOW_MEMORY is turned on. Two allocations of the ast_rtp struct that were previously allocated on the stack have been modified to use thread local storage instead.


........
r120885 | jpeeler | 2008-06-06 11:39:20 -0500 (Fri, 06 Jun 2008) | 2 lines

Correction to commmit 120863, make sure proper destructor function is called as well define two thread storage local variables.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-06 17:50:05 +00:00
Michiel van Baak 4dfea912d0 Make sure the nrfds and nefds are reset to NULL
before we enter manage_parkinglot.
This will get rid of CLI warnings like:
__ast_read: Exception flag set on 'SIP/<NUMBER>-<ID>', but no exception handler

(closes issue #12748)
Reported by: nreinartz
Patches:
      asterisk-multiparking_initialize_filedescr_sets-0.0.1.patch uploaded by nreinartz (license 452)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 19:10:31 +00:00
Jeff Peeler 1546f9662d Fixes segfault in parking, patch submitted by bmd.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-24 00:37:01 +00:00
Michiel van Baak f1e9371da8 - revert change to ast_queue_hangup and create ast_queue_hangup_with_cause
- make data member of the ast_frame struct a named union instead of a void

Recently the ast_queue_hangup function got a new parameter, the hangupcause
Feedback came in that this is no good and that instead a new function should be created.
This I did.

The hangupcause was stored in the seqno member of the ast_frame struct. This is not very
elegant, and since there's already a data member that one should be used.
Problem is, this member was a void *.
Now it's a named union so it can hold a pointer, an uint32 and there's a padding in case someone
wants to store another type in there in the future.

This commit is so massive, because all ast_frame.data uses have to be
altered to ast_frame.data.data

Thanks russellb and kpfleming for the feedback.

(closes issue #12674)
Reported by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 16:29:54 +00:00
Luigi Rizzo 18065a175d Use casts or intermediate variables to remove a number
of platform/compiler-dependent warnings when handing
struct timeval fields, both reading and printing them.

It is a lost battle to handle the different ways struct timeval
is handled on the various platforms and compilers, so try
to be pragmatic and go through int/long which are universally
supported.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-15 10:56:29 +00:00
Jeff Peeler 4729632721 Fixed a few problems with multiparking: call not being parked in the correct parking spot, caller not being notified of parking spot position, and improperly hanging up the call during a transfer due to timing out (not providing the extension in which to transfer).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 16:52:30 +00:00
Olle Johansson e30c26c689 Add support for playing an audio file for caller and callee at start and stop of monitoring (one-touch monitor).
Keep messages short, since the other party is waiting while one party hear the message...



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-12 18:39:09 +00:00
Kevin P. Fleming fc4390ac37 fix this logic to actually be correct... the fd can't be *both* -1 and an array index to be checked in rfds/efds (bug found by gcc-4.3)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-29 18:58:48 +00:00
Russell Bryant 34451e7c43 Merge code from team/russell/parking_updates
Add some additional features to the core park_call_full() function, and expose
them as options to the Park() application.  The functionality being added is the
ability to specify a custom return extension/context/priority, a custom timeout,
and a couple of options.  The options are to play ringing instead of MOH to the
parked caller, and to randomize parking spot selection.

(code inspired by the patch in AST-17, code from switchvox)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 18:18:27 +00:00
Jeff Peeler 41fd7a6a21 (closes issue #6113)
Reported by: oej
Tested by: jpeeler

This patch implements multiple parking lots for parked calls. The default parkinglot is used by default, however setting the channel variable PARKINGLOT in the dialplan will allow use of any other configured parkinglot. See configs/features.conf.sample for more details on setting up another non-default parkinglot. Also, one can (currently) set the default parkinglot to use in the driver configuration file via the parkinglot option.

Patch initially written by oej, brought up to date and finalized by mvanbaak, and then stabilized and converted to astobj2 by me.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-21 23:42:45 +00:00
Mark Michelson e409a129af Merged revisions 114063 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114063 | mmichelson | 2008-04-11 10:44:28 -0500 (Fri, 11 Apr 2008) | 11 lines

Fix a race condition that may happen between a sip hangup
and a "core show channel" command. This patch adds locking
to prevent the resulting crash.

(closes issue #12155)
Reported by: tsearle
Patches:
      show_channels_crash2.patch uploaded by tsearle (license 373)
Tested by: tsearle


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-11 15:49:35 +00:00
Jason Parker f5a151e525 Move AST_FEATURE_FLAG_* and FEATURE_RETURN_* to features.h so that they can be used by modules.
(closes issue #12384)
Reported by: fnordian
Patches:
      features.patch uploaded by fnordian (license 110)

(patch modified by me, to give FEATURE_RETURN_* an AST_ prefix)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@113452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 17:32:42 +00:00
Tilghman Lesher ef4eff9a9b Add the "config reload <conffile>" command, which allows you to tell Asterisk
to reload any file that references a given configuration file.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 18:39:06 +00:00
Terry Wilson b02bc230af Go through and fix a bunch of places where character strings were being interpreted as format strings. Most of these changes are solely to make compiling with -Wsecurity and -Wformat=2 happy, and were not
actual problems, per se.  I also added format attributes to any printf wrapper functions I found that didn't have them.  -Wsecurity and -Wmissing-format-attribute added to --enable-dev-mode.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 15:43:34 +00:00
Joshua Colp b84cdbfe38 Merged revisions 107646 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r107646 | file | 2008-03-11 16:20:01 -0300 (Tue, 11 Mar 2008) | 4 lines

Make sure the visible indication is on the right channel so when the masquerade happens the proper indication is enacted.
(closes issue #11707)
Reported by: iam

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107659 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 19:23:28 +00:00
Joshua Colp f26ed3f4bf Clarify comment about masquerading and playback of the parking slot.
(closes issue #12180)
Reported by: davidw


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 15:05:17 +00:00
Steve Murphy 377e51c4d4 (closes issue #6002)
Reported by: rizzo
Tested by: murf

Proposal of the changes to be made, and then an announcement of how they were accomplished:

http://lists.digium.com/pipermail/asterisk-dev/2008-February/032065.html

and:

http://lists.digium.com/pipermail/asterisk-dev/2008-March/032124.html

Here is a recap, file by file, of what I have done:

pbx/pbx_config.c
pbx/pbx_ael.c

All funcs that were passed a ptr to the context list, now will ALSO be passed a hashtab ptr to the same set.
Why? because (for the time being), the dialplan is stored in both, to facilitate a quick, low-cost move to
hash-tables to speed up dialplan processing. If it was deemed necessary to pass the context LIST, well, it
is just as necessary to have the TABLE available. This is because the list/table in question might not be
the global one, but temporary ones we would use to stage the dialplan on, and then swap into the global
position when things are ready.

We now have one external function for apps to use, "ast_context_find_or_create()" instead of the pre-existing
"find" and "create", as all existing usages used both in tandem anyway.

pbx_config, and pbx_ael, will stage the reloaded dialplan into local lists and tables, and 
then call merge_contexts_and_delete, which will merge (now) existing contexts and 
priorities from other registrars into this local set by copying them. Then, merge_contexts_and_delete will
lock down the contexts, swap the lists and tables, and unlock (real quick), and then 
destroy the old dialplan.



chan_sip.c
chan_iax.c
chan_skinny.c

All the channel drivers that would add regcontexts now use the ast_context_find_or_create now.

chan_sip also includes a small fix to get rid of warnings about removing priorities that never got entered.


apps/app_meetme.c
apps/app_dial.c
apps/app_queue.c

All the apps that added a context/exten/priority were also modified to use ast_context_find_or_create instead.


include/asterisk/pbx.h

ast_context_create() is removed. Find_or_create_ is the new method.
ast_context_find_or_create()  interface gets the hashtab added.
ast_merge_contexts_and_delete() gets the local hashtab arg added.
ast_wrlock_contexts_version() is added so you can detect if someone else got a writelock between your readlocking and writelocking.
ast_hashtab_compare_contexts was made public for use in pbx_config/pbx_ael
ast_hashtab_hash_contexts was in like fashion make public.


include/asterisk/pval.h

ast_compile_ael2() interface changed to include the local hashtab table ptr.


main/features.c

For the sake of the parking context, we use ast_context_find_or_create().



main/pbx.c

I changed all the "tree" names to "table" instead. That's because the original
implementation was based on binary trees. (had a free library). Then I moved
to hashtabs. Now, the names move forward too.

refcount field added to contexts, so you can keep track of how many modules
wanted this context to exist.

Some log messages that are warnings were inflated from LOG_NOTICE to LOG_WARNING.

Added some calls to ast_verb(3,...) for debug messages

Lots of little mods to ast_context_remove_extension2, which is now excersized in ways
it was not previously; one definite bug fixed.

find_or_create was upgraded to handle both local lists/tables as well as the globals.

context_merge() was added to do the per-context merging of the old/present contexts/extens/prios into the new/proposed local list/tables

ast_merge_contexts_and_delete() was heavily modified.

ast_add_extension2() was also upgraded to handle changes. 

the context_destroy() code was re-engineered to handle the new way of doing things,
by exten/prio instead of by context.



res/ael/pval.c
res/ael/ael.tab.c
res/ael/ael.tab.h
res/ael/ael.y
res/ael/ael_lex.c
res/ael/ael.flex
utils/ael_main.c
utils/extconf.c
utils/conf2ael.c
utils/Makefile

Had to change the interface to ast_compile_ael2(), to include the hashtab ptr.
This ended up involving several external apps.  The main gotcha was I had to 
include lock.h and hashtab.h in several places.


As a side note, I tested this stuff pretty thoroughly, I replicated the problems
originally reported by Luigi, and made triply sure that reloads worked, and everything
worked thru "stop gracefully". I found a and fixed a few bugs as I was merging into
trunk, that did not appear in my tests of bug6002.

How's this for verbose commit messages?




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 18:57:57 +00:00
Tilghman Lesher cfc1df4c1a Whitespace changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 23:04:29 +00:00
Terry Wilson 7d1891d5c3 Asterisk, when parking can drop rights a caller when a parking timeout occurs. Also, when doing built-in attended transfers, sometimes incorrectly passes rights from the transferrer to the transferee. This patch tries to fixes the parking issue and lays some groundwork for later fixing the transfer issue.
(closes issue #11520)
Reported by: pliew
Tested by: otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-01 01:30:37 +00:00
Jason Parker 5badb3c48a Merged revisions 104598 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104598 | qwell | 2008-02-27 11:26:55 -0600 (Wed, 27 Feb 2008) | 8 lines

Inherit language from the transfering channel on a blind transfer.

(closes issue #11682)
Reported by: caio1982
Patches:
      local_atxfer_lang3-1.4.diff uploaded by caio1982 (license 22)
Tested by: caio1982, victoryure

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 17:31:31 +00:00
Mark Michelson 9a9a4e9701 Remove more hardcoded pipe symbols and replace with commas.
(closes issue #12072)
Reported by: SimonSharman
Patches:
      features.patch uploaded by SimonSharman (license 410)
Tested by: SimonSharman



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-26 14:51:21 +00:00
Jason Parker 1663494073 Merged revisions 102858 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r102858 | qwell | 2008-02-07 13:53:55 -0600 (Thu, 07 Feb 2008) | 7 lines

Specify which digit string was matched in debug message.

(closes issue #11949)
Reported by: dimas
Patches:
      v1-feature-debug.patch uploaded by dimas (license 88)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-07 20:02:17 +00:00
Russell Bryant bcf72e1adb Merge rev 100626 from Asterisk 1.4. The svnmerge of this commit was a NoOp, since
res_features doesn't exist in trunk.  Thanks to qwell for pointing it out!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-28 18:41:23 +00:00
Joshua Colp 65e684653d Minor cosmetic change...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-24 20:32:05 +00:00
Jason Parker 32989872dd Move chan_local dependency into places (only one) that previously depended on res_features, and used local channels
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-24 16:14:07 +00:00
Jason Parker 3bd33214b9 Move code from res_features into (new file) main/features.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 23:09:11 +00:00