Commit Graph

332 Commits

Author SHA1 Message Date
Russell Bryant 97bb26bf75 Merged revisions 233092 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r233092 | russell | 2009-12-04 11:12:47 -0600 (Fri, 04 Dec 2009) | 7 lines
  
  Only do frame payload check for HOLD frames.
  
  This code was added for helping to debug the source of invalid HOLD frames.
  However, a side effect of this is that it will incorrectly report errors for
  frames that have an integer payload.  Make the check for this block specific
  to the HOLD frame case.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-04 17:18:22 +00:00
Jeff Peeler d9f37a67e1 Merged revisions 231911 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231911 | jpeeler | 2009-12-01 15:29:31 -0600 (Tue, 01 Dec 2009) | 12 lines
  
  Fix crash with invalid frame data
  
  The crash was happening as a result of a frame containing an invalid data
  pointer, but was set with data length of zero. The few times the issue was
  reproduced it _seemed_ that the frame was queued properly, that is the data
  pointer was set to NULL. I never could reproduce the crash so as a last resort
  the crash has been fixed, but a check in __ast_read has been added to give as
  much information about the source of problematic frames in the future.
  
  (closes issue #16058)
  Reported by: atis
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 21:54:21 +00:00
Tilghman Lesher f98c12a57d Merged revisions 231298 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231298 | tilghman | 2009-11-25 16:31:57 -0600 (Wed, 25 Nov 2009) | 2 lines
  
  After a frame duplication failure, unlock the channel before returning.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-25 22:33:02 +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
Leif Madsen fef304e641 Merged revisions 228896 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228896 | lmadsen | 2009-11-09 09:37:43 -0600 (Mon, 09 Nov 2009) | 6 lines
  
  Update WARNING message.
  Update a WARNING message to give a suggested fix when encountered.
  
  (closes issue #16198)
  Reported by: atis
  Tested by: atis
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-09 15:38:38 +00:00
David Vossel 10fa8fe8d0 Merged revisions 228692 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228692 | dvossel | 2009-11-06 16:33:27 -0600 (Fri, 06 Nov 2009) | 9 lines
  
  fixes audiohook write crash occuring in chan_spy whisper mode.
  
  After writing to the audiohook list in ast_write(), frames
  were being freed incorrectly.  Under certain conditions this
  resulted in a double free crash.
  
  (closes issue #16133)
  Reported by: wetwired

  (closes issue #16045)
  Reported by: bluecrow76
  Patches:
        issue16045.diff uploaded by dvossel (license 671)
  Tested by: bluecrow76, dvossel, habile
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 22:35:44 +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
Richard Mudgett 1174a61612 Add support for calling and called subaddress. Partial support for COLP subaddress.
The Telecom Specs in NZ suggests that SUB ADDRESS is always on, so doing
"desk to desk" between offices each with an asterisk box over the ISDN
should then be possible, without a whole load of DDI numbers required.

(closes issue #15604)
Reported by: alecdavis
Patches:
      asterisk_subaddr_trunk.diff11.txt uploaded by alecdavis (license 585)
      Some minor modificatons were made.
Tested by: alecdavis, rmudgett

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22 16:33:22 +00:00
Kevin P. Fleming cdd1f9e296 Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.
This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the
case where multiple results need to be returned; OBJ_NODATA mode
already was supported). In addition, it converts ast_channel_iterators
(only the targeted versions, not the ones that iterate over all
channels) to use this method.

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

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 21:08:47 +00:00
Matthew Nicholson 0d4726b0a2 Merged revisions 223225 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r223225 | mnicholson | 2009-10-09 13:20:11 -0500 (Fri, 09 Oct 2009) | 8 lines
  
  Signal timeouts by returning AST_CONTROL_RINGING when originating calls.
  (closes issue #15104)
  Reported by: nblasgen
  Patches:
        manager-timeout1.diff uploaded by mnicholson (license 96)
  Tested by: nblasgen, mnicholson
........


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

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

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

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

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

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07 22:58:38 +00:00
Tilghman Lesher a4ece92018 Merged revisions 221200 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221200 | tilghman | 2009-09-30 11:55:21 -0500 (Wed, 30 Sep 2009) | 7 lines
  
  Avoid a potential NULL dereference.
  (closes issue #15865)
   Reported by: kobaz
   Patches: 
         20090915__issue15865.diff.txt uploaded by tilghman (license 14)
   Tested by: kobaz
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 16:56:42 +00:00
Kevin P. Fleming 8c30540269 Correct sense of logic test committed in revision 220494.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-25 14:44:40 +00:00
Kevin P. Fleming aabdc575a5 Don't use hash-based lookups for ast_channel_get_by_name_prefix().
ast_channel_get_full() tries to use OBJ_POINTER to optimize name-based
channel lookups, but this will not work properly when the channel's full
name was not supplied; for name-prefix searches, there is no value in
doing a hash-based lookup, and in fact doing so could result in many
channels being skipped.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-25 14:38:41 +00:00
Matthew Nicholson b27a54b8de Merged revisions 219136 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219136 | mnicholson | 2009-09-17 09:58:39 -0500 (Thu, 17 Sep 2009) | 10 lines
  
  Prevent a potential race condition and crash when hanging up a channel by removing the channel from the channel list before begining channel tear down.
  
  This fix may potentially cause problems with CDR backends that access the channel a CDR is associated with via the channel list.  This fix makes the channel unavabile at the time when the CDR backend is invoked.  This has been documented in include/asterisk/cdr.h.
  
  (closes issue #15316)
  Reported by: vmarrone
  Tested by: mnicholson
  
  Review: https://reviewboard.asterisk.org/r/362/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-17 15:18:01 +00:00
Tilghman Lesher 40c13bd1b0 Merged revisions 214701 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r214701 | tilghman | 2009-08-28 15:13:32 -0500 (Fri, 28 Aug 2009) | 8 lines
  
  Modify comment to be a bit more accurate.
  We have kept this comment around long enough, that it's pretty clear that we're
  keeping the code, because changing the code would require a pretty fundamental
  architectural shift.  We've also taken criticism in some quarters, because it
  was believed that it was referring to the code being nasty.  No, the code isn't
  nasty, just the operation itself is rather odd.  Fixed for eternity (probably
  not).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@214702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-28 20:14:39 +00:00
David Vossel 2794b198ce Merged revisions 214194 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r214194 | dvossel | 2009-08-26 11:36:42 -0500 (Wed, 26 Aug 2009) | 19 lines
  
  ast_write() ignores ast_audiohook_write() results
  
  In ast_write(), if a channel has a list of audiohooks, those
  lists are written to and the resulting frame is what ast_write()
  should continue with.  The problem was the returned audiohook frame
  was not being handled at all, and the original frame passed
  into it did not contain the mixed audio, so essentially audio
  was being lost.  One result of this was chan_spy's whisper
  mode no longer worked.  To complicate the issue, frames
  passed into ast_write may either be a single frame, or a list
  of frames.  So, as the list of frames is processed in the
  audiohook_write, the returned frames had to be added to a new
  list.
  
  (closes issue #15660)
  Reported by: corruptor
  Tested by: dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@214195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-26 16:38:53 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Russell Bryant 724c1239fc Fix up some issues with getting a channel by "name".
Even though the get_channel_by_name() API advertised that you could search by
name or uniqueid (just as the old API did), searching by uniqueid was not
actually implemented.  This patch fixes that problem.

The ast_channel_get_full() function now makes a second search attempt by
uniqueid if the parameter was a name.  The channel comparison function also
now knows how to compare by unqieueid.

Finally, a bug was fixed in passing where OBJ_POINTER was being passed in some
scenarios where it should not have been.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 15:46:39 +00:00
Tilghman Lesher feced6672c Merged revisions 210913 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r210913 | tilghman | 2009-08-06 16:45:01 -0500 (Thu, 06 Aug 2009) | 7 lines
  
  Because channel information can be accessed outside of the channel thread, we must lock the channel prior to modifying it.
  (closes issue #15397)
   Reported by: caspy
   Patches: 
         20090714__issue15397.diff.txt uploaded by tilghman (license 14)
   Tested by: caspy
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210914 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-06 21:46:01 +00:00
Richard Mudgett 28ad5ced1a Initial minimum ast_party_caller support.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210354 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-04 16:36:41 +00:00
Mark Michelson 214453904e Fix order and redundancy of channel rename manager events in ast_do_masquerade.
Patch contributed by Mark Spencer.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-03 14:29:17 +00:00
Kevin P. Fleming 0a6e06c7ff Rework of T.38 negotiation and UDPTL API to address interoperability problems
Over the past couple of months, a number of issues with Asterisk
negotiating (and successfully completing) T.38 sessions with various
endpoints have been found. This patch attempts to address many of
them, primarily focused around ensuring that the endpoints'
MaxDatagram size is honored, and in addition by ensuring that T.38
session parameter negotiation is performed correctly according to the
ITU T.38 Recommendation.

The major changes here are:

1) T.38 applications in Asterisk (app_fax) only generate/receive IFP
packets, they do not ever work with UDPTL packets. As a result of
this, they cannot be allowed to generate packets that would overflow
the other endpoints' MaxDatagram size after the UDPTL stack adds any
error correction information. With this patch, the application is told
the maximum *IFP* size it can generate, based on a calculation using
the far end MaxDatagram size and the active error correction mode on
the T.38 session. The same is true for sending *our* MaxDatagram size
to the remote endpoint; it is computed from the value that the
application says it can accept (for a single IFP packet) combined with
the active error correction mode.

2) All treatment of T.38 session parameters as 'capabilities' in
chan_sip has been removed; these parameters are not at all like
audio/video stream capabilities. There are strict rules to follow for
computing an answer to a T.38 offer, and chan_sip now follows those
rules, using the desired parameters from the application (or channel)
that wants to accept the T.38 negotiation.

3) chan_sip now stores and forwards ast_control_t38_parameters
structures for tracking 'our' and 'their' T.38 session parameters;
this greatly simplifies negotiation, especially for pass-through
calls.

4) Since T.38 negotiation without specifying parameters or receiving
the final negotiated parameters is not very worthwhile, the
AST_CONTROL_T38 control frame has been removed. A note has been added
to UPGRADE.txt about this removal, since any out-of-tree applications
that use it will no longer function properly until they are upgraded
to use AST_CONTROL_T38_PARAMETERS.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-23 21:57:24 +00:00
Russell Bryant 44301c95d2 Merged revisions 207360 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r207360 | russell | 2009-07-20 11:26:24 -0500 (Mon, 20 Jul 2009) | 9 lines
  
  Only do the chan->fdno check in ast_read() in a developer build.
  
  I changed this check to only happen in a dev-mode build.  I also added a
  comment explaining what is going on.  I also made it so that detection of
  this situation does not affect ast_read() operation.
  
  (closes issue #14723)
  Reported by: seadweller
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-20 16:36:15 +00:00
Kevin P. Fleming 8b878c8303 Improve handling of AST_CONTROL_T38 and AST_CONTROL_T38_PARAMETERS for non-T.38-capable channels.
This change allows applications that request T.38 negotiation on a channel that
does not support it to get the proper indication that it is not supported, rather
than thinking that negotiation was started when it was not.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204948 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-06 13:38:29 +00:00
Matthew Nicholson fd6a49beac Moved trigger for BRIDGE_END CEL event so that it is more accurate.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-02 20:37:16 +00:00
Tilghman Lesher b5f6eac49e Allow trunk to once again compile under MALLOC_DEBUG
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-29 17:56:29 +00:00
Joshua Colp 59c1998d67 Improve T.38 negotiation by exchanging session parameters between application and channel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 19:27:24 +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 2affa3e999 Merged revisions 202496 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r202496 | russell | 2009-06-22 15:08:53 -0500 (Mon, 22 Jun 2009) | 4 lines
  
  Report CallerID change during a masquerade.
  
  Reported by: markster
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22 20:11:04 +00:00
Mark Michelson d8cc968adc Merged revisions 201450 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r201450 | mmichelson | 2009-06-17 14:59:31 -0500 (Wed, 17 Jun 2009) | 9 lines
  
  Change the datastore traversal in ast_do_masquerade to use a safe list traversal.
  
  It is possible for datastore fixup functions to remove the datastore from the list
  and free it. In particular, the queue_transfer_fixup in app_queue does this. While
  I don't yet know of this causing any crashes, it certainly could.
  
  Found while discussing a separate issue with Brian Degenhardt.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-17 20:04:12 +00:00
Kevin P. Fleming 4c0265664e Merged revisions 200991 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r200991 | kpfleming | 2009-06-16 12:05:38 -0500 (Tue, 16 Jun 2009) | 11 lines
  
  Improve support for media paths that can generate multiple frames at once.
  
  There are various media paths in Asterisk (codec translators and UDPTL, primarily)
  that can generate more than one frame to be generated when the application calling
  them expects only a single frame. This patch addresses a number of those cases,
  at least the primary ones to solve the known problems. In addition it removes the
  broken TRACE_FRAMES support, fixes a number of bugs in various frame-related API
  functions, and cleans up various code paths affected by these changes.
  
  https://reviewboard.asterisk.org/r/175/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16 18:54:30 +00:00
Mark Michelson afcbf2e14f Merged revisions 200360 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r200360 | mmichelson | 2009-06-12 14:06:41 -0500 (Fri, 12 Jun 2009) | 10 lines
  
  Suppress a warning message and give a better return code when generating
  inband ringing after a call is answered.
  
  (closes issue #15158)
  Reported by: madkins
  Patches:
        15158.patch uploaded by mmichelson (license 60)
  Tested by: madkins
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-12 19:07:51 +00:00
Eliel C. Sardanons dabfa94fdc Release the allocated channel decreasing the reference counter.
When allocating the channel use ao2_ref(-1) to release it, instead of calling
ast_free().
Also avoid freeing structures inside that channel (on error) if they will be
released by the channel destructor being called if the reference counter reachs
0.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-11 15:40:03 +00:00
Mark Michelson 554456f0fc Use ast_channel_unref to instead of ast_free on a newly created channel.
Also I removed an unnecessary free of a cid_name. This will be freed properly
in the channel destructor.

Reported by mnicholson in #asterisk-dev.



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

(closes issue #13630)
Reported by: festr

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



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

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

AST-165



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01 20:57:31 +00:00
Russell Bryant 8580871fd4 Constify the ast_frame arg to ast_queue_frame().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-31 01:19:30 +00:00
Matthew Nicholson c8b0c41ed8 Merged revisions 198068 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r198068 | mnicholson | 2009-05-29 13:53:01 -0500 (Fri, 29 May 2009) | 15 lines
  
  Use AST_CDR_NOANSWER instead of AST_CDR_NULL as the default CDR disposition.
  
  This change also involves the addition of an AST_CDR_FLAG_ORIGINATED flag that is used on originated channels to distinguish: them from dialed channels.
  
  (closes issue #12946)
  Reported by: meral
  Patches:
        null-cdr2.diff uploaded by mnicholson (license 96)
  Tested by: mnicholson, dbrooks
  
  (closes issue #15122)
  Reported by: sum
  Tested by: sum
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-29 19:04:24 +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
Russell Bryant 7e350686d6 Declare private data as static.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193459 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-09 11:30:15 +00:00
Kevin P. Fleming ec5116f80c Properly account for memory allocated for channels and datastores
As in previous commits, when channels are allocated (with ast_channel_alloc) or datastores are allocated (with ast_datastore_alloc) properly account for the memory being owned by the caller, instead of the allocator function itself.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 10:34:19 +00:00
Jeff Peeler 7224c99375 Merged revisions 191488 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r191488 | jpeeler | 2009-05-01 12:40:46 -0500 (Fri, 01 May 2009) | 9 lines
  
  Fix DTMF not being sent to other side after a partial feature match
  
  This fixes a regression from commit 176701. The issue was that
  ast_generic_bridge never exited after the feature digit timeout had elapsed,
  which prevented the queued DTMF from being sent to the other side.
  
  This issue was reported to me directly.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-01 18:09:23 +00:00
Richard Mudgett fb030f24ef Fix a small memory leak on error in ast_channel_alloc().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-27 21:22:17 +00:00
Russell Bryant cba19c8a67 Convert the ast_channel data structure over to the astobj2 framework.
There is a lot that could be said about this, but the patch is a big 
improvement for performance, stability, code maintainability, 
and ease of future code development.

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

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

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

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

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

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

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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24 14:04:26 +00:00
Mark Michelson 4988c07e6d Merged revisions 189277 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r189277 | mmichelson | 2009-04-20 09:04:41 -0500 (Mon, 20 Apr 2009) | 12 lines
  
  Move the check for chan->fdno == -1 to after the zombie/hangup check.
  
  Many users were finding that their hung up channels were staying up and
  causing 100% CPU usage.
  
  (issue #14723)
  Reported by: seadweller
  Patches:
        14723_1-4-tip.patch uploaded by mmichelson (license 60)
  Tested by: falves11, bamby
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@189278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 14:05:27 +00:00
Mark Michelson bdcf8fca81 Don't let ast_channel_alloc fail if explicitly passed NULL cid_name or cid_number.
This also fixes a small memory leak.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 16:06:22 +00:00
Tilghman Lesher 1030a25ac9 Modify headers and macros, according to Russell's suggestions on the -dev list
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 03:55:27 +00:00
Joshua Colp abcc0b9397 Add support for allowing the channel driver to handle transcoding.
This was accomplished using a set of options and the setoption channel callback.
The core calls into the channel driver using these options and the channel driver
either returns success or failure.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 16:19:35 +00:00