aboutsummaryrefslogtreecommitdiffstats
path: root/res
AgeCommit message (Collapse)AuthorFilesLines
2009-01-09Make this compile for mvanbaakrussell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168198 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-08Don't truncate database results at 255 chars.tilghman1-3/+22
(closes issue #14069) Reported by: evandro Patches: 20081214__bug14069.diff.txt uploaded by Corydon76 (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167840 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22Re-work ref count handling of MoH classes using astobj2 to resolve crashes.russell1-325/+441
(closes issue #13566) Reported by: igorcarneiro Tested by: russell Review: http://reviewboard.digium.com/r/106/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166262 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-19This merges the masqpark branch into 1.4murf1-61/+28
These changes eliminate the need for (and use of) the KEEPALIVE return code in res_features.c; There are other places that use this result code for similar purposes at a higher level, these appear to be left alone in 1.4, but attacked in trunk. The reason these changes are being made in 1.4, is that parking ends a channel's life, in some situations, and the code in the bridge (and some other places), was not checking the result code properly, and dereferencing the channel pointer, which could lead to memory corruption and crashes. Calling the masq_park function eliminates this danger in higher levels. A series of previous commits have replaced some parking calls with masq_park, but this patch puts them ALL to rest, (except one, purposely left alone because a masquerade is done anyway), and gets rid of the code that tests the KEEPALIVE result, and the NOHANGUP_PEER result codes. While bug 13820 inspired this work, this patch does not solve all the problems mentioned there. I have tested this patch (again) to make sure I have not introduced regressions. Crashes that occurred when a parked party hung up while the parking party was listening to the numbers of the parking stall being assigned, is eliminated. These are the cases where parking code may be activated: 1. Feature one touch (eg. *3) 2. Feature blind xfer to parking lot (eg ##700) 3. Run Park() app from dialplan (eg sip xfer to 700) (eg. dahdi hookflash xfer to 700) 4. Run Park via manager. The interesting testing cases for parking are: I. A calls B, A parks B a. B hangs up while A is getting the numbers announced. b. B hangs up after A gets the announcement, but before the parking time expires c. B waits, time expires, A is redialed, A answers, B and A are connected, after which, B hangs up. d. C picks up B while still in parking lot. II. A calls B, B parks A a. A hangs up while B is getting the numbers announced. b. A hangs up after B gets the announcement, but before the parking time expires c. A waits, time expires, B is redialed, B answers, A and B are connected, after which, A hangs up. d. C picks up A while still in parking lot. Testing this throroughly involves acting all the permutations of I and II, in situations 1,2,3, and 4. Since I added a few more changes (ALL references to KEEPALIVE in the bridge code eliimated (I missed one earlier), I retested most of the above cases, and no crashes. H-extension weirdness. Current h-extension execution is not completely correct for several of the cases. For the case where A calls B, and A parks B, the 'h' exten is run on A's channel as soon as the park is accomplished. This is expected behavior. But when A calls B, and B parks A, this will be current behavior: After B parks A, B is hung up by the system, and the 'h' (hangup) exten gets run, but the channel mentioned will be a derivative of A's... Thus, if A is DAHDI/1, and B is DAHDI/2, the h-extension will be run on channel Parked/DAHDI/1-1<ZOMBIE>, and the start/answer/end info will be those relating to Channel A. And, in the case where A is reconnected to B after the park time expires, when both parties hang up after the joyful reunion, no h-exten will be run at all. In the case where C picks up A from the parking lot, when either A or C hang up, the h-exten will be run for the C channel. CDR's are a separate issue, and not addressed here. As to WHY this strange behavior occurs, the answer lies in the procedure followed to accomplish handing over the channel to the parking manager thread. This procedure is called masquerading. In the process, a duplicate copy of the channel is created, and most of the active data is given to the new copy. The original channel gets its name changed to XXX<ZOMBIE> and keeps the PBX information for the sake of the original thread (preserving its role as a call originator, if it had this role to begin with), while the new channel is without this info and becomes a call target (a "peer"). In this case, the parking lot manager thread is handed the new (masqueraded) channel. It will not run an h-exten on the channel if it hangs up while in the parking lot. The h exten will be run on the original channel instead, in the original thread, after the bridge completes. See bug 13820 for our intentions as to how to clean up the h exten behavior. Review: http://reviewboard.digium.com/r/29/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166093 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-19(closes issue #13480)jpeeler1-5/+1
Reported by: tzafrir Replace a bunch of if defined checks for Zaptel/DAHDI through several new defines in dahdi_compat.h. This removes a lot of code duplication. Example from bug: #ifdef HAVE_ZAPTEL fd = open("/dev/zap/pseudo", O_RDWR); #else fd = open("/dev/dahdi/pseudo", O_RDWR); #endif is replaced with: fd = open(DAHDI_FILE_PSEUDO, O_RDRW); git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@165991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18Set the process group ID on the MOH process so that all children will get killedrussell1-6/+7
(closes issue #14099) Reported by: caspy Patches: res_musiconhold.c.patch.killpg.try2 uploaded by caspy (license 645) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@165661 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-16Don't try to change working directory if a directory was not configured.russell1-1/+1
(closes issue #14089) Reported by: caspy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164605 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-15Handle a case where a call can be bridged to a channel that is still ringing.russell1-1/+9
The issue that was reported was about a case where a RINGING channel got redirected to an extension to pick up a call from parking. Once the parked call got taken out of parking, it heard silence until the other side answered. Ideally, the caller that was parked would get a ringing indication. This patch fixes this case so that the caller receives ringback once it comes out of parking until the other side answers. The fixes are: - Make sure we remember that a channel was an outgoing channel when doing a masquerade. This prevents an erroneous ast_answer() call on the channel, which causes a bogus 200 OK to be sent in the case of SIP. - Add some additional comments to explain related parts of code. - Update the handling of the ast_channel visible_indication field. Storing values that are not stateful is pointless. Control frames that are events or commands should be ignored. - When a bridge first starts, check to see if the peer channel needs to be given ringing indication because the calling side is still ringing. - Rework ast_indicate_data() a bit for the sake of readability. (closes issue #13747) Reported by: davidw Tested by: russell Review: http://reviewboard.digium.com/r/90/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164201 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-11Fix an issue that made it so you could only have a single caller executingrussell1-28/+33
a custom feature at a time. This was especially problematic when custom features ran for any appreciable amount of time. The fix turned out to be quite simple. The dynamic features are now stored in a read/write list instead of a list using a mutex. (closes issue #13478) Reported by: neutrino88 Fix suggested by file git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@163092 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-11Don't wait forever, if there's a specified recording timeout.tilghman1-1/+1
(closes issue #13885) Reported by: bamby Patches: res_agi.c.patch uploaded by bamby (license 430) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@163088 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10Oops, inverted logic for a strcasecmp check. Pointed out by mmichelson, thanks!jpeeler1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162926 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10(closes issue #13229)jpeeler1-5/+5
Reported by: clegall_proformatique Ensure that moh_generate does not return prematurely before local_ast_moh_stop is called. Also, the sleep in mp3_spawn now only occurs for http locations since it seems to have been added originally only for failing media streams. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162874 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-02Channel is masqueraded, don't keep alivetwilson1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@160411 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-02A situation like A calls B, A builtin_atxfers B to C, C parks B would lead ↵twilson1-1/+1
to a crash. Thanks to file for telling me how to fix it! (closes issue #13854) Reported by: Adam Lee Tested by: otherwiseguy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@160390 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-29update dev-mode compiler flags to match the ones used by default on Ubuntu ↵kpfleming2-3/+3
Intrepid, so all developers will see the same warnings and errors since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them format attributes in a consistent way git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@159808 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-21In reference to the fix made for 13871, I wasmurf1-9/+14
merging the fix into 1.6.0 and realized I missed the code in the h-exten block, and didn't catch it because my test case had the h-exten commented out. So, this corrects the code I missed, as a preventative against another crash report. Tested with the h-exten defined, all is well. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@158603 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-21(closes issue #13871)murf1-3/+5
Reported by: mdu113 This one is totally my fault. The code doesn't even create a bridge if the channel CDR has POST_DISABLED. I didn't check for that at the end of the bridge. Fixed with a few small insertions. Tested. Looks good. No cdr generated, no crash, no unnecc. data objects created either. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@158483 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-19the gcc optimizer frequently finds broken code (use of uninitalized ↵kpfleming1-1/+1
variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems. with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course). while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@157859 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-18Fix a crash in the end_bridge_callback of app_dial andmmichelson1-0/+4
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-11-09Use static functions here instead of nested ones. This requires a smallseanbright1-1/+1
change to the ast_bridge_config struct as well. To understand the reason for this change, see the following post: http://gcc.gnu.org/ml/gcc-help/2008-11/msg00049.html git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@155553 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-03somehow missed a bunch of gcc 4.3.x warnings in this branch on the first passkpfleming1-6/+3
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153823 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-01fix a bunch of potential problems found by gcc 4.3.x, primarily bare strings ↵kpfleming4-10/+26
being passed to printf()-like functions and ignored results from read()/write() and friends git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153337 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-31Add end_bridge_callback for app_follome and add AUTOLOOP flag to res_featurestwilson1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153270 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-31Recent CDR fixes moved execution of the 'h' exten into the bridging code, so ↵twilson1-0/+4
variables that were set after ast_bridge_call was called would not show up in the 'h' exten. Added a callback function to handle setting variables, etc. from w/in the bridging code. Calls back into a nested function within the function calling ast_bridge_call (closes issue #13793) Reported by: greenfieldtech git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153095 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-29The magic trick to avoid this crash is not tomurf1-61/+82
try to find the channel by name in the list, which is slow and resource consuming, but rather to pay attention to the result codes from the ast_bridge_call, to which I added the AST_PBX_NO_HANGUP_PEER_PARKED value, which now are returned when a channel is parked. If you get AST_PBX_KEEPALIVE, then don't touch the channel pointer. If you get AST_PBX_NO_HANGUP_PEER, or AST_PBX_NO_HANGUP_PEER_PARKED, then don't touch the peer pointer. Updated the several places where the results from a bridge were not being properly obeyed, and fixed some code I had introduced so that the results of the bridge were not overridden (in trunk). All the places that previously tested for AST_PBX_NO_HANGUP_PEER now have to check for both AST_PBX_NO_HANGUP_PEER and AST_PBX_NO_HANGUP_PEER_PARKED. I tested this against the 4 common parking scenarios: 1. A calls B; B answers; A parks B; B hangs up while A is getting the parking slot announcement, immediately after being put on hold. 2. A calls B; B answers; A parks B; B hangs up after A has been hung up, but before the park times out. 3. A calls B; B answers; B parks A; A hangs up while B is getting the parking slot announcement, immediately after being put on hold. 4. A calls B; B answers; B parks A; A hangs up after B has been hung up, but before the park times out. No crash. I also ran the scenarios above against valgrind, and accesses looked good. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@152535 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-23Backport fix from 1.6.0 that allows you to set ↵twilson1-2/+19
parkedcalltransfers=no|caller|callee|both, but default to both which would be the equivalent of the existing behaviour. The problem was that if someone parked a call, the callee and caller would both get assigned the builtin transfer feature, which would not only be potentially giving someone the ability to transfer themselves when they shouldn't have it, but would also dissallow reinviting the media off of the call. (closes issue #12854) Reported by: davidw Patches: parkingfix4.diff.txt uploaded by otherwiseguy Tested by: davidw, otherwiseguy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@151763 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-17Interesting crash. In this case, you exit themurf1-4/+6
bridge with peer completely GONE. I moved the channel find call up to cover the whole peer CDR reset code segment. This appears to solve the crash without changing the logic at all. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@150637 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-09(closes issue #13139)jpeeler1-0/+5
Reported by: krisk84 Tested by: krisk84 This change prevents a call that is placed in the parkinglot to be picked up before the PBX is finished. If another extension dials the parking extension before the PBX thread has completed at minimum warnings will occur about the PBX not properly being terminated. At worst, a crash could occur. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@147941 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-06Dialplan functions should not actually return 0, unless they have modified thetilghman1-1/+1
workspace. To signal an error (and no change to the workspace), -1 should be returned instead. (closes issue #13340) Reported by: kryptolus Patches: 20080827__bug13340__2.diff.txt uploaded by Corydon76 (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@146799 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-03(closes issue #13425)jpeeler2-3/+7
Reported by: mdu113 Tested by: mdu113 Similar to r143204, masquerade the channel in the case of Park being called from AGI. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@146129 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-03(closes issue #13579)murf1-1/+1
Reported by: dwagner (closes issue #13584) Reported by: dwagner Tested by: murf, putnopvut The thought occurred to me that the res= from the extension spawn was ending up being returned from the bridge. "Thou shalt not poison the return value". Made the change and it appears to allow blind xfers to work as normal. If I'm wrong, reopen the bugs. But it looks good to me! Many thanks to putnopvut for helping me reproduce this! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@146026 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-02Some sanity checks that may have led to prior crashes, found by codefreeze-laptilghman1-9/+15
(murf) on IRC. Also some cleanup of incorrectly-used constants. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@145751 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-23(closes issue #13489)murf1-38/+71
Reported by: DougUDI Tested by: murf (closes issue #13490) Reported by: seanbright Tested by: murf (closes issue #13467) Reported by: edantie Tested by: murf, edantie, DougUDI This crash happens because we are unsafely handling old pointers. The channel whose cdr is being handled, has been hung up and destroyed already. I reorganized the code a bit, and tried not to lose the fork-cdr-chain concepts of the previous code. I now verify that the 'previous' channel (the channel we had when the bridge was started), still exists, by looking it up by name in the channel list. I also do not try to reset the CDR's of channels involved in bridges. Testing shows it solves the crash problem, and should not negatively impact previous fixes involving CDR's generated during/after blind transfers. (The reason we need to reset the CDR's on the "beginning" channels in the first place). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@144066 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-18compare peer and chan instead of looking at the parked user (pu), which ↵jpeeler1-1/+1
could have possibly already have been freed by the parking thread git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@143475 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-16(closes issue #13493)jpeeler1-24/+24
Reported by: mdu113 Patches: bug13493.diff uploaded by jpeeler (license 325) Tested by: mdu113 Changed park_call_full to hold the parkinglot lock a little longer, which protects the parkeduser struct from being freed out from underneath. Made sure that the parking extension is added to the parking context while holding the lock thereby ensuring that there are no spurious warnings from removal attempts when a hangup occurs while the parking lot is being announced. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@143270 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-16(closes issue #13465)jpeeler1-22/+48
(closes issue #13425) Reported by: mdu113 Patches: bug13425.diff uploaded by jpeeler (license 325) Tested by: mdu113 The main change here was to masquerade the channel if the channel that was to be parked was running a PBX on it. The PBX thread can then maintain full control of the channel (the zombie) as it expects to while allowing the parking thread full control of the real (parked) channel. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@143204 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-12Tested by: sergee, murf, chris-mac, andrew, KNKmurf1-0/+45
This is a "second attempt" to restore the previous "endbeforeh" behavior in 1.4 and up. In order to capture information concerning all the legs of transfers in all their infinite combinations, I was forced to this particular solution by a chain of logical necessities, the first being that I was not allowed to rewrite the CDR mechanism from the ground up! This change basically leaves the original machinery alone, which allows IVR and local channel type situations to generate CDR's as normal, but a channel flag can be set to suppress the normal running of the h exten. That flag would be set by the code that runs the h exten from the ast_bridge_call routine, to prevent the h exten from being run twice. Also, a flag in the ast_bridge_config struct passed into ast_bridge_call can be used to suppress the running of the h exten in that routine. This would happen, for instance, if you use the 'g' option in the Dial app. Running this routine 'early' allows not only the CDR() func to be used in the h extension for reading CDR variables, but also allows them to be modified before the CDR is posted to the backends. While I dearly hope that this patch overcomes all problems, and introduces no new problems, reality suggests that surely someone will have problems. In this case, please re-open 13251 (or 13289), and we'll see if we can't fix any remaining issues. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@142675 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-11(closes issue #13364)murf1-24/+40
Reported by: mdu113 Well, fundamentally, the problems revealed in 13364 are because of the ForkCDR call that is done before the dial. When the bridge is in place, it's dealing with the first (and wrong) cdr in the list. So, I wrote a little func to zip down to the first non-locked cdr in the chain, and thru-out the ast_bridge_call, these results are used instead of raw chan->cdr and peer->cdr pointers. This shouldn't affect anyone who isn't forking cdrs before a dial, and should correct the cdr's of those that do. So, this change ends up correcting the dstchannel and userfield; the disposition was fixed by a previous patch, it was OK coming into this problem. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@142575 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-10(closes issue #12318)murf1-0/+2
Reported by: krtorio I made a small change to the code that handles local channel situations. In that code, I copy the answer time from the peer cdr, to the bridge_cdr, but I wasn't also copying the disposition from the peer cdr. So, Now I copy the disposition, and I've tested against these cases: 1. phone 1 never answers the phone; no cdr is generated at all. this should show up as a manager command failure or something. 2. phone 2 never answers. CDR is generated, says NO ANSWER 3. phone 2 is busy. CDR is generated, says BUSY 4. phone 2 answers: CDR is generated, times are correct; disposition is ANSWERED, which is correct. The start time is the time that the manager dialed the first phone. The answer time is the time the second phone picks up. I purposely left the cid and src fields blank; since this call really originates from the manager, there is no 'easy' data to put in these fields. If you feel strongly that these fields should be filled in, re-open this bug and I'll dig further. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@142474 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-09Ensure that the stored CDR reference is still valid after the bridge beforerussell1-0/+17
poking at it. Also, keep the channel locked while messing with this CDR. (fixes crashes reported in issue #13409) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@142063 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-06Reverting behavior change (AGI should not exit non-zero on SUCCESS)tilghman1-1/+1
(closes issue #13434) Reported by: francesco_r git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@141503 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-04(closes issue #11979)jpeeler2-5/+12
Fixes multiple parking problems: Crash when executing a park on an extension dialed by AGI due to not returning the proper return code. Crash when using a builtin feature that was a subset of a enabled dynamic feature. Crash due to always hanging up the peer despite the fact that the peer was supposed to be parked. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@141028 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-25This patch reverts the changes made via 139347, and 139635, as usersmurf1-44/+0
are seeing adverse difference. I will un-close 13251. Back to the drawing board/ concept/ beginning/ whatever! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@139764 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-22I found some problems with the code I committed earlier, whenmurf1-0/+8
I merged them into trunk, so I'm coming back to clean up. And, in the process, I found an error in the code I added to trunk and 1.6.x, that I'll fix using this patch also. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@139635 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-21(closes issue #13251)murf1-0/+36
Reported by: sergee Tested by: murf THis is a bold move for a static release fix, but I wouldn't have made it if I didn't feel confident (at least a *bit* confident) that it wouldn't mess everyone up. The reasoning goes something like this: 1. We simply cannot do anything with CDR's at the current point (in pbx.c, after the __ast_pbx_run loop). It's way too late to have any affect on the CDRs. The CDR is already posted and gone, and the remnants have been cleared. 2. I was very much afraid that moving the running of the 'h' extension down into the bridge code (where it would be now practical to do it), would result in a lot more calls to the 'h' exten, so I implemented it as another exten under another name, but found, to my pleasant surprise, that there was a 1:1 correspondence to the running of the 'h' exten in the pbx_run loop, and the new spot at the end of the bridge. So, I ifdef'd out the current 'h' loop, and moved it into the bridge code. The only difference I can see is the stuff about the AST_PBX_KEEPALIVE, and hopefully, if this is still an important decision point, I can replicate it if there are complaints. To be perfectly honest, the KEEPALIVE situation is not totally clear to me, and how it relates to a post-bridge situation is less clear. I suspect the users will point out everything in total clarity if this steps on anyone's toes! 3. I temporarily swap the bridge_cdr into the channel before running the 'h' exten, which makes it possible for users to edit the cdr before it goes out the door. And, of course, with the endbeforehexten config var set, the users can also get at the billsec/duration vals. After the h exten finishes, the cdr is swapped back and processing continues as normal. Please, all who deal with CDR's, please test this version of Asterisk, and file bug reports as appropriate! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@139347 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-11Deallocate database connection handle on disconnect, as we allocate anothertilghman1-3/+14
one on connect. (closes issue #13271) Reported by: dveiga git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@137138 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-05(closes issue #12982)murf1-8/+30
Reported by: bcnit Tested by: murf I discovered that also, in the previous bug fixes and changes, the cdr.conf 'unanswered' option is not being obeyed, so I fixed this. And, yes, there are two 'answer' times involved in this scenario, and I would agree with you, that the first answer time is the time that should appear in the CDR. (the second 'answer' time is the time that the bridge was begun). I made the necessary adjustments, recording the first answer time into the peer cdr, and then using that to override the bridge cdr's value. To get the 'unanswered' CDRs to appear, I purposely output them, using the dial cmd to mark them as DIALED (with a new flag), and outputting them if they bear that flag, and you are in the right mode. I also corrected one small mention of the Zap device to equally consider the dahdi device. I heavily tested 10-sec-wait macros in dial, and without the macro call; I tested hangups while the macro was running vs. letting the macro complete and the bridge form. Looks OK. Removed all the instrumentation and debug. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@135799 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-31(closes issue #11849)murf1-5/+14
Reported by: greyvoip Tested by: murf OK, a few days of debugging, a bunch of instrumentation in chan_sip, main/channel.c, main/pbx.c, etc. and 5 solid notebook pages of notes later, I have made the small tweek necc. to get the start time right on the second CDR when: A Calls B B answ. A hits Xfer button on sip phone, A dials C and hits the OK button, A hangs up C answers ringing phone B and C converse B and/or C hangs up But does not harm the scenario where: A Calls B B answ. B hits xfer button on sip phone, B dials C and hits the OK button, B hangs up C answers ringing phone A and C converse A and/or C hangs up The difference in start times on the second CDR is because of a Masquerade on the B channel when the xfer number is sent. It ends up replacing the CDR on the B channel with a duplicate, which ends up getting tossed out. We keep a pointer to the first CDR, and update *that* after the bridge closes. But, only if the CDR has changed. I hope this change is specific enough not to muck up any current CDR-based apps. In my defence, I assert that the previous information was wrong, and this change fixes it, and possibly other similar scenarios. I wonder if I should be doing the same thing for the channel, as I did for the peer, but I can't think of a scenario this might affect. I leave it, then, as an exersize for the users, to find the scenario where the chan's CDR changes and loses the proper start time. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@134883 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-30launch_netscript sometimes returns -1, which fails to set AGISTATUS. Maptilghman1-1/+1
failure to -1, so that AGISTATUS is always set. (closes issue #13199) Reported by: smw1218 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@134480 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-18Fix a bug in blind transfers where the BLINDTRANSFER variable isn't always ↵bbryant1-2/+2
set to the other end of the blind transfer. (closes issue #12586) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@131915 f38db490-d61c-443f-a65b-d21fe96a405b