aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2009-06-17Correct AST_LIST_APPEND_LIST behavior when list to be appended is empty.kpfleming1-5/+8
When the list to be appended is empty, and the list to be appended to is *not*, AST_LIST_APPEND_LIST would actually cause the target list to become broken, and no longer have a pointer to its last entry. This patch fixes the problem. (reported by Stanislaw Pitucha on the asterisk-dev mailing list) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@201261 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-16Improve support for media paths that can generate multiple frames at once.kpfleming3-9/+49
There are various media paths in Asterisk (codec translators and UDPTL, primarily) that can generate more than one frame to be generated when the application calling them expects only a single frame. This patch addresses a number of those cases, at least the primary ones to solve the known problems. In addition it removes the broken TRACE_FRAMES support, fixes a number of bugs in various frame-related API functions, and cleans up various code paths affected by these changes. https://reviewboard.asterisk.org/r/175/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@200991 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-10__WORDSIZE is not available on all platforms, so use sizeof(void *) instead.seanbright1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@199856 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-08Fix a typo in the stack size calculation just introduced.seanbright1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@199628 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-08Increase the size of our thread stack on 64 bit processors.seanbright1-3/+3
We were setting the stack size for each thread to 240KB regardless of architecture, which meant that in some scenarios we actually had less available stack space on 64 bit processors (pointers use 8 bytes instead of 4). So now we calculate the stack size we reserve based on the platform's __WORDSIZE, which gives us: 32 bit -> 240KB 64 bit -> 496KB 128 bit -> 1008KB (that's right, we're ready for 128 bit processors) Patch typed by me but written by several members of #asterisk-dev, including Kevin, Tilghman, and Qwell. (closes issue #14932) Reported by: jpiszcz Patches: 06052009_issue14932.patch uploaded by seanbright (license 71) Tested by: seanbright git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@199626 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-04Safely handle AMI connections/reload requests that occur during startup.seanbright1-0/+12
During asterisk startup, a lock on the list of modules is obtained by the primary thread while each module is initialized. Issue 13778 pointed out a problem with this approach, however. Because the AMI is loaded before other modules, it is possible for a module reload to be issued by a connected client (via Action: Command), causing a deadlock. The resolution for 13778 was to move initialization of the manager to happen after the other modules had already been lodaded. While this fixed this particular issue, it caused a problem for users (like FreePBX) who call AMI scripts via an #exec in a configuration file (See issue 15189). The solution I have come up with is to defer any reload requests that come in until after the server is fully booted. When a call comes in to ast_module_reload (from wherever) before we are fully booted, the request is added to a queue of pending requests. Once we are done booting up, we then execute these deferred requests in turn. Note that I have tried to make this a bit more intelligent in that it will not queue up more than 1 request for the same module to be reloaded, and if a general reload request comes in ('module reload') the queue is flushed and we only issue a single deferred reload for the entire system. As for how this will impact existing installations - Before 13778, a reload issued before module initialization was completed would result in a deadlock. After 13778, you simply couldn't connect to the manager during startup (which causes problems with #exec-that-calls-AMI configuration files). I believe this is a good general purpose solution that won't negatively impact existing installations. (closes issue #15189) (closes issue #13778) Reported by: p_lindheimer Patches: 06032009_15189_deferred_reloads.diff uploaded by seanbright (license 71) Tested by: p_lindheimer, seanbright Review: https://reviewboard.asterisk.org/r/272/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@199022 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-03Generic call forward api, ast_call_forward()dvossel1-0/+12
The function ast_call_forward() forwards a call to an extension specified in an ast_channel's call_forward string. After an ast_channel is called, if the channel's call_forward string is set this function can be used to forward the call to a new channel and terminate the original one. I have included this api call in both channel.c's ast_request_and_dial() and res_feature.c's feature_request_and_dial(). App_dial and app_queue already contain call forward logic specific for their application and options. (closes issue #13630) Reported by: festr Review: https://reviewboard.asterisk.org/r/271/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@198891 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-29Use AST_CDR_NOANSWER instead of AST_CDR_NULL as the default CDR disposition.mnicholson1-0/+1
This change also involves the addition of an AST_CDR_FLAG_ORIGINATED flag that is used on originated channels to distinguish: them from dialed channels. (closes issue #12946) Reported by: meral Patches: null-cdr2.diff uploaded by mnicholson (license 96) Tested by: mnicholson, dbrooks (closes issue #15122) Reported by: sum Tested by: sum git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@198068 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-28Allow for media to arrive from an alternate source when responding to a ↵mmichelson1-0/+17
reinvite with 491. When we receive a SIP reinvite, it is possible that we may not be able to process the reinvite immediately since we have also sent a reinvite out ourselves. The problem is that whoever sent us the reinvite may have also sent a reinvite out to another party, and that reinvite may have succeeded. As a result, even though we are not going to accept the reinvite we just received, it is important for us to not have problems if we suddenly start receiving RTP from a new source. The fix for this is to grab the media source information from the SDP of the reinvite that we receive. This information is passed to the RTP layer so that it will know about the alternate source for media. Review: https://reviewboard.asterisk.org/r/252 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@197588 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-28Add flags to chanspy audiohook so that audio stays in sync.mmichelson1-0/+4
There are two flags being added to the chanspy audiohook here. One is the pre-existing AST_AUDIOHOOK_TRIGGER_SYNC flag. With this set, we ensure that the read and write slinfactories on the audiohook do not skew beyond a certain tolerance. In addition, there is a new audiohook flag added here, AST_AUDIOHOOK_SMALL_QUEUE. With this flag set, we do not allow for a slinfactory to build up a substantial amount of audio before flushing it. For this particular issue, this means that the person spying on the call will hear the conversations in real time with very little delay in the audio. (closes issue #13745) Reported by: geoffs Patches: 13745.patch uploaded by mmichelson (license 60) Tested by: snblitz git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@197537 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-27Fix broken attended transfersjpeeler1-0/+1
The bridge was terminating immediately after the attended transfer was completed. The problem was because upon reentering ast_channel_bridge nexteventts was checked to see if it was set and if so could possibly return AST_BRIDGE_COMPLETE. (closes issue #15183) Reported by: andrebarbosa Tested by: andrebarbosa, tootai, loloski git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@197124 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-21This commit prevents cdr records with AST_CDR_FLAG_ANSLOCKED and ↵mnicholson1-0/+18
AST_CDR_FLAG_LOCKED from being updated in certain cases. This is accomplished by adding two functions to update the answer time and disposition of calls that checks for the proper lock flags. These functions are used in the ast_bridge_call() function so that ForkCDR(A) calls are respected. This patch also modifies the way ast_bridge_call() chooses the cdr record to base the bridged_cdr on. Previously the first unlocked cdr record would be chosen, now instead the first cdr record is chosen and forked cdr records are moved to the bridge_cdr. This allows the original cdr record and any forked cdr records to be properly updated with answer and end times. (closes issue #13797) Reported by: sh0t Tested by: sh0t (closes issue #14744) Reported by: deepesh git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@195881 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-27Fix 'inconsistent line endings' when autoconf 2.63 is usedkpfleming1-29/+17
Attempt to make configure script regeneration 'safe' using autoconf 2.63, which embeds a bare CR into the script, thus making Subversion complain about inconsistent line endings This commit changes the MIME type of the configure script to be 'binary' thus making Subversion no longer inspect line endings, and as a bonus 'svn diff' will no longer try to generate diff output for it, which is not generally useful anyway. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@190721 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-23unistd.h is required for usleep() on Darwin. It will not hurt to include it ↵oej1-1/+1
always on other platforms either. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@190187 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-22Detect availability of pthread_rwlock_timedwrlock() before using it.tilghman2-2/+74
(closes issue #14930) Reported by: tilghman Patches: 20090420__bug14930.diff.txt uploaded by tilghman (license 14) Tested by: mvanbaak, tilghman git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@190092 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-21Add check in configure script to check for GLOB_NOMAGIC and GLOB_BRACE in ↵dbailey2-0/+17
glob.h This allows config.c to compile when linked against uclibc that does not support these parameters git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@189601 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09Oops, typotilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@187482 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09Race condition between ast_cli_command() and 'module unload' could cause a ↵tilghman1-0/+76
deadlock. Add lock timeouts to avoid this potential deadlock. (closes issue #14705) Reported by: jamessan Patches: 20090320__bug14705.diff.txt uploaded by tilghman (license 14) Tested by: jamessan git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@187428 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09Add debugging mode for diagnosing file descriptor leaks.tilghman1-0/+29
(Related to issue #14625) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@187300 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-03Fix a problem with the crypto variable definitions not actually being ↵file1-7/+7
defined properly. (closes issue #14804) Reported by: jvandal git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@186320 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19Cleaning up a few things in detect disconnect patchdvossel1-1/+5
Initialized ast_call_feature in detect_disconnect to avoid accessing uninitialized memory. Cleaned up /param tags in features.h. No longer send dynamic features in ast_feature_detect. issue #11583 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@183386 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19Remove the use of RTLD_NOLOAD, as it is not behaving like expected.russell1-4/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@183241 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19Allow disconnect feature before a call is bridgeddvossel1-0/+19
feature.conf has a disconnect option. By default this option is set to '*', but it could be anything. If a user wishes to disconnect a call before the other side answers, only '*' will work, regardless if the disconnect option is set to something else. This is because features are unavailable until bridging takes place. The default disconnect option, '*', was hardcoded in app_dial, which doesn't make any sense from a user perspective since they may expect it to be something different. This patch allows features to be detected from outside of the bridge, but not operated on. In this case, the disconnect feature can be detected before briding and handled outside of features.c. (closes issue #11583) Reported by: sobomax Patches: patch-apps__app_dial.c uploaded by sobomax (license 359) 11583.latest-patch uploaded by murf (license 17) detect_disconnect.diff uploaded by dvossel (license 671) Tested by: sobomax, dvossel Review: http://reviewboard.digium.com/r/195/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@183126 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18fix another symbol namespace issue (reported by Andrew on asterisk-dev)kpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182882 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18Fix cases where the internal poll() was not being used when it needed to be.russell4-20/+22
We have seen a number of problems caused by poll() not working properly on Mac OSX. If you search around, you'll find a number of references to using select() instead of poll() to work around these issues. In Asterisk, we've had poll.c which implements poll() using select() internally. However, we were still getting reports of problems. vadim investigated a bit and realized that at least on his system, even though we were compiling in poll.o, the system poll() was still being used. So, the primary purpose of this patch is to ensure that we're using the internal poll() when we want it to be used. The changes are: 1) Remove logic for when internal poll should be used from the Makefile. Instead, put it in the configure script. The logic in the configure script is the same as it was in the Makefile. Ideally, we would have a functionality test for the problem, but that's not actually possible, since we would have to be able to run an application on the _target_ system to test poll() behavior. 2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT is not defined. 3) Change uses of poll() throughout the source tree to ast_poll(). I feel that it is good practice to give the API call a new name when we are changing its behavior and not using the system version directly in all cases. So, normally, ast_poll() is just redefined to poll(). On systems where AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll(). 4) Change poll() in main/poll.c to be ast_internal_poll(). It's worth noting that any code that still uses poll() directly will work fine (if they worked fine before). So, for example, out of tree modules that are using poll() will not stop working or anything. However, for modules to work properly on Mac OSX, ast_poll() needs to be used. (closes issue #13404) Reported by: agalbraith Tested by: russell, vadim http://reviewboard.digium.com/r/198/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182810 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18Improve the build system to *properly* remove unnecessary symbols from the ↵kpfleming1-6/+6
runtime global namespace. Along the way, change the prefixes on some internal-only API calls to use a common prefix. With these changes, for a module to export symbols into the global namespace, it must have *both* the AST_MODFLAG_GLOBAL_SYMBOLS flag and a linker script that allows the linker to leave the symbols exposed in the module's .so file (see res_odbc.exports for an example). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182808 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18revert commit that included extranous changeskpfleming3-38/+9
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182807 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18Improve the build system to *properly* remove unnecessary symbols from the ↵kpfleming3-9/+38
runtime global namespace. Along the way, change the prefixes on some internal-only API calls to use a common prefix. With these changes, for a module to export symbols into the global namespace, it must have *both* the AST_MODFLAG_GLOBAL_SYMBOLS flag and a linker script that allows the linker to leave the symbols exposed in the module's .so file (see res_odbc.exports for an example). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182802 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-11Fix malloc debug macros to work properly with h323.jpeeler3-17/+39
The main problem here was that cstdlib was undefining free thereby causing the proper debug macros to not be used. ast_h323.cxx has been changed to call ast_free instead to avoid the issue. Because using the ast prefix calls are a better choice, ast_free_ptr is the new wrapper for free to pass to functions. Also, a little bit of clean up was done to avoid the debug macros intentionally being redefined. (closes issue #13593) Reported by: pj git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@181133 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-05Fix problems when RTP packet frame size is changedkpfleming1-0/+10
During some code analysis, I found that calling ast_rtp_codec_setpref() on an ast_rtp session does not work as expected; it does not adjust the smoother that may on the RTP session, in fact it summarily drops it, even if it has data in it, even if the current format's framing size has not changed. This is not good. This patch changes this behavior, so that if the packetization size for the current format changes, any existing smoother is safely updated to use the new size, and if no smoother was present, one is created. A new API call for smoothers, ast_smoother_reconfigure(), was required to implement these changes. Review: http://reviewboard.digium.com/r/184/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@180372 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-20This exception does not appear to still be true for Solaris 10, and ↵tilghman1-17/+11
OpenSolaris definitely needs it to be removed. Fixed for snuff-home on -dev channel. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@177701 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-20Fixes issue with undefined audio codecs in chan_iax2dvossel1-0/+2
During iax2 call negotiation, supported codecs are passed in an Information Element containing a 2 byte field where each bit correlates to a specific codec. In 1.4 only audio codec bits 0-12 are defined, leaving bits 13-15 undefined. By default all bits are enabled unless specified otherwise. Since its a 2 byte field and 13-15 are not defined, these bits are never turned off. In trunk, bits 13-15 are defined, which means 1.4 is advertising support for codecs it does not have when talking to trunk. I fixed this by adding #define for undefined audio codec bits. These bits are then removed from iax2's full bandwidth capabilities. (closes issue #14283) Reported by: jcovert git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@177696 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-18Document the return value of the update method (as requested on -dev list)tilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@177096 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17Modify bridging to properly evaluate DTMF after first warning is playedjpeeler1-0/+2
The main problem is currently if the Dial flag L is used with a warning sound, DTMF is not evaluated after the first warning sound. To fix this, a flag has been added in ast_generic_bridge for playing the warning which ensures that if a scheduled warning is missed, multiple warrnings are not played back (due to a feature evaluation or waiting for digits). ast_channel_bridge was modified to store the nexteventts in the ast_bridge_config structure as that information was lost every time ast_channel_bridge was reentered, causing a hangup due to incorrect time calculations. (closes issue #14315) Reported by: tim_ringenbach Reviewed on reviewboard: http://reviewboard.digium.com/r/163/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@176701 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-15fix mis-spelling of the word registered.mvanbaak1-2/+2
Reported by De_Mon on #asterisk-dev. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@175921 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-13Zaptel is not DAHDI. Rather, Zaptel is actually Zaptel. (in case you're ↵qwell1-1/+1
confused, DAHDI is still DAHDI) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@175698 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-30Fix feature inheritance with builtin featurestwilson1-11/+0
When using builtin features like parking and transfers, the AST_FEATURE_* flags would not be set correctly for all instances when either performing a builtin attended transfer, or parking a call and getting the timeout callback. Also, there was no way on a per-call basis to specify what features someone should have on picking up a parked call (since that doesn't involve the Dial() command). There was a global option for setting whether or not all users who pickup a parked call should have AST_FEATURE_REDIRECT set, but nothing for DISCONNECT, AUTOMON, or PARKCALL. This patch: 1) adds the BRIDGE_FEATURES dialplan variable which can be set either in the dialplan or with setvar in channels that support it. This variable can be set to any combination of 't', 'k', 'w', and 'h' (case insensitive matching of the equivalent dial options), to set what features should be activated on this channel. The patch moves the setting of the features datastores into the bridging code instead of app_dial to help facilitate this. 2) adds global options parkedcallparking, parkedcallhangup, and parkedcallrecording to be similar to the parkedcalltransfers option for globally setting features. 3) has builtin_atxfer call builtin_parkcall if being transfered to the parking extension since tracking everything through multiple masquerades, etc. is difficult and error-prone 4) attempts to fix all cases of return calls from parking and completed builtin transfers not having the correct permissions (closes issue #14274) Reported by: aragon Patches: fix_feature_inheritence.diff.txt uploaded by otherwiseguy (license 396) Tested by: aragon, otherwiseguy Review http://reviewboard.digium.com/r/138/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@172517 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-28This patch fixes h-exten running misbehavior in manager-redirected murf1-0/+4
situations. What it does: 1. A new Flag value is defined in include/asterisk/channel.h, AST_FLAG_BRIDGE_HANGUP_DONT, which used as a messenge to the bridge hangup exten code not to run the h-exten there (nor publish the bridge cdr there). It will done at the pbx-loop level instead. 2. In the manager Redirect code, I set this flag on the channel if the channel has a non-null pbx pointer. I did the same for the second (chan2) channel, which gets run if name2 is set... and the first succeeds. 3. I restored the ending of the cdr for the pbx loop h-exten running code. Don't know why it was removed in the first place. 4. The first attempt at the fix for this bug was to place code directly in the async_goto routine, which was called from a large number of places, and could affect a large number of cases, so I tested that fix against a fair number of transfer scenarios, both with and without the patch. In the process, I saw that putting the fix in async_goto seemed not to affect any of the blind or attended scenarios, but still, I was was highly concerned that some other scenarios I had not tested might be negatively impacted, so I refined the patch to its current scope, and jmls tested both. In the process, tho, I saw that blind xfers in one situation, when the one-touch blind-xfer feature is used by the peer, we got strange h-exten behavior. So, I inserted code to swap CDRs and to set the HANGUP_DONT field, to get uniform behavior. 5. I added code to the bridge to obey the HANGUP_DONT flag, skipping both publishing the bridge CDR, and running the h-exten; they will be done at the pbx-loop (higher) level instead. 6. I removed all the debug logs from the patch before committing. 7. I moved the AUTOLOOP set/reset in the h-exten code in res_features so it's only done if the h-exten is going to be run. A very minor performance improvement, but technically correct. (closes issue #14241) Reported by: jmls Patches: 14241_redirect_no_bridgeCDR_or_h_exten_via_transfer uploaded by murf (license 17) Tested by: murf, jmls git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@172030 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-22AST_RWLOCK_INIT_VALUE is always defined. What we really wanted to ask istilghman1-1/+1
whether autoconf detected a static initializer value. This fixes rwlocks on all such platforms (mainly, Mac OS X). (closes issue #13767) Reported by: jcovert Patches: 20090121__bug13767.diff.txt uploaded by Corydon76 (license 14) Tested by: jcovert, Corydon76 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@169943 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-16Fix the conjugation of Russian and Ukrainian languages.tilghman1-0/+4
(related to issue #12475) Reported by: chappell Patches: vm_multilang.patch uploaded by chappell (license 8) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168828 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-13Revert unnecessary indications API change from rev 122314russell2-16/+16
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168561 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22Re-work ref count handling of MoH classes using astobj2 to resolve crashes.russell1-0/+19
(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-19Backport of AUDIOHOOK_INHERIT for Asterisk 1.4mmichelson1-0/+27
(closes issue #13538) Reported by: mbit Patches: 13538.patch uploaded by putnopvut (license 60) Tested by: putnopvut git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166157 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-19This merges the masqpark branch into 1.4murf1-2/+0
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-0/+12
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-16Fix memory leak and invalid reporting issues with DEBUG_THREADLOCALS.russell1-1/+1
One issue was that the ast_mutex_* API was being used within the context of the thread local data destructors. We would go off and allocate more thread local data while the pthread lib was in the middle of destroying it all. This led to a memory leak. Another issue was an invalid argument being provided to the the object_add API call. (closes issue #13678) Reported by: ys Tested by: russell git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164736 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-15Add the deadlock note to ast_spawn_extension as wellmmichelson1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164422 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-15Add notes to autoservice and pbx doxygen regarding a potentialmmichelson2-0/+25
deadlock scenario so that it is avoided in the future git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164416 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-15Use autoconf logic to determine whether the system has timersub or not. Do ↵file2-1/+4
not blindly assume Solaris does not. (closes issue #13838) Reported by: ano git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164343 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-12Resolve issues that could cause DTMF to be processed out of order.russell1-1/+15
These changes come from team/russell/issue_12658 1) Change autoservice to put digits on the head of the channel's frame readq instead of the tail. If there were frames on the readq that autoservice had not yet read, the previous code would have resulted in out of order processing. This required a new API call to queue a frame to the head of the queue instead of the tail. 2) Change up the processing of DTMF in ast_read(). Some of the problems were the result of having two sources of pending DTMF frames. There was the dtmfq and the more generic readq. Both were used for pending DTMF in various scenarios. Simplifying things to only use the frame readq avoids some of the problems. 3) Fix a bug where a DTMF END frame could get passed through when it shouldn't have. If code set END_DTMF_ONLY in the middle of digit emulation, and a digit arrived before emulation was complete, digits would get processed out of order. (closes issue #12658) Reported by: dimas Tested by: russell, file Review: http://reviewboard.digium.com/r/85/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@163448 f38db490-d61c-443f-a65b-d21fe96a405b