[svn-commits] tzafrir: trunk r417863 - in /trunk: ./ contrib/scripts/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 3 09:08:08 CDT 2014


Author: tzafrir
Date: Thu Jul  3 09:08:02 2014
New Revision: 417863

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=417863
Log:
dahdi_span_config_hook: automatically register new dahdi channels

Install a hook script for DAHDI to register new spans with Asterisk
automatically by running:

  asterisk -rx 'dahdi create channel FIRST LAST'

Review: https://reviewboard.asterisk.org/r/3157/

Added:
    trunk/contrib/scripts/dahdi_span_config_hook   (with props)
Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svnview.digium.com/svn/asterisk/trunk/Makefile?view=diff&rev=417863&r1=417862&r2=417863
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Thu Jul  3 09:08:02 2014
@@ -156,6 +156,8 @@
 # a new version of Asterisk, you don't have to run menuselect to set them.
 # The file /etc/asterisk.makeopts will also be included but can be overridden
 # by the file in your home directory.
+
+DAHDI_UDEV_HOOK_DIR = /usr/share/dahdi/span_config.d
 
 GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
 USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
@@ -589,6 +591,8 @@
 	if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
 		$(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin "$(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin"; \
 	fi
+	$(INSTALL) -d $(DESTDIR)/$(DAHDI_UDEV_HOOK_DIR)
+	$(INSTALL) -m 644 contrib/scripts/dahdi_span_config_hook $(DESTDIR)$(DAHDI_UDEV_HOOK_DIR)/40-asterisk
 
 $(SUBDIRS_INSTALL):
 	+ at DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install

Added: trunk/contrib/scripts/dahdi_span_config_hook
URL: http://svnview.digium.com/svn/asterisk/trunk/contrib/scripts/dahdi_span_config_hook?view=auto&rev=417863
==============================================================================
--- trunk/contrib/scripts/dahdi_span_config_hook (added)
+++ trunk/contrib/scripts/dahdi_span_config_hook Thu Jul  3 09:08:02 2014
@@ -1,0 +1,32 @@
+#! /bin/sh
+
+# This script is intended to be called from
+# /usr/share/dahdi/dahdi_span_config, which is is typically called from
+# a udev hook script.
+#
+# 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"
+#! /bin/sh
+
+# This script is intended to be called from
+# /usr/share/dahdi/dahdi_span_config, which is is typically called from
+# a udev hook script.
+#
+# 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"

Propchange: trunk/contrib/scripts/dahdi_span_config_hook
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/contrib/scripts/dahdi_span_config_hook
------------------------------------------------------------------------------
    svn:executable = *

Propchange: trunk/contrib/scripts/dahdi_span_config_hook
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: trunk/contrib/scripts/dahdi_span_config_hook
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the svn-commits mailing list