[Pkg-voip-commits] [asterisk] 03/03: Add a DAHDI hook script for Asterisk

tzafrir at debian.org tzafrir at debian.org
Fri Dec 23 14:26:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

tzafrir pushed a commit to branch master
in repository asterisk.

commit 6384ec2990e1878e54cf71168ca22c2515e1c41a
Author: Tzafrir Cohen <tzafrir at debian.org>
Date:   Thu Dec 15 14:45:16 2016 +0200

    Add a DAHDI hook script for Asterisk
    
    This script is distributed with dahdi-tools but should only be installed
    if we have Asterisk installed.
    
    When a new DAHDI span is created, dahdi runs several hook scripts (from
    udev). This one is among them. It does nothing if there's no DAHDI
    device on the system and hence safe to add to the main package.
    
    Closes #848584.
---
 debian/50-asterisk      | 17 +++++++++++++++++
 debian/asterisk.install |  1 +
 debian/rules            |  2 ++
 3 files changed, 20 insertions(+)

diff --git a/debian/50-asterisk b/debian/50-asterisk
new file mode 100755
index 0000000..9e7e241
--- /dev/null
+++ b/debian/50-asterisk
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+# This file, if installed under /usr/share/dahdi/span_config.d/ , will
+# attempt to add a newly-generated span to a running copy of Asterisk.
+# Asterisk has to be running (if not: it will pick the span on its
+# startup), and has to have the channels already configured.
+#
+# Environment is set in
+# http://git.asterisk.org/gitweb/?p=dahdi/tools.git;a=blob;f=hotplug/dahdi_span_config
+
+if [ "$ACTION" != 'add' ]; then
+	# Nothing to do here
+	exit 0
+fi
+
+# Add to asterisk
+asterisk -rx "dahdi create channels $BASECHAN $ENDCHAN"
diff --git a/debian/asterisk.install b/debian/asterisk.install
index c8f77d9..4928438 100644
--- a/debian/asterisk.install
+++ b/debian/asterisk.install
@@ -5,4 +5,5 @@ usr/share/asterisk/keys
 usr/share/asterisk/conf
 usr/share/asterisk/documentation
 usr/share/asterisk/rest-api
+usr/share/dahdi/span_config.d/50-asterisk
 lib/systemd/system/asterisk.service
diff --git a/debian/rules b/debian/rules
index 4e00ce4..b80b8f3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -137,8 +137,10 @@ override_dh_auto_install:
 	cp -a configs $(CURDIR)/debian/tmp/usr/share/asterisk/conf
 	mkdir -p $(CURDIR)/debian/tmp/usr/bin/
 	mkdir -p $(CURDIR)/debian/tmp/usr/share/man/man1
+	mkdir -p $(CURDIR)/debian/tmp/usr/share/dahdi/span_config.d
 	cp -a debian/asterisk-config-custom $(CURDIR)/debian/tmp/usr/bin/
 	cp -a debian/asterisk-config-custom $(CURDIR)/debian/tmp/usr/share/man/man1/
+	cp -a debian/50-asterisk $(CURDIR)/debian/tmp/usr/share/dahdi/span_config.d/
 	$(RM) -f $(CURDIR)/debian/tmp/usr/sbin/conf2ael
 	$(RM) -f $(CURDIR)/debian/tmp/usr/sbin/muted
 	$(RM) -f $(CURDIR)/debian/tmp/usr/sbin/streamplayer

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/asterisk.git



More information about the Pkg-voip-commits mailing list