aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
AgeCommit message (Collapse)AuthorFilesLines
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
2006-08-29Merge team/russell/frame_cachingrussell1-2/+2
There are some situations in Asterisk where ast_frame and/or iax_frame structures are rapidly allocatted and freed (at least 50 times per second for one call). This code significantly improves the performance of ast_frame_header_new(), ast_frdup(), ast_frfree(), iax_frame_new(), and iax_frame_free() by keeping a thread-local cache of these structures and using frames from the cache whenever possible instead of calling malloc/free every time. This commit also converts the ast_frame and iax_frame structures to use the linked list macros. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41278 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-20/+12
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-16 Quit early and print a LOG_WARNING if we are trying to check devicestate on ↵bweschke1-5/+12
a Local channel that's been improperly defined. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@34463 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-14make Local channel return sensible device state valueskpfleming1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@34162 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-12Merged revisions 33638 via svnmerge from kpfleming1-1/+13
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r33638 | kpfleming | 2006-06-12 11:03:29 -0500 (Mon, 12 Jun 2006) | 2 lines only allow chan_local to masquerade the outbound channel onto its owner, instead of the other way around (this will ensure that group variables on the outbound channel as preserved) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33643 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07simplify autoconfig include mechanism (make tholo happy he can use lint ↵kpfleming1-4/+4
again :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32846 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-22Merged revisions 29464 via svnmerge from file1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r29464 | file | 2006-05-22 13:33:03 -0300 (Mon, 22 May 2006) | 2 lines Preserve presentation bit when going through chan_local (issue #7002 reported by acunningham) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@29466 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-19Adding send_text capability to chan_localoej1-0/+18
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@28520 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-19First stab at supporting video in chan_localoej1-2/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@28502 f38db490-d61c-443f-a65b-d21fe96a405b