[asterisk-commits] jpeeler: branch 1.4 r137580 - /branches/1.4/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 13 16:35:38 CDT 2008


Author: jpeeler
Date: Wed Aug 13 16:35:37 2008
New Revision: 137580

URL: http://svn.digium.com/view/asterisk?view=rev&rev=137580
Log:
Register DAHDISendKeypadFacility application if dahdi_chan_mode is set to DAHDI + Zap. Mark ZapSendKeypadFacility application as deprecated on usage.


Modified:
    branches/1.4/channels/chan_dahdi.c

Modified: branches/1.4/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_dahdi.c?view=diff&rev=137580&r1=137579&r2=137580
==============================================================================
--- branches/1.4/channels/chan_dahdi.c (original)
+++ branches/1.4/channels/chan_dahdi.c Wed Aug 13 16:35:37 2008
@@ -2310,14 +2310,19 @@
 
 #ifdef HAVE_PRI
 static char *dahdi_send_keypad_facility_app = "DAHDISendKeypadFacility";
+static char *zap_send_keypad_facility_app = "ZapSendKeypadFacility";
 
 static char *dahdi_send_keypad_facility_synopsis = "Send digits out of band over a PRI";
+static char *zap_send_keypad_facility_synopsis = "Send digits out of band over a PRI";
 
 static char *dahdi_send_keypad_facility_descrip = 
 "  DAHDISendKeypadFacility(): This application will send the given string of digits in a Keypad Facility\n"
 "  IE over the current channel.\n";
-
-static int dahdi_send_keypad_facility_exec(struct ast_channel *chan, void *data)
+static char *zap_send_keypad_facility_descrip = 
+"  ZapSendKeypadFacility(): This application will send the given string of digits in a Keypad Facility\n"
+"  IE over the current channel.\n";
+
+static int send_keypad_facility_exec(struct ast_channel *chan, void *data)
 {
 	/* Data will be our digit string */
 	struct dahdi_pvt *p;
@@ -2355,6 +2360,17 @@
 	ast_mutex_unlock(&p->lock);
 
 	return 0;
+}
+
+static int dahdi_send_keypad_facility_exec(struct ast_channel *chan, void *data)
+{
+	return send_keypad_facility_exec(chan, data);
+}
+
+static int zap_send_keypad_facility_exec(struct ast_channel *chan, void *data)
+{
+	ast_log(LOG_WARNING, "Use of the command %s is deprecated, please use %s instead.\n", zap_send_keypad_facility_app, dahdi_send_keypad_facility_app);	
+	return send_keypad_facility_exec(chan, data);
 }
 
 static int pri_is_up(struct dahdi_pri *pri)
@@ -10602,7 +10618,11 @@
 			pthread_cancel(pris[i].master);
 	}
 	ast_cli_unregister_multiple(dahdi_pri_cli, sizeof(dahdi_pri_cli) / sizeof(struct ast_cli_entry));
-	ast_unregister_application(dahdi_send_keypad_facility_app);
+
+	if (*dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) {
+		ast_unregister_application(dahdi_send_keypad_facility_app);
+	}
+	ast_unregister_application(zap_send_keypad_facility_app);
 #endif
 	ast_cli_unregister_multiple(dahdi_cli, sizeof(dahdi_cli) / sizeof(struct ast_cli_entry));
 	local_astman_unregister("DialOffHook");
@@ -11618,8 +11638,12 @@
 	}
 	pri_set_error(dahdi_pri_error);
 	pri_set_message(dahdi_pri_message);
-	ast_register_application(dahdi_send_keypad_facility_app, dahdi_send_keypad_facility_exec,
+	if (*dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) {
+		ast_register_application(dahdi_send_keypad_facility_app, dahdi_send_keypad_facility_exec,
 			dahdi_send_keypad_facility_synopsis, dahdi_send_keypad_facility_descrip);
+	}
+	ast_register_application(zap_send_keypad_facility_app, zap_send_keypad_facility_exec,
+		zap_send_keypad_facility_synopsis, zap_send_keypad_facility_descrip);
 #endif
 	if ((res = setup_dahdi(0))) {
 		return AST_MODULE_LOAD_DECLINE;




More information about the asterisk-commits mailing list