[svn-commits] jpeeler: branch jpeeler/chan_dahdi14 r121682 - /team/jpeeler/chan_dahdi14/apps/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 10 16:07:30 CDT 2008


Author: jpeeler
Date: Tue Jun 10 16:07:29 2008
New Revision: 121682

URL: http://svn.digium.com/view/asterisk?view=rev&rev=121682
Log:
make apps backward compatible with old zap prefixes

Modified:
    team/jpeeler/chan_dahdi14/apps/app_zapbarge.c
    team/jpeeler/chan_dahdi14/apps/app_zapras.c
    team/jpeeler/chan_dahdi14/apps/app_zapscan.c

Modified: team/jpeeler/chan_dahdi14/apps/app_zapbarge.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/apps/app_zapbarge.c?view=diff&rev=121682&r1=121681&r2=121682
==============================================================================
--- team/jpeeler/chan_dahdi14/apps/app_zapbarge.c (original)
+++ team/jpeeler/chan_dahdi14/apps/app_zapbarge.c Tue Jun 10 16:07:29 2008
@@ -61,7 +61,8 @@
 
 #include "asterisk/dahdi_compat.h"
 
-static char *app = "ZapBarge";
+static char *app = "DAHDIBarge";
+static char *deprecated_app = "ZapBarge";
 
 static char *synopsis = "Barge in (monitor) Zap channel";
 
@@ -300,6 +301,13 @@
 	return res;
 }
 
+static int conf_exec_warn(struct ast_channel *chan, void *data)
+{
+    ast_log(LOG_WARNING, "Use of the command %s is deprecated, please use %s instead.\n", deprecated_app, app);
+    return conf_exec(chan, data);
+}
+
+
 static int unload_module(void)
 {
 	int res;
@@ -313,6 +321,7 @@
 
 static int load_module(void)
 {
+	ast_register_application(deprecated_app, conf_exec_warn, synopsis, descrip);
 	return ast_register_application(app, conf_exec, synopsis, descrip);
 }
 

Modified: team/jpeeler/chan_dahdi14/apps/app_zapras.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/apps/app_zapras.c?view=diff&rev=121682&r1=121681&r2=121682
==============================================================================
--- team/jpeeler/chan_dahdi14/apps/app_zapras.c (original)
+++ team/jpeeler/chan_dahdi14/apps/app_zapras.c Tue Jun 10 16:07:29 2008
@@ -59,7 +59,8 @@
 
 #include "asterisk/dahdi_compat.h"
 
-static char *app = "ZapRAS";
+static char *app = "DAHDIRAS";
+static char *deprecated_app = "ZapRAS";
 
 static char *synopsis = "Executes Zaptel ISDN RAS application";
 
@@ -239,6 +240,13 @@
 	return res;
 }
 
+static int zapras_exec_warn(struct ast_channel *chan, void *data)
+{
+    ast_log(LOG_WARNING, "Use of the command %s is deprecated, please use %s instead.\n", deprecated_app, app);
+    return zapras_exec(chan, data);
+}
+
+
 static int unload_module(void) 
 {
 	int res;
@@ -252,6 +260,7 @@
 
 static int load_module(void)
 {
+	ast_register_application(deprecated_app, zapras_exec_warn, synopsis, descrip);
 	return ast_register_application(app, zapras_exec, synopsis, descrip);
 }
 

Modified: team/jpeeler/chan_dahdi14/apps/app_zapscan.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/apps/app_zapscan.c?view=diff&rev=121682&r1=121681&r2=121682
==============================================================================
--- team/jpeeler/chan_dahdi14/apps/app_zapscan.c (original)
+++ team/jpeeler/chan_dahdi14/apps/app_zapscan.c Tue Jun 10 16:07:29 2008
@@ -60,7 +60,8 @@
 
 #include "asterisk/dahdi_compat.h"
 
-static char *app = "ZapScan";
+static char *app = "DAHDIScan";
+static char *deprecated_app = "ZapScan";
 
 static char *synopsis = "Scan Zap channels to monitor calls";
 
@@ -362,6 +363,12 @@
 	return res;
 }
 
+static int conf_exec_warn(struct ast_channel *chan, void *data)
+{
+    ast_log(LOG_WARNING, "Use of the command %s is deprecated, please use %s instead.\n", deprecated_app, app);
+    return conf_exec(chan, data);
+}
+
 static int unload_module(void)
 {
 	int res;
@@ -375,6 +382,7 @@
 
 static int load_module(void)
 {
+	ast_register_application(deprecated_app, conf_exec_warn, synopsis, descrip);
 	return ast_register_application(app, conf_exec, synopsis, descrip);
 }
 




More information about the svn-commits mailing list