[Pkg-voip-commits] r7211 - in /asterisk/trunk/debian: changelog patches/astcanary_startup patches/hardware_dtmf_mute_fix patches/series

tzafrir-guest at alioth.debian.org tzafrir-guest at alioth.debian.org
Wed May 13 19:53:27 UTC 2009


Author: tzafrir-guest
Date: Wed May 13 19:53:26 2009
New Revision: 7211

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=7211
Log:
* Patch astcanary_startup: Avoid a false death of the canary 
  (Closes: #528497).
* Patch hardware_dtmf_mute_fix: Fix muting of DAHDI channels with hardware
  DTMF detection.

Added:
    asterisk/trunk/debian/patches/astcanary_startup
    asterisk/trunk/debian/patches/hardware_dtmf_mute_fix
Modified:
    asterisk/trunk/debian/changelog
    asterisk/trunk/debian/patches/series

Modified: asterisk/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/changelog?rev=7211&op=diff
==============================================================================
--- asterisk/trunk/debian/changelog (original)
+++ asterisk/trunk/debian/changelog Wed May 13 19:53:26 2009
@@ -14,8 +14,12 @@
   * Patch dahdi_ptmp_nt: (not really) chan_dahdi PtMP NT support 
     (Kristijan Vrban).
   * Patch dahdi_pri_debug_spannums: add span number in PRI trace. 
-
- -- Tzafrir Cohen <tzafrir.cohen at xorcom.com>  Sun, 10 May 2009 12:14:36 +0300
+  * Patch astcanary_startup: Avoid a false death of the canary 
+    (Closes: #528497).
+  * Patch hardware_dtmf_mute_fix: Fix muting of DAHDI channels with hardware
+    DTMF detection.
+
+ -- Tzafrir Cohen <tzafrir.cohen at xorcom.com>  Wed, 13 May 2009 21:58:13 +0300
 
 asterisk (1:1.6.1.0~dfsg~rc3-1) experimental; urgency=low
 

Added: asterisk/trunk/debian/patches/astcanary_startup
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/astcanary_startup?rev=7211&op=file
==============================================================================
--- asterisk/trunk/debian/patches/astcanary_startup (added)
+++ asterisk/trunk/debian/patches/astcanary_startup Wed May 13 19:53:26 2009
@@ -1,0 +1,122 @@
+Move startup of the Asterisk canary a bit later. This prevents the fork()
+from waking the canary monitor thread too soon.
+
+Debian bug: 528497
+Upstream issue: https://issues.asterisk.org/view.php?id=15093
+
+--- a/main/asterisk.c
++++ b/main/asterisk.c
+@@ -3151,57 +3151,6 @@ int main(int argc, char *argv[])
+ 
+ 	if (isroot) {
+ 		ast_set_priority(ast_opt_high_priority);
+-		if (ast_opt_high_priority) {
+-			int cpipe[2];
+-
+-			/* PIPE signal ensures that astcanary dies when Asterisk dies */
+-			if (pipe(cpipe)) {
+-				fprintf(stderr, "Unable to open pipe for canary process: %s\n", strerror(errno));
+-				exit(1);
+-			}
+-			canary_pipe = cpipe[0];
+-
+-			snprintf(canary_filename, sizeof(canary_filename), "%s/alt.asterisk.canary.tweet.tweet.tweet", ast_config_AST_RUN_DIR);
+-
+-			/* Don't let the canary child kill Asterisk, if it dies immediately */
+-			signal(SIGPIPE, SIG_IGN);
+-
+-			canary_pid = fork();
+-			if (canary_pid == 0) {
+-				char canary_binary[128], *lastslash;
+-				int fd;
+-
+-				/* Reset signal handler */
+-				signal(SIGCHLD, SIG_DFL);
+-				signal(SIGPIPE, SIG_DFL);
+-
+-				dup2(cpipe[1], 100);
+-				close(cpipe[1]);
+-
+-				for (fd = 0; fd < 100; fd++) {
+-					close(fd);
+-				}
+-
+-				execlp("astcanary", "astcanary", canary_filename, (char *)NULL);
+-
+-				/* If not found, try the same path as used to execute asterisk */
+-				ast_copy_string(canary_binary, argv[0], sizeof(canary_binary));
+-				if ((lastslash = strrchr(canary_binary, '/'))) {
+-					ast_copy_string(lastslash + 1, "astcanary", sizeof(canary_binary) + canary_binary - (lastslash + 1));
+-					execl(canary_binary, "astcanary", canary_filename, (char *)NULL);
+-				}
+-
+-				/* Should never happen */
+-				_exit(1);
+-			} else if (canary_pid > 0) {
+-				pthread_t dont_care;
+-				close(cpipe[1]);
+-				ast_pthread_create_detached(&dont_care, NULL, canary_thread, NULL);
+-			}
+-
+-			/* Kill the canary when we exit */
+-			atexit(canary_exit);
+-		}
+ 	}
+ 
+ 	if (isroot && rungroup) {
+@@ -3354,6 +3303,55 @@ int main(int argc, char *argv[])
+ 	}
+ #endif
+ 
++	if (isroot && ast_opt_high_priority) {
++		int cpipe[2];
++
++		/* PIPE signal ensures that astcanary dies when Asterisk dies */
++		if (pipe(cpipe)) {
++			fprintf(stderr, "Unable to open pipe for canary process: %s\n", strerror(errno));
++			exit(1);
++		}
++		canary_pipe = cpipe[0];
++
++		snprintf(canary_filename, sizeof(canary_filename), "%s/alt.asterisk.canary.tweet.tweet.tweet", ast_config_AST_RUN_DIR);
++
++		/* Don't let the canary child kill Asterisk, if it dies immediately */
++		signal(SIGPIPE, SIG_IGN);
++
++		canary_pid = fork();
++		if (canary_pid == 0) {
++			char canary_binary[128], *lastslash;
++
++			/* Reset signal handler */
++			signal(SIGCHLD, SIG_DFL);
++			signal(SIGPIPE, SIG_DFL);
++
++			dup2(cpipe[1], 0);
++			close(cpipe[1]);
++			ast_close_fds_above_n(0);
++			ast_set_priority(0);
++
++			execlp("astcanary", "astcanary", canary_filename, (char *)NULL);
++
++			/* If not found, try the same path as used to execute asterisk */
++			ast_copy_string(canary_binary, argv[0], sizeof(canary_binary));
++			if ((lastslash = strrchr(canary_binary, '/'))) {
++				ast_copy_string(lastslash + 1, "astcanary", sizeof(canary_binary) + canary_binary - (lastslash + 1));
++				execl(canary_binary, "astcanary", canary_filename, (char *)NULL);
++			}
++
++			/* Should never happen */
++			_exit(1);
++		} else if (canary_pid > 0) {
++			pthread_t dont_care;
++			close(cpipe[1]);
++			ast_pthread_create_detached(&dont_care, NULL, canary_thread, NULL);
++		}
++
++		/* Kill the canary when we exit */
++		atexit(canary_exit);
++	}
++
+ 	if (ast_event_init()) {
+ 		printf("%s", term_quit());
+ 		exit(1);

Added: asterisk/trunk/debian/patches/hardware_dtmf_mute_fix
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/hardware_dtmf_mute_fix?rev=7211&op=file
==============================================================================
--- asterisk/trunk/debian/patches/hardware_dtmf_mute_fix (added)
+++ asterisk/trunk/debian/patches/hardware_dtmf_mute_fix Wed May 13 19:53:26 2009
@@ -1,0 +1,15 @@
+DAHDI hardware with hardware DTMF detection would get accidentally muted
+after a DTMF is sent.
+
+Upstream issue: https://issues.asterisk.org/view.php?id=14761
+
+--- a/channels/chan_dahdi.c
++++ b/channels/chan_dahdi.c
+@@ -4710,6 +4710,7 @@ static struct ast_frame *dahdi_handle_ev
+ 			/* absorb event */
+ 		} else {
+ #endif
++			dahdi_confmute(p, 0);
+ 			p->subs[idx].f.frametype = AST_FRAME_DTMF_END;
+ 			p->subs[idx].f.subclass = res & 0xff;
+ #ifdef HAVE_PRI

Modified: asterisk/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/series?rev=7211&op=diff
==============================================================================
--- asterisk/trunk/debian/patches/series (original)
+++ asterisk/trunk/debian/patches/series Wed May 13 19:53:26 2009
@@ -21,3 +21,6 @@
 dahdi-fxsks-hookstate
 dahdi_ptmp_nt
 dahdi_pri_debug_spannums
+
+astcanary_startup
+hardware_dtmf_mute_fix




More information about the Pkg-voip-commits mailing list