aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
AgeCommit message (Collapse)AuthorFilesLines
2010-01-04It's also possible for the Local channel to directly execute an Application.tilghman1-1/+1
Reviewboard: https://reviewboard.asterisk.org/r/452/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@237318 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-30Don't queue frames to channels that have no means to process them.tilghman1-1/+3
(closes issue #15609) Reported by: aragon Patches: 20091230__issue16521__1.4__chan_local_only.diff.txt uploaded by tilghman (license 14) Tested by: aragon Review: https://reviewboard.asterisk.org/r/452/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@236981 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13Fix a crash caused by two threads thinking they should both free thefile1-1/+1
chan_local private structure when only one should. (closes issue #15314) Reported by: sroberts Patches: Issue15314_Move_Nulling_owner.patch uploaded by davidw (license 780) Tested by: davidw, lottc git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@230038 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-29Add an option to enabling passing music on hold start and stop requests ↵file1-2/+5
through instead of acting on them in chan_local. (closes issue #14709) Reported by: dimas git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@226531 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-31Also unlock the "other" channel, when returning, due to glare.tilghman1-0/+3
(closes issue #15787) Reported by: tim_ringenbach Patches: chan_local.diff uploaded by tim ringenbach (license 540) Tested by: tim_ringenbach git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@214940 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-23Fix a bug in chan_local glare hangup detection.file1-3/+0
If both sides of a Local channel were hung up at around the same time it was possible for one thread to destroy the local private structure and have the other thread immediately try to remove the already freed structure from the local channel list. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@190286 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-16Fixup glare detection, to fix a memory leak of a local pvt structure.tilghman1-11/+16
(closes issue #14656) Reported by: caspy Patches: 20090313__bug14656__2.diff.txt uploaded by tilghman (license 14) Tested by: caspy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182208 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17Backport change to 1.4:tilghman1-0/+1
Prior to masquerade, move the group definitions to the channel performing the masq, so that the group count lingers past the bridge. (closes issue #14275) Reported by: kowalma Patches: 20090216__bug14275.diff.txt uploaded by Corydon76 (license 14) Tested by: kowalma git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@176661 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-19Prevent a crash in chan_local due to a potential NULL pointer dereferencemmichelson1-4/+4
Move the check for if both channels on a local_pvt have generators to below where p->chan is checked for NULLity (NULLness?). This prevents a crash from occurring if p->chan is NULL. (closes issue #14189) Reported by: sascha Patches: 14189.patch uploaded by putnopvut (license 60) Tested by: sascha git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@169210 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-31Also inherit the musiconhold class.tilghman1-0/+1
(Closes #14153) Reported by: Jerry Geis, via the users list. Patch by: me (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166953 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-18Fix a crash in the end_bridge_callback of app_dial andmmichelson1-1/+7
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: http://svn.digium.com/svn/asterisk/branches/1.4@157305 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-30Unlock before returning, when extension doesn't exist.tilghman1-0/+1
(closes issue #13807) Reported by: eliel Patches: chan_local.c.patch uploaded by eliel (license 64) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@152922 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-27Inherit ALL elements of CallerID across a local channel.tilghman1-0/+4
(closes issue #13368) Reported by: Peter Schlaile Patches: 20080826__bug13368.diff.txt uploaded by Corydon76 (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@152215 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-14Deadlock prevention in chan_local.mmichelson1-0/+4
(closes issue #13676) Reported by: tacvbo Patches: 13676.patch uploaded by putnopvut (license 60) Tested by: tacvbo git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@148912 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-06Check whether an extension exists in the _call method, rather than the _alloctilghman1-0/+12
method, because we need to evaluate the callerid (since that data affects whether an extension exists). (closes issue #13343) Reported by: efutch Patches: 20080915__bug13343.diff.txt uploaded by Corydon76 (license 14) Tested by: efutch git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@146711 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-12(closes issue #12965)jpeeler1-0/+4
Reported by: rlsutton2 Prevents local channels from playing MOH at each other which was causing ast_generic_bridge to loop much faster. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@142927 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-27Add proper deadlock avoidance.tilghman1-7/+14
(closes issue #12914) Reported by: ozan Patches: 20080625__bug12914.diff.txt uploaded by Corydon76 (license 14) Tested by: ozan git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@125740 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-20When using a Local channel, started by a call file, with a destination of antilghman1-0/+3
AGI script, the AGI script does not always get notified of a hangup if the underlying channel hangs up early. (closes issue #11833) Reported by: IgorG Patches: local_hangup-v1.diff uploaded by IgorG (license 20) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@124315 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-07Don't run LIST_HEAD_DESTROY on a STATIC listrussell1-1/+0
(closes issue #12807) Reported by: ys Patches: chan_agent_local.diff uploaded by ys (license 281) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@121078 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-13Fix a deadlock involving channel autoservice and chan_local that was debuggedrussell1-11/+14
and fixed by mmichelson and me. We observed a system that had a bunch of threads stuck in ast_autoservice_stop(). The reason these threads were waiting around is because this function waits to ensure that the channel list in the autoservice thread gets rebuilt before the stop() function returns. However, the autoservice thread was also locked, so the autoservice channel list was never getting rebuilt. The autoservice thread was stuck waiting for the channel lock on a local channel. However, the local channel was locked by a thread that was stuck in the autoservice stop function. It turned out that the issue came down to the local_queue_frame() function in chan_local. This function assumed that one of the channels passed in as an argument was locked when called. However, that was not always the case. There were multiple cases in which this channel was not locked when the function was called. We fixed up chan_local to indicate to this function whether this channel was locked or not. The previous assumption had caused local_queue_frame() to improperly return with the channel locked, where it would then never get unlocked. (closes issue #12584) (related to issue #12603) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@116038 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-24Resolve a deadlock in chan_local by releasing the channel lockmmichelson1-0/+6
temporarily. (closes issue #11712) Reported by: callguy Patches: 11712.patch uploaded by putnopvut (license 60) Tested by: acunningham git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114624 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-24Ensure that when we set the accountcode, it actually shows up in the CDR.tilghman1-0/+1
(Fix for AMI Originate) (Closes issue #12007) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114621 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-03In the case of an ast_channel allocation failure, take the local_pvt out of therussell1-1/+8
pvt list before destroying it. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105570 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-03Fix a potential memory leak of the local_pvt struct when ast_channel allocationrussell1-10/+14
fails. Also, in passing, centralize the code necessary to destroy a local_pvt. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105568 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-20Fix a crash if the channel becomes NULL while attempting to lock it.mmichelson1-3/+5
(closes issue #12039) Reported by: danpwi git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@103904 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-19Account for the fact that the "other" channel can disappear while the local pvtrussell1-13/+11
is not locked. (fixes a problem introduced in rev 100581) (closes issue #12012) Reported by: stevedavies Patch by me git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@103821 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-28Make some deadlock related fixes. These bugs were discovered and reportedrussell1-19/+18
internally at Digium by Steve Pitts. - Fix up chan_local to ensure that the channel lock is held before the local pvt lock. - Don't hold the channel lock when executing the timing function, as it can cause a deadlock when using chan_local. This actually changes the code back to be how it was before the change for issue #10765. But, I added some other locking that I think will prevent the problem reported there, as well. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@100581 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-22Add more dependencies on chan_local and add a note to the description of ↵oej1-1/+1
chan_local so that people don't disable it in menuselect just to clean up. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@99594 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-21Fixing an issue wherein monitoring local channels was not possible. During a ↵mmichelson1-0/+11
channel masquerade, the monitors on the two channels involved are swapped. In 99% of the cases this results in the desired effect. However, if monitoring a local channel, this caused the monitor which was on the local channel to get moved onto a channel which is immediately hung up after the masquerade has completed. By swapping the monitors prior to the masquerade, we avoid the problem by tricking the masquerade into placing the monitor back onto the channel where we want it. During the investigation of the issue, the channel's monitor was the only thing that was swapped in such a manner which did not make sense to have done. All other variable swapping made sense. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@99426 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-16Fix a deadlock in chan_local in local_hangup. There was contention becausemmichelson1-1/+9
the local_pvt was held and it was attempting to lock a channel, which is the incorrect locking order. (closes issue #11730) Reported by: UDI-Doug Patches: 11730.patch uploaded by putnopvut (license 60) Tested by: UDI-Doug git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98964 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-03A big one...mmichelson1-0/+1
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: http://svn.digium.com/svn/asterisk/branches/1.4@90735 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-17Re-add the setting of callerid name and number.qwell1-0/+6
Issue 10485, reported by and fix explained by paradise. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@79902 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-13(closes issue #10437)file1-2/+0
Reported by: haklin Don't set the callerid name and number a second time on a newly created channel. ast_channel_alloc itself already sets it and setting it twice would cause a memory leak. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@79174 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-05Merged revisions 73318 via svnmerge from file1-3/+3
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r73318 | file | 2007-07-05 10:26:02 -0300 (Thu, 05 Jul 2007) | 2 lines Actually check to make sure a PBX was started on one of the Local channels instead of blindly assuming it was. (issue #10112 reported by makoto) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@73319 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-14As per 9570, worrisome CDR warnings have been removed, that are either not ↵murf1-2/+14
helpful, or not relevant. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@64193 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-09This is a big improvement over the current CDR fixes. It may still need ↵murf1-2/+2
refinement, but this won't have as many folks bothered. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@60989 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-09Merged revisions 60846 via svnmerge from tilghman1-16/+19
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r60846 | tilghman | 2007-04-08 21:37:18 -0500 (Sun, 08 Apr 2007) | 2 lines Bug 9505 - If the return value for local_queue_frame is set, then p->lock is no longer valid. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@60847 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-01Merged revisions 57317 via svnmerge from file1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57317 | file | 2007-03-01 17:19:32 -0500 (Thu, 01 Mar 2007) | 2 lines Don't even attempt to optimize things when a proxy channel is involved. It will just explode in weird and unexplaineable ways. (issue #9175 reported by clegall_proformatique) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@57318 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-19Merge the changes from the /team/group/vldtmf_fixup branch.russell1-2/+3
The main bug being addressed here is a problem introduced when two SIP channels using SIP INFO dtmf have their media directly bridged. So, when a DTMF END frame comes into Asterisk from an incoming INFO message, Asterisk would try to emulate a digit of some length by first sending a DTMF BEGIN frame and sending a DTMF END later timed off of incoming audio. However, since there was no audio coming in, the DTMF_END was never generated. This caused DTMF based features to no longer work. To fix this, the core now knows when a channel doesn't care about DTMF BEGIN frames (such as a SIP channel sending INFO dtmf). If this is the case, then Asterisk will not emulate a digit of some length, and will instead just pass through the single DTMF END event. Channel drivers also now get passed the length of the digit to their digit_end callback. This improves SIP INFO support even further by enabling us to put the real digit duration in the INFO message instead of a hard coded 250ms. Also, for an incoming INFO message, the duration is read from the frame and passed into the core instead of just getting ignored. (issue #8597, maybe others...) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51311 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-16Merged revisions 47750 via svnmerge from file1-0/+27
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r47750 | file | 2006-11-16 13:26:50 -0500 (Thu, 16 Nov 2006) | 2 lines Because of the way chan_local is written we should be extra careful and make sure our callback functions have a tech_pvt. (issue #8275 reported by mflorell) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47751 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-15Merged revisions 47711 via svnmerge from file1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r47711 | file | 2006-11-15 17:29:30 -0500 (Wed, 15 Nov 2006) | 2 lines Make sure that the pvt structure exists before trying to do fixup on Local channels. (issue #7937 reported by mada123, fix by alamantia with mods by me) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47712 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-07These mods are to solve the problem in bug 7506. It's a lot of rework to ↵murf1-7/+2
solve a fairly small problem... such is life. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47303 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-07This is not the commit you are looking for...file1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47287 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-07Make MOH work as it did before in chan_local, without this then it can go ↵file1-8/+16
funky when transfers and MOH are involved. (issue #7671 reported by jmls) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47284 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-02Reverse change of "show" to "list" and make several other commands more ↵tilghman1-8/+3
consistent with "category verb arguments" git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47051 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-26Strip options off the argument passed for devicestate in chan_local. (issue ↵file1-1/+5
#8034 reported by pcardozo) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43697 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-18merge qwell's CLI verbification workkpfleming1-6/+13
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43212 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-07Use flags instead of variables on the private structure for thingsfile1-21/+23
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@42338 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-07Code cleaning/updates/potential bug fixesfile1-75/+64
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@42311 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-31Merge in VLDTMF support with Zaptel/Core done by the ever great Darumkilla ↵file1-4/+23
Russell Bryant and the RTP portion done by myself, Muffinlicious Joshua Colp. This has gone through so many discussions/revisions it's not funny but we finally have it! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41507 f38db490-d61c-443f-a65b-d21fe96a405b