aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
AgeCommit message (Collapse)AuthorFilesLines
2010-04-22Merged revisions 193391,258670 via svnmerge from mnicholson1-1/+18
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r193391 | mnicholson | 2009-05-08 16:01:25 -0500 (Fri, 08 May 2009) | 8 lines Set the proper disposition on originated calls. (closes issue #14167) Reported by: jpt Patches: call-file-missing-cdr2.diff uploaded by mnicholson (license 96) Tested by: dlotina, rmartinez, mnicholson ........ r258670 | mnicholson | 2010-04-22 16:49:07 -0500 (Thu, 22 Apr 2010) | 11 lines Fix broken CDR behavior. This change allows a CDR record previously marked with disposition ANSWERED to be set as BUSY or NO ANSWER. Additionally this change partially reverts r235635 and does not set the AST_CDR_FLAG_ORIGINATED flag on CDRs generated from ast_call(). To preserve proper CDR behavior, the AST_CDR_FLAG_DIALED flag is now cleared from all brige CDRs in ast_bridge_call(). (closes issue #16797) Reported by: VarnishedOtter Tested by: mnicholson ........ (closes issue #16222) Reported by: telles Tested by: mnicholson git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258671 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-22Asterisk data retrieval API.eliel1-0/+134
This module implements an abstraction for retrieving and exporting asterisk data. Developed by: Brett Bryant <brettbryant@gmail.com> Eliel C. Sardanons (LU1ALY) <eliels@gmail.com> For the Google Summer of code 2009 Project. Documentation can be found in doxygen format and inside the header include/asterisk/data.h Review: https://reviewboard.asterisk.org/r/275/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258517 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-09Merge Call completion support into trunk.mmichelson1-0/+105
From Reviewboard: CCSS stands for Call Completion Supplementary Services. An admittedly out-of-date overview of the architecture can be found in the file doc/CCSS_architecture.pdf in the CCSS branch. Off the top of my head, the big differences between what is implemented and what is in the document are as follows: 1. We did not end up modifying the Hangup application at all. 2. The document states that a single call completion monitor may be used across multiple calls to the same device. This proved to not be such a good idea when implementing protocol-specific monitors, and so we ended up using one monitor per-device per-call. 3. There are some configuration options which were conceived after the document was written. These are documented in the ccss.conf.sample that is on this review request. For some basic understanding of terminology used throughout this code, see the ccss.tex document that is on this review. This implements CCBS and CCNR in several flavors. First up is a "generic" implementation, which can work over any channel technology provided that the channel technology can accurately report device state. Call completion is requested using the dialplan application CallCompletionRequest and can be canceled using CallCompletionCancel. Device state subscriptions are used in order to monitor the state of called parties. Next, there is a SIP-specific implementation of call completion. This method uses the methods outlined in draft-ietf-bliss-call-completion-06 to implement call completion using SIP signaling. There are a few things to note here: * The agent/monitor terminology used throughout Asterisk sometimes is the reverse of what is defined in the referenced draft. * Implementation of the draft required support for SIP PUBLISH. I attempted to write this in a generic-enough fashion such that if someone were to want to write PUBLISH support for other event packages, such as dialog-state or presence, most of the effort would be in writing callbacks specific to the event package. * A subportion of supporting PUBLISH reception was that we had to implement a PIDF parser. The PIDF support added is a bit minimal. I first wrote a validation routine to ensure that the PIDF document is formatted properly. The rest of the PIDF reading is done in-line in the call-completion-specific PUBLISH-handling code. In other words, while there is PIDF support here, it is not in any state where it could easily be applied to other event packages as is. Finally, there are a variety of ISDN-related call completion protocols supported. These were written by Richard Mudgett, and as such I can't really say much about their implementation. There are notes in the CHANGES file that indicate the ISDN protocols over which call completion is supported. Review: https://reviewboard.asterisk.org/r/523 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256528 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-03Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.rmudgett1-15/+1
SWP-1229 ABE-2161 * Ensure chan_local.c:local_call() will not leak cid.cid_dnid when copying. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256104 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-02Merged revisions 256009 via svnmerge from russell1-3/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r256009 | russell | 2010-04-02 18:30:15 -0500 (Fri, 02 Apr 2010) | 2 lines Remove extremely verbose debug message. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256010 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-25Improve handling of T.38 re-INVITEs that arrive before a T.38-capablekpfleming1-3/+4
application is executing on a channel. This patch addresses an issue found during working with end-users using res_fax. If an incoming call is answered in the dialplan, or jumps to the 'fax' extension due to reception of a CNG tone (with faxdetect enabled), and then the remote endpoint sends a T.38 re-INVITE, it is possible for the channel's T.38 state to be 'T38_STATE_NEGOTIATING' when the application starts up. Unfortunately, even if the application wants to use T.38, it can't respond to the peer's negotiation request, because the AST_CONTROL_T38_PARAMETERS control frame that chan_sip sent originally has been lost, and the application needs the content of that frame to be able to formulate a reply. This patch adds a new 'request' type to AST_CONTROL_T38_PARAMETERS, AST_T38_REQUEST_PARMS. If the application sends this request, chan_sip will re-send the original control frame (with AST_T38_REQUEST_NEGOTIATE as the request type), and the application can respond as normal. If this occurs within the five second timeout in chan_sip, the automatic cancellation of the peer reinvite will be stopped, and the application will 'own' the negotiation process from that point onwards. This also improves the code path in chan_sip to allow sip_indicate(), when called for AST_CONTROL_T38_PARAMETERS, to be able to return a non-zero response, which should have been in place before since the control frame *can* fail to be processed properly. It also modifies ast_indicate() to return whatever result the channel driver returned for this control frame, rather than converting all non-zero results into '-1'. Finally, the new request type intentionally returns a positive value, so that an application that sends AST_T38_REQUEST_PARMS can know for certain whether the channel driver accepted it and will be replying with a control frame of its own, or whether it was ignored (if the sip_indicate()/ast_indicate() path had properly supported failure responses before, this would not be necessary). This patch also modifies res_fax to take advantage of the new request. In addition, this patch makes sip_t38_abort() actually lock the private structure before doing its work... bad programmer, no donut. This patch also enhances chan_sip's 'faxdetect' support to allow triggering on T.38 re-INVITEs received as well as CNG tone detection. Review: https://reviewboard.asterisk.org/r/556/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254450 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-23Exit native bridging early for greater timing accuracy with warningsjpeeler1-2/+5
This changes native bridging to break one millisecond early so that the more accurate timeval calculations done in the generic bridge can be performed using the bridge config. Currently the time between exiting native bridging slightly late can sometimes cause a large enough discrepancy for warnings to be missed. For the record, 1.4 does not attempt to native bridge at all when warnings are enabled. (closes issue #15815) Reported by: adomjan Review: https://reviewboard.asterisk.org/r/577/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254050 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-12Only change the RTP ssrc when we see that it has changedtwilson1-0/+5
This change basically reverts the change reviewed in https://reviewboard.asterisk.org/r/374/ and instead limits the updating of the RTP synchronization source to only those times when we detect that the other side of the conversation has changed the ssrc. The problem is that SRCUPDATE control frames are sent many times where we don't want a new ssrc, including whenever Asterisk has to send DTMF in a normal bridge. This is also not the first time that this mistake has been made. The initial implementation of the ast_rtp_new_source function also changed the ssrc--and then it was removed because of this same issue. Then, we put it back in again to fix a different issue. This patch attempts to only change the ssrc when we see that the other side of the conversation has changed the ssrc. It also renames some functions to make their purpose more clear. Review: https://reviewboard.asterisk.org/r/540/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252089 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-18Fix placing ISDN calls on hold preventing native bridging from being ↵rmudgett1-3/+1
reexamined after a transfer. Consider the following scenario: /-- B A == * == Network \-- C Party B calls party A (EuroISDN BRI phone) Party A puts B on hold using the HOLD/RETRIEVE messages. Party A calls party C. Party A puts C on hold to talk with party B again. Party A transfers B to C by hanging up. The call does not get the opportunity to get re-transferred into the ISDN network by the native bridge because native bridging is not being reexamined after the initial transfer. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@247609 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-16fixes sample rate conversion issue with Monitor applicationdvossel1-8/+31
When using ast_seekstream with the read/write streams of a monitor, the number of samples we are seeking must be of the same rate as the stream or the jump calculation will be incorrect. This patch adds logic to correctly convert the number of samples to jump to the sample rate the read/write stream is using. For example, if the call is G722 (16khz) and the read/write stream is recording a 8khz wav, seeking 320 samples of 16khz audio is not the same as seeking 320 samples of 8khz audio when performing the ast_seekstream on the stream. ABE-2044 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246899 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-12Merged revisions 246545 via svnmerge from dvossel1-0/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r246545 | dvossel | 2010-02-12 17:30:17 -0600 (Fri, 12 Feb 2010) | 16 lines lock channel during datastore removal On channel destruction the channel's datastores are removed and destroyed. Since there are public API calls to find and remove datastores on a channel, a lock should be held whenever datastores are removed and destroyed. This resolves a crash caused by a race condition in app_chanspy.c. (closes issue #16678) Reported by: tim_ringenbach Patches: datastore_destroy_race.diff uploaded by tim ringenbach (license 540) Tested by: dvossel ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246546 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-01Merged revisions 244070 via svnmerge from tilghman1-15/+15
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r244070 | tilghman | 2010-02-01 11:46:31 -0600 (Mon, 01 Feb 2010) | 16 lines Revert previous chan_local fix (r236981) and fix instead by destroying expired frames in the queue. (closes issue #16525) Reported by: kobaz Patches: 20100126__issue16525.diff.txt uploaded by tilghman (license 14) 20100129__issue16525__1.6.0.diff.txt uploaded by tilghman (license 14) Tested by: kobaz, atis (closes issue #16581) Reported by: ZX81 (closes issue #16681) Reported by: alexr1 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@244071 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-26Merged revisions 243258 via svnmerge from jpeeler1-11/+0
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r243258 | jpeeler | 2010-01-26 12:19:10 -0600 (Tue, 26 Jan 2010) | 2 lines Remove unnecessary code in ast_read as issue 16058 has been fully solved now. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243266 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-18Extend max call limit duration from 24.8 days to 292+ million years.jpeeler1-0/+1
If the limit was set past MAX_INT upon answering, the call was immediately hung up due to overflow from the return of ast_tvdiff_ms (in ast_check_hangup). The time calculation functions ast_tvdiff_sec and ast_tvdiff_ms have been changed to return an int64_t to prevent overflow. Also the reporter suggested adding a message indicating the reason for the call hanging up. Given that the new limit is so much higher, the message (which would only really be useful in the overflow scenario) has been made a debug message only. (closes issue #16006) Reported by: viraptor git-svn-id: http://svn.digium.com/svn/asterisk/trunk@241143 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-14Fix broken call pickupjpeeler1-1/+1
The problem was the OUTGOING flag was not getting set properly on the channel, resulting in pickup failing as ast_read thought the call was inbound. Refer to 170393 for a more verbose description as this is the same exact change. (closes issue #16539) Reported by: syspert Patches: bug16539.patch uploaded by jpeeler (license 325) Tested by: syspert git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240179 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-13add silence gen to wait appsdvossel1-7/+25
asterisk.conf's 'transmit_silence' option existed before this patch, but was limited to only generating silence while recording and sending DTMF. Now enabling the transmit_silence option generates silence during wait times as well. To achieve this, ast_safe_sleep has been modified to generate silence anytime no other generators are present and transmit_silence is enabled. Wait apps not using ast_safe_sleep now generate silence when transmit_silence is enabled as well. (closes issue #16524) Reported by: kobaz (closes issue #16523) Reported by: kobaz Tested by: dvossel Review: https://reviewboard.asterisk.org/r/456/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239712 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-07fixes ast_transfer stall until hangup if called with a channel that doesn't ↵dvossel1-1/+1
support transfers ast_transfer sets res to 0 if there is no technology transfer function, but then tests for it to be negative before deciding to do an early exit. As a result, it will will wait for an AST_CONTROL_TRANSFER message that will never come. (closes issue #16424) Reported by: davidw Patches: Issue_16424_trunk_234134.patch uploaded by davidw (license 780) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238492 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-18Merged revisions 235635 via svnmerge from jpeeler1-7/+3
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r235635 | jpeeler | 2009-12-18 16:29:51 -0600 (Fri, 18 Dec 2009) | 48 lines Correct CDR dispositions for BUSY/FAILED This patch is simple in that it reorders the disposition defines so that the fix for issue 12946 works properly (the default CDR disposition was changed to AST_CDR_NOANSWER). Also, the AST_CDR_FLAG_ORIGINATED flag was set in ast_call to ensure all CDR records are written. The side effects of CDR changes are scary, so I'm documenting the test cases performed to attempt to catch any regressions. The following tests were all performed using 1.4 rev 195881 vs head (235571) + patch: A calls B C calls B (busy) Hangup C Hangup A (Both SIP and features) A calls B A blind transfers to C Hangup C (Both SIP and features) A calls B A attended transfers to C Hangup C A calls B A attended transfers to C (SIP) C blind transfers to A (features) Hangup A All of the test scenario CDRs matched. The following tests were performed just with the patch to ensure proper operation (with unanswered=yes): exten =>s,1,Answer exten =>s,n,ResetCDR(w) exten =>s,n,ResetCDR(w) exten =>s,1,ResetCDR(w) exten =>s,n,ResetCDR(w) (closes issue #16180) Reported by: aatef Patches: bug16180.patch uploaded by jpeeler (license 325) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235660 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-15Change match criteria existence in ast_channel_cmp_cb to use ast_strlen_zero.jpeeler1-3/+5
(closes issue #16161) Reported by: may213 Patches: core-show-channel.patch uploaded by may213 (license 454) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235226 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-04Merged revisions 233092 via svnmerge from russell1-3/+3
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: http://svn.digium.com/svn/asterisk/trunk@233100 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01Merged revisions 231911 via svnmerge from jpeeler1-0/+11
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: http://svn.digium.com/svn/asterisk/trunk@231927 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-25Merged revisions 231298 via svnmerge from tilghman1-0/+1
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: http://svn.digium.com/svn/asterisk/trunk@231299 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13Display a list of channel variables in each channel-oriented event.tilghman1-16/+18
(Closes AST-33) Reviewboard: https://reviewboard.asterisk.org/r/368/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230111 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-09Merged revisions 228896 via svnmerge from lmadsen1-1/+1
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: http://svn.digium.com/svn/asterisk/trunk@228897 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-06Merged revisions 228692 via svnmerge from dvossel1-2/+10
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: http://svn.digium.com/svn/asterisk/trunk@228693 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04Expand codec bitfield from 32 bits to 64 bits.tilghman1-102/+101
Reviewboard: https://reviewboard.asterisk.org/r/416/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227580 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22Add support for calling and called subaddress. Partial support for COLP ↵rmudgett1-2/+306
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: http://svn.digium.com/svn/asterisk/trunk@225357 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ↵kpfleming1-96/+42
ast_channel_iterator to use it. This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the case where multiple results need to be returned; OBJ_NODATA mode already was supported). In addition, it converts ast_channel_iterators (only the targeted versions, not the ones that iterate over all channels) to use this method. During this work, I removed the 'ao2_flags' arguments to the ast_channel_iterator constructor functions; there were no uses of that argument yet, there is only one possible flag to pass, and it made the iterators less 'opaque'. If at some point in the future someone really needs an ast_channel_iterator that does not lock the container, we can provide constructor(s) for that purpose. Review: https://reviewboard.asterisk.org/r/379/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225244 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-09Merged revisions 223225 via svnmerge from mnicholson1-1/+5
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: http://svn.digium.com/svn/asterisk/trunk@223273 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-07Deadlock in channel masquerade handlingdvossel1-49/+108
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: http://svn.digium.com/svn/asterisk/trunk@222761 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30Merged revisions 221200 via svnmerge from tilghman1-5/+2
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: http://svn.digium.com/svn/asterisk/trunk@221201 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-25Correct sense of logic test committed in revision 220494.kpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220495 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-25Don't use hash-based lookups for ast_channel_get_by_name_prefix().kpfleming1-40/+41
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: http://svn.digium.com/svn/asterisk/trunk@220494 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-17Merged revisions 219136 via svnmerge from mnicholson1-0/+5
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: http://svn.digium.com/svn/asterisk/trunk@219139 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-28Merged revisions 214701 via svnmerge from tilghman1-4/+4
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: http://svn.digium.com/svn/asterisk/trunk@214702 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-26Merged revisions 214194 via svnmerge from dvossel1-2/+25
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: http://svn.digium.com/svn/asterisk/trunk@214195 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10AST-2009-005tilghman1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211539 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10Fix up some issues with getting a channel by "name".russell1-1/+25
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: http://svn.digium.com/svn/asterisk/trunk@211390 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-06Merged revisions 210913 via svnmerge from tilghman1-0/+2
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: http://svn.digium.com/svn/asterisk/trunk@210914 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-04Initial minimum ast_party_caller support.rmudgett1-0/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210354 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-03Fix order and redundancy of channel rename manager events in ast_do_masquerade.mmichelson1-7/+3
Patch contributed by Mark Spencer. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210027 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-23Rework of T.38 negotiation and UDPTL API to address interoperability problemskpfleming1-3/+4
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: http://svn.digium.com/svn/asterisk/trunk@208464 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-20Merged revisions 207360 via svnmerge from russell1-6/+11
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: http://svn.digium.com/svn/asterisk/trunk@207361 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-06Improve handling of AST_CONTROL_T38 and AST_CONTROL_T38_PARAMETERS for ↵kpfleming1-3/+11
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: http://svn.digium.com/svn/asterisk/trunk@204948 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-02Moved trigger for BRIDGE_END CEL event so that it is more accurate.mnicholson1-3/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@204807 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-29Allow trunk to once again compile under MALLOC_DEBUGtilghman1-2/+6
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@204118 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26Improve T.38 negotiation by exchanging session parameters between ↵file1-0/+2
application and channel. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203699 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26Merge the new Channel Event Logging (CEL) subsystem.russell1-26/+307
CEL is the new system for logging channel events. This was inspired after facing many problems trying to represent what is possible to happen to a call in Asterisk using CDR records. For more information on CEL, see the built in HTML or PDF documentation generated from the files in doc/tex/. Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard work developing this code. Also, thanks to Matt Nicholson (mnicholson) and Sean Bright (seanbright) for their assistance in the final push to get this code ready for Asterisk trunk. Review: https://reviewboard.asterisk.org/r/239/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203638 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-22Merged revisions 202496 via svnmerge from russell1-14/+25
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: http://svn.digium.com/svn/asterisk/trunk@202497 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-17Merged revisions 201450 via svnmerge from mmichelson1-1/+5
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: http://svn.digium.com/svn/asterisk/trunk@201458 f38db490-d61c-443f-a65b-d21fe96a405b