Commit Graph

558 Commits

Author SHA1 Message Date
Richard Mudgett ff2dc29d88 Merged revisions 279227 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r279227 | rmudgett | 2010-07-23 17:20:47 -0500 (Fri, 23 Jul 2010) | 21 lines
  
  Merged revisions 279207 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r279207 | rmudgett | 2010-07-23 17:11:23 -0500 (Fri, 23 Jul 2010) | 14 lines
    
    Merged revisions 279206 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r279206 | rmudgett | 2010-07-23 16:56:44 -0500 (Fri, 23 Jul 2010) | 7 lines
      
      SIP promiscuous redirect could fail to dial the redirect.
      
      The ast_channel was created with one variable to ast_request() but the
      call to ast_call() that initiates the outgoing call was using a different
      variable.  The two variables are not equivalent if the call_forward string
      included a channel technology specifier.  e.g., SIP/200
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@279245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-23 22:24:52 +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
Matthew Nicholson 759872902a Merged revisions 275027 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r275027 | mnicholson | 2010-07-09 11:04:21 -0500 (Fri, 09 Jul 2010) | 8 lines
  
  Clear the AST_CDR_FLAG_DIALED flag for channels going into the pbx via the G option in app_dial
  
  (closes issue #17592)
  Reported by: jamicque
  Patches:
        G-flag-cdr-fix1.diff uploaded by mnicholson (license 96)
  Tested by: jamicque, mnicholson
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 16:05:58 +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
Terry Wilson ffbb85bb4d Set app and appdata fields when a Dial is redirected
(closes issue #17204)
Reported by: one47
Tested by: twilson, one47


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-01 21:12:49 +00:00
Mark Michelson 70a1bf3142 Remove redundant ast_conntected_line_free call.
This wouldn't cause any problems, but it's certainly not needed either.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-26 20:17:54 +00:00
Richard Mudgett 3d1f005fed Dial and queue connected line update macro not always run when expected.
The connected line update macro would not get run if the connected line
number string was empty.  The number could be empty if the connected line
update did not update a number but the name.  It should be run if there
was an AST_CONTROL_CONNECTED_LINE frame received for pending dials and
queues.

Renamed and added some more comments for some confusing identifiers
directly connected to the related code.

Also fixed a memory leak in app_queue.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-20 19:40:03 +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
Mark Michelson e24661fd18 Merge Call completion support into trunk.
From Reviewboard:
CCSS stands for Call Completion Supplementary Services. An admittedly out-of-date
overview of the architecture can be found in the file doc/CCSS_architecture.pdf
in the CCSS branch. Off the top of my head, the big differences between what is
implemented and what is in the document are as follows:

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

This implements CCBS and CCNR in several flavors.

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

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

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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09 15:31:32 +00:00
Richard Mudgett a5a0a5f867 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229
ABE-2161

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-03 02:12:33 +00:00
Richard Mudgett 5333a48b17 Using the Dial application f option when the call is forwarded will likely crash.
Fix app_dial.c:do_forward() OPT_FORCECLID setting cid.cid_num with a stack
allocated string instead of a heap allocated string.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-03 01:42:32 +00:00
Leif Madsen 2de9cd0d38 Add documentation clarifying when 't' and 'T' can be used.
(closes issue #17021)
Reported by: kovzol
Tested by: lmadsen, kovzol, davidw, ebroad

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@255504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-31 17:48:09 +00:00
Russell Bryant 33aa72d592 Resolve compiler warnings on FreeBSD.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-20 11:43:08 +00:00
Richard Mudgett 73ef4b8daf Removed cdrflags from ast_channel structure.
Only chan_dahdi set a value in cdrflags.  Everyone else just copied it
around the system.  Noone cared about any value it may have contained.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 19:38:06 +00:00
Tilghman Lesher dd1c5f27ee Properly respect GOSUB_RESULT as to what to do with the master channel.
Previously, we would parse GOSUB_RESULT, but not actually do anything with it.
Also, allow GOSUB_RETVAL to be inherited back across a peer/master channel.

(closes issue #16687)
 Reported by: bklang
 Patches: 
       app_dial-preserve-gosub_retval.patch uploaded by bklang (license 919)
       (with modifications)

(closes issue #16686)
 Reported by: bklang
 Patches: 
       app_dial-respect-gosub_result.patch uploaded by bklang (license 919)
       (with modifications)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-02 20:32:29 +00:00
Mark Michelson 2fa64b3ad4 Mismerged a bit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05 20:56:50 +00:00
Mark Michelson c9d1ffcae8 Add a missing part of the connected line work into trunk.
Part of the work done for connected line was to add an optional
argument to the 'f' option to allow for the connected party information
of the outgoing channel to be set to the argument provided. This was
overlooked during the merge of the work to trunk and is being added
back now. The CHANGES file has also been updated to note this change.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05 18:46:19 +00:00
Alec L Davis 7537d3c0cb app_dial optional parameter to option 'r' to allow play indication from indications.conf
(closes issue #14504)
  Reported by: alecdavis
  Tested by: alecdavis,jsmith
  Patch
	 app_dial.play_ring_indications.diff7.txt uploaded by alecdavis (license 585)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-19 08:59:31 +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
Matthew Nicholson 317435a932 Added the 'a' option to app dial and modified app_dial to set the answertime when the called channel answers.
This change causes answertime to be correct even if the called channel hangs up during an announcement triggered by the A() option.

(closes issue #15936)
Reported by: falves11
Patches:
      dial-macro-billsec-fix1.diff uploaded by mnicholson (license 96)
      dial-caller-answer1.diff uploaded by mnicholson (license 96)
Tested by: falves11, mnicholson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 21:39:33 +00:00
Matthew Nicholson ed2ed2717a Merged revisions 227827 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r227827 | mnicholson | 2009-11-04 14:52:27 -0600 (Wed, 04 Nov 2009) | 10 lines
  
  This patch modifies the Dial application to monitor the calling channel for hangups while playing back announcements.
  
  (closes issue #16005)
  Reported by: falves11
  Patches:
        dial-announce-hangup-fix1.diff uploaded by mnicholson (license 96)
  Tested by: mnicholson, falves11
  
  Review: https://reviewboard.asterisk.org/r/407/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 21:03:33 +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
Joshua Colp 7a17d87740 Merged revisions 226889 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r226889 | file | 2009-11-02 14:08:11 -0400 (Mon, 02 Nov 2009) | 11 lines
  
  Fix a bug where the recorded privacy introduction file would not get removed if the caller hung up
  while the called party had not yet answered.
  
  This was fixed by introducing an argument to the 'n' option which, when enabled, removes the introduction
  file under all scenarios. This was done to preserve the behavior that has existed for quite some time.
  
  (closes issue #14674)
  Reported by: ulogic
  Patches:
        bug14674.patch uploaded by jpeeler (license 325)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-02 18:08:54 +00:00
Joshua Colp b7a50aeddc Merged revisions 224565 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224565 | file | 2009-10-19 16:47:50 -0300 (Mon, 19 Oct 2009) | 5 lines
  
  Do not attempt early media bridging (ie: direct RTP setup) if options are enabled that should prevent it.
  
  (closes issue #14763)
  Reported by: cupotka
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-19 19:49:09 +00:00
Jeff Peeler 832be82dfb Merged revisions 223804 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r223804 | jpeeler | 2009-10-12 18:12:50 -0500 (Mon, 12 Oct 2009) | 8 lines
  
  Ensure ringing continues for branched calls after progress is received
  
  While waiting for an answer, don't send progress for branched calls
  for which ringing was sent.
  
  (closes issue #15028)
  Reported by: fnordian
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-12 23:48:09 +00:00
Mark Michelson 66e993de95 Fix potential memory leaks.
ABE-1998



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-09 18:13:57 +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
Russell Bryant 0b2b01a1fa Merged revisions 208592 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r208592 | russell | 2009-07-24 13:38:24 -0500 (Fri, 24 Jul 2009) | 7 lines
  
  Do not log an ERROR if autoservice_stop() returns -1.
  
  This does not indicate an error.  A return of -1 just means that the channel
  has been hung up.
  
  (reported in #asterisk-dev)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-24 18:42:32 +00:00
Mark Michelson 5e51a6bb1e I AM A TERRIBLE PERSON
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-14 17:03:58 +00:00
Mark Michelson b25242a819 Reset the sentringing indication when redirects occur.
If a redirecting control frame is processed or a call forward occurs,
we need to reset the sentringing flag so that we can send another ringing
indication to the phone that may contain a connected line update.

AST-164



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-14 16:09:38 +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 12ff77f975 Global var cleanup - constification and removing unused vars.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-07 14:55:51 +00:00
David Vossel c42344b319 ast_call_forward() todo notes and originate flag copy.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-03 20:30:10 +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
Sean Bright 9241877c10 Merged revisions 198251 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r198251 | seanbright | 2009-05-29 22:46:41 -0400 (Fri, 29 May 2009) | 8 lines
  
  Treat an empty FORWARD_CONTEXT the same way we treat a missing one.
  
  (closes issue #15056)
  Reported by: p_lindheimer
  Patches:
        05292009_bug15056.diff uploaded by seanbright (license 71)
  Tested by: p_lindheimer
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-30 03:26:06 +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 8139c8ed4e Plug a memory leak in app_dial.
Since we may have copied connected line info into the chanlist struct prior
to placing an outbound call, we need to be sure to free the allocated data
when we hang the call up.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-20 20:14:28 +00:00
Eliel C. Sardanons d24179825f Warn about the use of the application WaitExten() within a Macro().
Update applications documentation to warn the user about the use of the
WaitExten() application within a Macro(). Recommend the use of Read()
instead.

(closes issue #14444)
Reported by: ewieling


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 14:45:23 +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
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
Terry Wilson 7164958d9d Merged revisions 189465 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r189465 | twilson | 2009-04-20 16:10:27 -0500 (Mon, 20 Apr 2009) | 2 lines
  
  Update CDR appropriately when AST_CAUSE_NO_ANSWER is set
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@189516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 21:29:29 +00:00
Terry Wilson f505cb43bf Merged revisions 189463 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r189463 | twilson | 2009-04-20 16:00:52 -0500 (Mon, 20 Apr 2009) | 2 lines
  
  Don't treat a NOANSWER like a CHANUNAVAIL
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@189495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 21:24:34 +00:00
Mark Michelson fd833f14ed Make the cancellation of the dial timeout on a call forward optional.
This introduces the 'z' option to app_dial. With it set, a call forward
will cancel any timeout originally set for this instance of the Dial
application.

AST-207



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-15 15:24:50 +00:00
Mark Michelson df28954a84 Make sure tc is unlocked before calling ast_call since calling a Local
channel could result in a deadlock.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 17:32:25 +00:00
David Vossel bd23adbc8a Even more changes concerning r187426. Revised where locks are placed yet once again. ast_call() should not be called with a channel locked. could cause deadlock issues with local channels.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 15:49:16 +00:00
David Vossel e6052e79d0 More changes concerning r187426. Revised where locks are placed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 20:40:34 +00:00
Jeff Peeler de4af72f9f Add ability for dialplan execution to continue when caller hangs up.
The F option to app_dial has been modified to accept no parameters and perform
the above functionality. I don't see anywhere else that is doing function
overloading, but this really is the best place for this operation because:

- It makes it close to the 'g' option in the argument list which provides
similar functionality.
- The existing code to support the current F option provides a very
convienient location to add this new feature.

(closes issue #12381)
Reported by: michael-fig



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 19:10:02 +00:00
David Vossel 19f381b484 Fixes deadlock caused by calling get_cid_name with chan locked.
get_cid_name should not be called with a channel lock.  get_cid_name calls ast_get_hint which eventually calls pbx_find_extension.  pbx_find_extension starts and stops autoservice which should not be done with a channel lock, so get_cid_name should not be called with one.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 17:39:10 +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
Joshua Colp 63de834395 Merge in the RTP engine API.
This API provides a generic way for multiple RTP stacks to be
integrated into Asterisk. Right now there is only one present, res_rtp_asterisk,
which is the existing Asterisk RTP stack. Functionality wise this commit
performs the same as previously. API documentation can be viewed in the
rtp_engine.h header file.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 17:20:52 +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
David Vossel e559cae4ec Option to send DTMF when receiving PROGRESS status
The D() option in app_dial is only able to send DTMF after the call has been answered.  A progress option has been added to D() to allow DTMF to be sent upon receiving PROGRESS.  This allows DTMF to be sent before the call is answered.

(closes issue #12123)
Reported by: VoipForces
Patches:
	app_dial.c_patch_trunk_valid uploaded by VoipForces (license 419)
	dtmf_progress.patch uploaded by dvossel (license 671)
Tested by: VoipForces, dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-17 17:17:51 +00:00
Joshua Colp 499ca8de65 Fix crash when sleep and retries argument was not given to RetryDial application.
(closes issue #14647)
Reported by: sherpya


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 13:24:12 +00:00
Joshua Colp 15090ba1df Remove duplicate 'k' and 'K' Dial options.
(closes issue #14601)
Reported by: alecdavis
Patches:
      app_dial.optionk.diff.txt uploaded by alecdavis (license 585)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-04 14:39:28 +00:00
Mark Michelson 47ebea6a8d Fix 'd' option for app_dial and add new option to Answer application
The 'd' option would not work for channel types which use RTP to transport
DTMF digits. The only way to allow for this to work was to answer the channel
if we saw that this option was enabled.

I realized that this may cause issues with CDRs, specifically with giving false
dispositions and answer times. I therefore modified ast_answer to take another
parameter which would tell if the CDR should be marked answered.

I also extended this to the Answer application so that the channel may be answered
but not CDRified if desired.

I also modified app_dictate and app_waitforsilence to only answer the channel if it
is not already up, to help not allow for faulty CDR answer times.

All of these changes are going into Asterisk trunk. For 1.6.0 and 1.6.1, however, all
the changes except for the change to the Answer application will go in since we do
not introduce new features into stable branches

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

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-11 22:41:01 +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
Olle Johansson 7ecda45482 Fix "cancel answered elsewhere" through app_queue with members in chan_local.
Also, implement a private cause code (as suggested by Tilghman). This works with
chan_sip, but doesn't propagate through chan_local.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-29 17:08:22 +00:00
Joshua Colp 665bba38f1 Merged revisions 170568 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r170568 | file | 2009-01-23 15:06:54 -0400 (Fri, 23 Jan 2009) | 4 lines
  
  When a call is forwarded stop any active indications. The new channel will provide an indication, if need be, itself.
  (closes issue #14310)
  Reported by: RadicAlish
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@170569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 19:09:18 +00:00
Terry Wilson c37aa68d77 Set peer context and exten values so MACRO_EXTEN and MACRO_CONTEXT will be set
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@167935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-09 00:13:12 +00:00
Mark Michelson ff20b9116a Update app_queue to deal with the removal of AST_PBX_KEEPALIVE
When placing a call to a queue which ran a gosub on the member's
channel, Asterisk would crash every time, stemming from the fact
that the member's channel was being hung up unexpectedly when the
Gosub completed. The necessary change was pretty much copied and
pasted from app_dial's similar changes made last week.

I also took the opportunity to change a LOG_DEBUG message in
app_dial to use ast_debug. I am guessing this was due to a direct
merge from 1.4 that was not corrected to use trunk's preferred
syntax.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-29 18:04:52 +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 50a25ac847 Remove the need for AST_PBX_KEEPALIVE with the GoSub option from Dial.
This is part of an effort to completely remove AST_PBX_KEEPALIVE and other
similar return codes from the source.  While this usage was perfectly safe,
there are others that are problematic.  Since we know ahead of time that
we do not want to PBX to destroy the channel, the PBX API has been changed
so that information can be provided as an argument, instead, thus removing
the need for the KEEPALIVE return value.

Further changes to get rid of KEEPALIVE and related code is being done by
murf.  There is a patch up for that on review 29.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 19:33:42 +00:00
Mark Michelson a53877b469 Add some safety measures when using gosub, especially when using the options
for app_dial and app_queue to run a gosub when the call is answered.

* Check for the existence of the gosub target in gosub_exec. If it is nonexistent,
  then this will cause errors when we attempt to actually run the gosub, including
  a definite memory leak and potential crashes. Return an error in this situation
* Check the return value of pbx_exec in app_dial and app_queue before attempting
  to actually run the gosub routine. If there was an error, we should not attempt
  to run the gosub.
* Change a '|' to a ',' in app_queue.
* Add some extra curly braces where they had been missing previously.

(closes issue #13548)
Reported by: fiddur



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 18:37:46 +00:00
Mark Michelson 5cf09591b0 Add some necessary hangup commands in the case that forwarding
a call fails

1) Hang up the original destination if the local channel cannot
   be requested.
2) Hang up the local channel (in addition to the original destination)
   if ast_call fails when calling the newly created local channel.

This prevents channels from sticking around forever in the
case of a botched call forward (e.g. to an extension which does not
exist).

(closes issue #13764)
Reported by: davidw
Patches:
      13764_v2.patch uploaded by putnopvut (license 60)
Tested by: putnopvut, davidw



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-26 19:57:11 +00:00
Mark Michelson 7a554a7386 Merged revisions 158053 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r158053 | mmichelson | 2008-11-20 11:33:06 -0600 (Thu, 20 Nov 2008) | 12 lines

Make sure to set the hangup cause on the calling channel in the case
that ast_call() fails. For incoming SIP channels, this was causing
us to send a 603 instead of a 486 when the call-limit was reached on
the destination channel.

(closes issue #13867)
Reported by: still_nsk
Patches:
      13867.diff uploaded by putnopvut (license 60)
Tested by: blitzrage


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 17:39:06 +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
Tilghman Lesher 1287486dbf Can't use items duplicated off the stack frame in an element returned from
a function: in these cases, we have to use the heap, or garbage will result.
(closes issue #13898)
 Reported by: alecdavis
 Patches: 
       20081114__bug13898__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: alecdavis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-17 22:25:06 +00:00
Tilghman Lesher 10afda33c7 Merged revisions 156386 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r156386 | tilghman | 2008-11-12 15:18:57 -0600 (Wed, 12 Nov 2008) | 5 lines
  
  When using call limits under 1 second, infinite call lengths are allowed,
  instead.
  (closes issue #13851)
   Reported by: ruddy
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 21:34:51 +00:00
Mark Michelson a9e84c1e51 Merged revisions 156167 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r156167 | mmichelson | 2008-11-12 11:38:33 -0600 (Wed, 12 Nov 2008) | 7 lines

When doing some tests, I was having a crash at the end of every call
if an attended transfer occurred during the call. I traced the cause to
the CDR on one of the channels being NULL. murf suggested a check in
the end bridge callback to be sure the CDR is non-NULL before proceeding,
so that's what I'm adding.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:41:56 +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
Kevin P. Fleming bd4eb070f3 bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 branch, and add the ones needed for all the new code here too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 18:52:13 +00:00
Russell Bryant 6f314f4d42 Fix various spelling and grammatical issues in documentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 02:50:33 +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
Steve Murphy d736ac2b19 Merged revisions 152538 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r152538 | murf | 2008-10-28 23:19:04 -0600 (Tue, 28 Oct 2008) | 14 lines

A little documentation cross-ref between features and
dial and queue... I wasted some time (stupidly) trying
to get the one-touch parking stuff working, because it
didn't occur to me that I had to also have the corresponding
options in the dial command! Duh! (In all this time, I never
set this up before!)
So, to keep some poor fool from suffering the same fate,
I made the features.conf.sample file mention the corresponding
opts in dial/queue; and the docs for dial/app specifically
mention the corresponding decls in the feature.conf file.

I hope this doesn't spoil some vast, eternal plan...


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:47:13 +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
Tilghman Lesher dd049d429d Merged revisions 152368 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r152368 | tilghman | 2008-10-28 12:04:56 -0500 (Tue, 28 Oct 2008) | 8 lines
  
  Reset all DIAL variables back to blank, in case Dial is called multiple times
  per call (which could otherwise lead to inconsistent status reports).
  (closes issue #13216)
   Reported by: ruddy
   Patches: 
         20081014__bug13216.diff.txt uploaded by Corydon76 (license 14)
   Tested by: ruddy
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-28 17:07:39 +00:00
Mark Michelson dc36a357d2 When specifying an invalid timeout to Dial, take it
to mean that no timeout is desired.

(closes issue #13625)
Reported by: atis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 23:57:46 +00:00
Sean Bright d1f257ba53 Move the DAHDI-to-DAHDI operator mode check from app_dial into chan_dahdi
so we don't have to hardcode anything.

(closes issue #13636)
Reported by: seanbright
Patches:
      13636.diff uploaded by seanbright (license 71)
Reviewed by: russellb, putnopvut


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-07 21:34:44 +00:00
Sean Bright 61664ec58b Make sure to compare the correct number of characters when special-casing
our DAHDI operator mode stuff.  Technically, it would work fine, as 'DAH'
is currently unique amongst our channel technologies, but as Jared points
out:

  <@jsmith> Sure... as long as the technology starts whith DAH.... but
            it could be DAHDOO!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-07 12:01:36 +00:00
Tilghman Lesher 8fbee1307c Repair IAXVAR implementation so that it works again (regression?)
(closes issue #13354)
 Reported by: adomjan
 Patches: 
       20080828__bug13354.diff.txt uploaded by Corydon76 (license 14)
       20080829__bug13354__1.6.0.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, adomjan


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@143031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-13 13:54:15 +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 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
Sean Bright 3ffb39833b More RSW merges. Everything from apps/ except for the big offenders
app_voicemail and app_queue.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-10 14:45:25 +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
Kevin P. Fleming 7df8b8b848 make datastore creation and destruction a generic API since it is not really channel related, and add the ability to add/find/remove datastores to manager sessions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05 16:56:11 +00:00
Mark Michelson bd1bb0d0e2 Merged revisions 130792 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r130792 | mmichelson | 2008-07-14 12:50:21 -0500 (Mon, 14 Jul 2008) | 8 lines

Add a check to the CAN_EARLY_BRIDGE macro in app_dial to
be sure there are no audiohooks present on the channels
involved. This fixed a one-way audio situation I had in
my test setup. I couldn't find any open issues that suggested
one-way audio with regards to mixmonitor (or other audiohook)
usage, though.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-14 17:54:11 +00:00
Tilghman Lesher da03cdd174 Merged revisions 129149 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r129149 | tilghman | 2008-07-08 15:27:47 -0500 (Tue, 08 Jul 2008) | 8 lines

Cause SIP to return a 480 instead of a 404 when a sip peer exists, but is not
registered.
(closes issue #12885)
 Reported by: ibc
 Patches: 
       20080701__bug12885__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: ibc

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 20:30:29 +00:00
Kevin P. Fleming da14954bdc another minor ast_channel memory size decrease... for nearly all channels, 'dialcontext' is only going to be set once during the channel's lifetime, so make it a string field instead of a char array
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 16:16:36 +00:00
Mark Michelson 0178d0ccd6 Improve consistency between app_dial and app_queue with regards
to how language is handled between two channels whose native
language is different. Prior to this patch, app_dial would have
the callee inherit the caller's language, and app_queue would not.

After this patch, app_dial no longer has the language inheritance
capability. This seems to make the most sense since it seems more
natural for a person to hear files played back in his/her native
language instead of the language of the person on the far end of
the call. See the CHANGES file for hints on how to keep the 
previous behavior of app_dial if desired.

(closes issue #12489)
Reported by: bcnit



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 23:35:29 +00:00
Tilghman Lesher 90867b2b0c Channel lock janitor -- add locks around retrieval of channel variables
(closes issue #12840)
 Reported by: pputman
 Patches: 
       app_dial_threadsafe3.patch uploaded by pputman (license 81)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-18 13:09:02 +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 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
Russell Bryant db5f489865 Merged revisions 119530 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r119530 | russell | 2008-06-01 20:03:22 -0500 (Sun, 01 Jun 2008) | 2 lines

Fix another typo in documentation

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119531 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 01:04:01 +00:00
Michiel van Baak 0da2734cb5 Merged revisions 119478 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r119478 | mvanbaak | 2008-06-01 22:47:55 +0200 (Sun, 01 Jun 2008) | 2 lines

small typo fix 'retires' => 'retries'

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-01 21:06:27 +00:00
Tilghman Lesher c7191467d2 Add native AGI command GOSUB, as invoking Gosub with EXEC does not work
properly.
(closes issue #12760)
 Reported by: Corydon76
 Patches: 
       20080530__bug12760.diff.txt uploaded by Corydon76 (license 14)
 Tested by: tim_ringenbach, Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30 16:10:46 +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
Tilghman Lesher b5a127daac Modify TIMEOUT() to be accurate down to the millisecond.
(closes issue #10540)
 Reported by: spendergrass
 Patches: 
       20080417__bug10540.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-01 23:06:23 +00:00
Tilghman Lesher 6a81da594d Add incomplete matching to PBX code and app_dial
(closes issue #12351)
 Reported by: Corydon76
 Patches: 
       20080402__pbx_incomplete__3.diff.txt uploaded by Corydon76 (license 14)
       pbx_incomplete_with_timeout.diff uploaded by fabled (license 448)
 Tested by: Corydon76, fabled


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-28 16:37:45 +00:00
Tilghman Lesher 463a5dbd0a Whitespace changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 20:20:10 +00:00
Michiel van Baak 08e674bce0 Pass the hangup cause all the way to the calling app/channel.
(closes issue #11328)
Reported by: rain
Patches:
      20071207__pass_cause_in_hangup_control_frame.diff.txt uploaded by Corydon76 (license 14)
brought up-to-date to trunk by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 22:16:48 +00:00
Mark Michelson df7cb6b30b Merged revisions 114112 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114112 | mmichelson | 2008-04-14 11:24:22 -0500 (Mon, 14 Apr 2008) | 9 lines

If the datastore has been moved to another channel due to a masquerade, then
freeing the datastore here causes an eventual double free when the new channel
hangs up. We should only free the datastore if we were able to successfully remove
it from the channel we are referencing (i.e. the datastore was not moved).

(closes issue #12359)
Reported by: pguido


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-14 16:25:09 +00:00
Tilghman Lesher 1c691646a9 Permit callee to continue in the dialplan, after caller has hung up.
(closes issue #11954)
 Reported by: johan
 Patches: 
       app_dial_rev104031.patch uploaded by johan (license 334)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@113649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09 13:55:28 +00:00
Mark Michelson 5176911dfe Remove some redundant logic from wait_for_answer. This also let's us get rid of one of
those XXX comments from the code.

The redundancy occurs because the 'single' flag implies that the 'r' and 'm' flags are
not set, so there's no need to explicitly check them again.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 15:59:32 +00:00
Joshua Colp af7e1964f2 Merged revisions 107016 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r107016 | file | 2008-03-10 11:33:02 -0300 (Mon, 10 Mar 2008) | 7 lines

Move where unanswered CDRs are dropped to the CDR core, not everything uses app_dial.
(closes issue #11516)
Reported by: ys
Patches:
      branch_1.4_cdr.diff uploaded by ys (license 281)
Tested by: anest, jcapp, dartvader

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 14:36:16 +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
Joshua Colp 496adc6fc0 Merged revisions 106235 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r106235 | file | 2008-03-05 18:32:10 -0400 (Wed, 05 Mar 2008) | 4 lines

Add a control frame to indicate the source of media has changed. Depending on the underlying technology it may need to change some things.
(closes issue #12148)
Reported by: jcomellas

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 22:43:22 +00:00
Tilghman Lesher 8a411ccf83 Create a centralized configuration option for silencethreshold
(closes issue #11236)
 Reported by: philipps
 Patches: 
       20080218__bug11236.diff.txt uploaded by Corydon76 (license 14)
 Tested by: philipps


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 16:23:44 +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
Michiel van Baak 4dccb58fb7 whitespace fixes only.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-09 11:27:10 +00:00
Mark Michelson fe9821cc10 Get rid of any remaining ast_verbose calls in the code in favor of
ast_verb

(closes issue #11934)
Reported by: mvanbaak
Patches:
      20080205_astverb-2.diff.txt uploaded by mvanbaak (license 7)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-05 23:00:15 +00:00
Olle Johansson cc648a40ae Merged revisions 99592 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r99592 | oej | 2008-01-22 18:31:17 +0100 (Tis, 22 Jan 2008) | 5 lines

Add dependency on chan_local to app_dial.

Dial still runs without chan_local, but will be missing forwarding functionality.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-22 17:42:27 +00:00
Tilghman Lesher d5b454bf8d Convert ast_verbose to ast_verb.
Reported by: snuffy
Patch by: snuffy
(Closes issue #11547)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 14:48:38 +00:00
Tilghman Lesher 99308dfb4e Conversions of free to ast_free, where applicable, and several other formatting fixes.
Reported by: eliel
Patch by: eliel,tilghman
(Closes issue #11209)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-12 20:05:13 +00:00
Russell Bryant 3a4d1c852b Merged revisions 91783 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r91783 | russell | 2007-12-07 10:38:48 -0600 (Fri, 07 Dec 2007) | 6 lines

* Add channel locking around datastore operations that expect the channel
  to be locked.
* Document why we don't record Local channels in the dialed interfaces list.
* Remove the dialed variable as it isn't needed.
* Restructure some code for clarity and coding guidelines stuff

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 16:40:41 +00:00
Russell Bryant 547083e21a Merged revisions 91693 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r91693 | russell | 2007-12-06 20:51:22 -0600 (Thu, 06 Dec 2007) | 2 lines

Don't unlock the dialed_interfaces list until we're done messing with the iterator.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 02:52:38 +00:00
Russell Bryant c72fa81580 Merged revisions 91677 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r91677 | russell | 2007-12-06 20:38:40 -0600 (Thu, 06 Dec 2007) | 4 lines

Allow dialing local channels from Queue() and Dial() again.  There was a slight
flaw in the code to prevent call forwards from looping that caused this problem.
(related to issue #11486)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 02:43:21 +00:00
Olle Johansson 807d5e1ef7 - Dial event
- Event Dial has new headers, to comply with other events
        - Source        -> Channel              Channel name (caller)
        - SrcUniqueID   -> UniqueID             Uniqueid
        (new)           -> Dialstring           Dialstring in app data


(moremanager)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-06 15:04:34 +00:00
Mark Michelson b32e39cbda Merged revisions 91273 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r91273 | mmichelson | 2007-12-05 16:35:52 -0600 (Wed, 05 Dec 2007) | 11 lines

The 'G' option for Dial() did not properly handle the case where only a label was
provided. This was due to the fact that the answering channel did not have an extension
set, so ast_parseable_goto would fail. This fix eliminates the call to ast_parseable_goto
on the answering channel since it is a wasteful call. The answering channel and the calling
channel are both directed to the same extension and context, just different priorities, so
we can just copy the values from the calling channel to the answering channel and increment
the answering channel's priority.

(closes issue #11382, reported by jon, patch by me with correction by jon)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-05 22:55:49 +00:00
Jason Parker 814a7f66c0 Fix build in trunk. This was fixed in 1.4, but blocked in trunk since this hadn't been merged yet.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-04 17:35:40 +00:00
Mark Michelson c52d8a1cd5 Merged revisions 90735 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r90735 | mmichelson | 2007-12-03 17:12:17 -0600 (Mon, 03 Dec 2007) | 22 lines

A big one...

This is the merge of the forward-loop branch. The main change here is that call-forwards can no longer loop.
This is accomplished by creating a datastore on the calling channel which has a linked list of all devices
dialed. If a forward happens, then the local channel which is created inherits the datastore. If, through this
progression of forwards and datastore inheritance, a device is attempted to be dialed a second time, it will simply
be skipped and a warning message will be printed to the CLI. After the dialing has been completed, the datastore
is detached from the channel and destroyed.

This change also introduces some side effects to the code which I shall enumerate here:

1. Datastore inheritance has been backported from trunk into 1.4
2. A large chunk of code has been removed from app_dial. This chunk is the section of code
   which handles the call forward case after the channel has been requested but before it has
   been called. This was removed because call-forwarding still works fine without it, it makes the
   code less error-prone should it need changing, and it made this set of changes much less painful
   to just have the forwarding handled in one place in each module.
3. Two new files, global_datastores.h and .c have been added. These are necessary since the datastore
   which is attached to the channel may be created and attached in either app_dial or app_queue, so they
   need a common place to find the datastore info. This approach was taken in case similar datastores are
   needed in the future, there will be a common place to add them.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-04 17:08:36 +00:00
Joshua Colp 4201a5af8b Remove the file descriptors from the main poll channel when the channel is hung up during the dialing attempt, and make sure a channel exists before trying to remove it at the end.
(closes issue #11441)
Reported by: blitzrage


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 14:14:43 +00:00
Mark Michelson 6b08c442c7 Adding support for the "automixmonitor" dial and queue options.
This works in much the same way as the automonitor, except that instead of using the monitor
app, it uses the mixmonitor app. By providing an 'x' or 'X' as a dial or queue option, a DTMF
sequence may be entered (as defined in features.conf) to start the one-touch mixmonitor.

This patch also introduces some new API calls to the audiohooks code for searching for an audiohook
by type and for searching for a running audiohook by type.

Big thanks to joetester for writing the initial patch, testing it and patiently waiting for it to 
be committed.

(closes issue #10185, reported and patched by xmarksthespot)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-30 21:19:57 +00:00
Steve Murphy 4d8932a6dc Merged revisions 89622 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89622 | murf | 2007-11-26 23:24:02 -0700 (Mon, 26 Nov 2007) | 1 line

closes issue #11379; OK, this is an attempt to make both sides happy. To the cdr.conf file, I added the option 'unanswered', which defaults to 'no'. In this mode, you will see a cdr for a call, whether it was answered or not. The disposition will be NO ANSWER or ANSWERED, as appropriate. The src is as you'd expect, the destination channel will be one of the channels from the Dial() call, usually the last in the list if more than one chan was specified. With unanswered set to 'yes', you will still see this cdr entry in both cases. But in the case where the dial timed out, you will also see a cdr for each line attempted, marked NO ANSWER, with no destination channel name. The new option defaults to 'no', so you don't see the pesky extra cdr's by default, and you will not see the irritating 'not posted' messages.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 06:47:08 +00:00
Steve Murphy 86476c607f closes issue #11285, where an unload of a module that creates a dialplan context, causes a crash when you do a 'dialplan show' of that context. This is because the registrar string is defined in the module, and the stale pointer is traversed. The reporter offered a patch that would always strdup the registrar string, which is practical, but I preferred to destroy the created contexts in each module where one is created. That seemed more symmetric. There were only 6 place in asterisk where this is done: chan_sip, chan_iax2, chan_skinny, res_features, app_dial, and app_queue. The two apps destroyed the context, but left the contexts. All is fixed now and unloads should be dialplan friendly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:54:12 +00:00
Luigi Rizzo 7e8835e0d7 remove another set of redundant #include "asterisk/options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:24:55 +00:00
Luigi Rizzo a23c055c3d move asterisk/paths.h outside asterisk.h and into those files
who really need it.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 23:16:15 +00:00
Luigi Rizzo 0595b5e2aa include "logger.h" and errno.h from asterisk.h - usage shows that they
were included almost everywhere.
Remove some of the instances.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 18:52:04 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Russell Bryant 0df5e50e97 Use BEGIN_OPTIONS / END_OPTIONS to make the syntax highlighting in my editor happy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14 01:40:47 +00:00
Steve Murphy 63f2f04cf4 This commits the performance mods that give the priority processing engine in the pbx, a 25-30% speed boost. The two updates used, are, first, to merge the ast_exists_extension() and the ast_spawn_extension() where they are called sequentially in a loop in the code, into a slightly upgraded version of ast_spawn_extension(), with a few extra args; and, second, I modified the substitute_variables_helper_full, so it zeroes out the byte after the evaluated string instead of demanding you pre-zero the buffer; I also went thru the code and removed the code that zeroed this buffer before every call to the substitute_variables_helper_full. The first fix provides about a 9% speedup, and the second the rest. These figures come from the 'PIPS' benchmark I describe in blogs, conf. reports, etc.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 22:26:51 +00:00
Matthew Fredrickson a4be521c89 Make sure we propogate ANI2 to the outbound channel
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-11 22:42:44 +00:00
Tilghman Lesher 7adbd6bb16 Remove redundant includes (patch by snuffy) (Closes issue #10922)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-09 16:04:41 +00:00
Russell Bryant bff784d509 Merged revisions 84166 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r84166 | russell | 2007-10-01 09:24:49 -0500 (Mon, 01 Oct 2007) | 2 lines

Simplify the CAN_EARLY_BRIDGE macro a bit.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 14:27:02 +00:00
Joshua Colp 3ed4d505b7 Merged revisions 84158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r84158 | file | 2007-10-01 10:49:36 -0300 (Mon, 01 Oct 2007) | 4 lines

Only attempt early bridging if the options given to Dial() permit it.
(closes issue #10861)
Reported by: peekyb

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 13:53:09 +00:00
Russell Bryant 9388173f85 Make the MALLOC_DEBUG output for free() useful again. After changing calls to
free to be ast_free, astmm said all calls to free were coming from utils.h


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 18:57:56 +00:00
Jason Parker 836c550ce3 Merged revisions 81412 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

(closes issue #10621)
........
r81412 | qwell | 2007-08-31 13:44:44 -0500 (Fri, 31 Aug 2007) | 4 lines

Re-order dial options to be in line with the existing alpha order.

Issue 10621, initial patch by junky

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 18:46:02 +00:00
Joshua Colp 22114b509d Add support for using epoll instead of poll. This should increase scalability and is done in such a way that we should be able to add support for other poll() replacements.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08 21:44:58 +00:00
Joshua Colp 9ef1b0a974 Extend the ast_senddigit and ast_dtmf_stream API calls to allow the duration of the DTMF digit(s) to be specified and make the SendDTMF application have the capability to use it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 21:52:30 +00:00
Russell Bryant 4e0947c5f1 Convert code that checks the _softhangup member of ast_channel directory to use
the ast_check_hangup() funciton.  This function takes scheduled hangups into
account.
(closes issue #10230, patch by Juggie)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 15:39:54 +00:00
Steve Murphy ceca4d97e1 These fixes take care of two problems: a complaint in asterisk-dev that goto's aren't working in trunk, a side effect of the move to commas as arg seps in apps and funcs; and a problem I spotted myself with dial's 'e' option, where gotos were off by one, because I forgot to set the AUTOLOOP flag in the peer channel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27 15:46:20 +00:00
Russell Bryant f8483a0d04 Do a massive conversion for using the ast_verb() macro
(closes issue #10277, patches by mvanbaak)

Basically, this changes ...

if (option_verbose > 2)
   ast_verbose(VERBOSE_PREFIX_3, "Something\n");

to ...

ast_verb(3, "Something\n");


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 15:49:18 +00:00
Tilghman Lesher 55b1ee298e Merge the dialplan_aesthetics branch. Most of this patch simply converts applications
using old methods of parsing arguments to using the standard macros.  However, the big
change is that the really old way of specifying application and arguments separated by
a comma will no longer work (e.g. NoOp,foo|bar).  Instead, the way that has been
recommended since long before 1.0 will become the only method available (e.g. NoOp(foo,bar).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 19:51:41 +00:00
Steve Murphy 0e969271ae After some study, thought, comparing, etc. I've backed out the previous universal mod to make ast_flags a 64 bit thing. Instead, I added a 64-bit version of ast_flags (ast_flags64), and 64-bit versions of the test-flag, set-flag, etc. macros, and an app_parse_options64 routine, and I use these in app_dial alone, to eliminate the 30-option limit it had grown to meet. There is room now for 32 more options and flags. I was heavily tempted to implement some of the other ideas that were presented, but this solution does not intro any new versions of dial, doesn't have a different API, has a minimal/zero impact on code outside of dial, and doesn't seriously (I hope) affect the code structure of dial. It's the best I can think of right now. My goal was NOT to rewrite dial. I leave that to a future, coordinated effort.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19 23:24:27 +00:00
Mark Michelson ee6d59eef2 Merged revisions 75405 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r75405 | mmichelson | 2007-07-17 15:03:48 -0500 (Tue, 17 Jul 2007) | 6 lines

Fixing an error I made earlier. ast_fileexists can return -1 on failure, so I need to be sure that we only enter the if
statement if it is successful.

Related to my fix to issue #10186


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:05:19 +00:00
Steve Murphy 8a7732f067 via 10206, I have added an option (e) to Dial to allow the h exten to get run on peer. Had to upgrade ast_flag stuff to 64 bits to do this.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 19:40:29 +00:00
Jason Parker 766121a5bc Fix an incorrect parenthesization (TODO: Find a better word) in app_dial
Pointed out by Fanzhou Zhao

Closes issue #10216


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 12:01:05 +00:00