aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/pbx.h
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-29 05:01:00 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-29 05:01:00 +0000
commit6d700c596a033bff998725c22c179bf205b0212c (patch)
tree5f254ce954a02acbb73b4e76a4f675e21c6eb80e /include/asterisk/pbx.h
parent9259a0fd2921ee286b690c48bbd11ea50e3013a9 (diff)
Merged revisions 152535 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r152535 | murf | 2008-10-28 22:36:32 -0600 (Tue, 28 Oct 2008) | 46 lines The magic trick to avoid this crash is not to 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. Why? because CDR's aren't generated via parking, so nothing is needed, but if a transfer occurred, there are critical things I need. 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/trunk@152536 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/pbx.h')
-rw-r--r--include/asterisk/pbx.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h
index b4bec238e..d2d95acca 100644
--- a/include/asterisk/pbx.h
+++ b/include/asterisk/pbx.h
@@ -37,12 +37,13 @@ extern "C" {
#define AST_PBX_REPLACE 1
/*! \brief Special return values from applications to the PBX { */
-#define AST_PBX_HANGUP -1 /*!< Jump to the 'h' exten */
-#define AST_PBX_OK 0 /*!< No errors */
-#define AST_PBX_ERROR 1 /*!< Jump to the 'e' exten */
-#define AST_PBX_KEEPALIVE 10 /*!< Destroy the thread, but don't hang up the channel */
-#define AST_PBX_NO_HANGUP_PEER 11
-#define AST_PBX_INCOMPLETE 12 /*!< Return to PBX matching, allowing more digits for the extension */
+#define AST_PBX_HANGUP -1 /*!< Jump to the 'h' exten */
+#define AST_PBX_OK 0 /*!< No errors */
+#define AST_PBX_ERROR 1 /*!< Jump to the 'e' exten */
+#define AST_PBX_KEEPALIVE 10 /*!< Destroy the thread, but don't hang up the channel */
+#define AST_PBX_NO_HANGUP_PEER 11 /*!< The peer has been involved in a transfer */
+#define AST_PBX_INCOMPLETE 12 /*!< Return to PBX matching, allowing more digits for the extension */
+#define AST_PBX_NO_HANGUP_PEER_PARKED 13 /*!< Don't touch the peer channel - it was sent to the parking lot and might be gone by now */
/*! } */
#define PRIORITY_HINT -1 /*!< Special Priority for a hint */