Revision: 5258
http://astlinux.svn.sourceforge.net/astlinux/?rev=5258&view=rev
Author: krisk84
Date: 2011-11-17 15:44:30 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
add chan_local patch
Added Paths:
-----------
branches/s2s/package/asterisk/asterisk-chan_local.patch
Added: branches/s2s/package/asterisk/asterisk-chan_local.patch
===================================================================
--- branches/s2s/package/asterisk/asterisk-chan_local.patch (rev 0)
+++ branches/s2s/package/asterisk/asterisk-chan_local.patch 2011-11-17 15:44:30 UTC (rev 5258)
@@ -0,0 +1,64 @@
+diff -urN asterisk-1.4.26.3.orig/channels/chan_local.c asterisk-1.4.26.3/channels/chan_local.c
+--- asterisk-1.4.26.3.orig/channels/chan_local.c 2009-04-23 15:13:18.000000000 -0400
++++ asterisk-1.4.26.3/channels/chan_local.c 2011-11-17 10:31:14.000000000 -0500
+@@ -27,7 +27,7 @@
+
+ #include "asterisk.h"
+
+-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 190286 $")
++ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+ #include <stdio.h>
+ #include <string.h>
+@@ -120,6 +120,7 @@
+ #define LOCAL_ALREADY_MASQED (1 << 2) /*!< Already masqueraded */
+ #define LOCAL_LAUNCHED_PBX (1 << 3) /*!< PBX was launched */
+ #define LOCAL_NO_OPTIMIZATION (1 << 4) /*!< Do not optimize using masquerading */
++#define LOCAL_MOH_PASSTHRU (1 << 5) /*!< Pass through music on hold start/stop frames */
+
+ static AST_LIST_HEAD_STATIC(locals, local_pvt);
+
+@@ -204,6 +205,9 @@
+ return and destroy p. */
+ ast_mutex_unlock(&p->lock);
+ p = local_pvt_destroy(p);
++ if (other) {
++ ast_channel_unlock(other);
++ }
+ return -1;
+ }
+
+@@ -371,9 +375,9 @@
+ return -1;
+
+ /* If this is an MOH hold or unhold, do it on the Local channel versus real channel */
+- if (condition == AST_CONTROL_HOLD) {
++ if (!ast_test_flag(p, LOCAL_MOH_PASSTHRU) && condition == AST_CONTROL_HOLD) {
+ ast_moh_start(ast, data, NULL);
+- } else if (condition == AST_CONTROL_UNHOLD) {
++ } else if (!ast_test_flag(p, LOCAL_MOH_PASSTHRU) && condition == AST_CONTROL_UNHOLD) {
+ ast_moh_stop(ast);
+ } else {
+ /* Queue up a frame representing the indication as a control frame */
+@@ -570,11 +574,11 @@
+ ast_clear_flag(p, LOCAL_LAUNCHED_PBX);
+ ast_module_user_remove(p->u_chan);
+ } else {
+- p->owner = NULL;
+ ast_module_user_remove(p->u_owner);
+ while (p->chan && ast_channel_trylock(p->chan)) {
+ DEADLOCK_AVOIDANCE(&p->lock);
+ }
++ p->owner = NULL;
+ if (p->chan) {
+ ast_queue_hangup(p->chan);
+ ast_channel_unlock(p->chan);
+@@ -631,6 +635,8 @@
+ *opts++ = '\0';
+ if (strchr(opts, 'n'))
+ ast_set_flag(tmp, LOCAL_NO_OPTIMIZATION);
++ if (strchr(opts, 'm'))
++ ast_set_flag(tmp, LOCAL_MOH_PASSTHRU);
+ }
+
+ /* Look for a context */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|