[Asterisk-cvs] asterisk/apps app_sayunixtime.c,1.5,1.6 Makefile,1.52,1.53

jeremy at lists.digium.com jeremy at lists.digium.com
Fri Mar 19 13:28:13 CST 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv6397/apps

Modified Files:
	app_sayunixtime.c Makefile 
Log Message:
language is not supported in datetime. Bug 686


Index: app_sayunixtime.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_sayunixtime.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- app_sayunixtime.c	5 Dec 2003 17:33:30 -0000	1.5
+++ app_sayunixtime.c	19 Mar 2004 18:23:33 -0000	1.6
@@ -27,6 +27,7 @@
 static char *tdesc = "Say time";
 
 static char *app_sayunixtime = "SayUnixTime";
+static char *app_datetime = "DateTime";
 
 static char *sayunixtime_synopsis = "Says a specified time in a custom format";
 
@@ -39,6 +40,15 @@
 "  format:   a format the time is to be said in.  See voicemail.conf.\n"
 "              defaults to \"ABdY 'digits/at' IMp\"\n"
 "  Returns 0 or -1 on hangup.\n";
+static char *datetime_descrip =
+"DateTime([unixtime][|[timezone][|format]])\n"
+"  unixtime: time, in seconds since Jan 1, 1970.  May be negative.\n"
+"              defaults to now.\n"
+"  timezone: timezone, see /usr/share/zoneinfo for a list.\n"
+"              defaults to machine default.\n"
+"  format:   a format the time is to be said in.  See voicemail.conf.\n"
+"              defaults to \"ABdY 'digits/at' IMp\"\n"
+"  Returns 0 or -1 on hangup.\n";
 
 STANDARD_LOCAL_USER;
 
@@ -94,13 +104,23 @@
 
 int unload_module(void)
 {
+	int res;
 	STANDARD_HANGUP_LOCALUSERS;
-	return ast_unregister_application(app_sayunixtime);
+	res = ast_unregister_application(app_sayunixtime);
+	if (! res)
+		return ast_unregister_application(app_datetime);
+	else
+		return res;
 }
 
 int load_module(void)
 {
-	return ast_register_application(app_sayunixtime, sayunixtime_exec, sayunixtime_synopsis, sayunixtime_descrip);
+	int res;
+	res = ast_register_application(app_sayunixtime, sayunixtime_exec, sayunixtime_synopsis, sayunixtime_descrip);
+	if (! res)
+		return ast_register_application(app_datetime, sayunixtime_exec, sayunixtime_synopsis, datetime_descrip);
+	else
+		return res;
 }
 
 char *description(void)

Index: Makefile
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/Makefile,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- Makefile	9 Mar 2004 15:57:16 -0000	1.52
+++ Makefile	19 Mar 2004 18:23:33 -0000	1.53
@@ -18,7 +18,7 @@
 APPS=app_dial.so app_playback.so app_voicemail.so app_directory.so app_mp3.so\
      app_system.so app_echo.so app_record.so app_image.so app_url.so app_disa.so \
      app_agi.so app_qcall.so app_adsiprog.so app_getcpeid.so app_milliwatt.so \
-     app_zapateller.so app_datetime.so app_setcallerid.so app_festival.so \
+     app_zapateller.so app_setcallerid.so app_festival.so \
      app_queue.so app_senddtmf.so app_parkandannounce.so app_striplsd.so \
      app_setcidname.so app_lookupcidname.so app_substring.so app_macro.so \
      app_authenticate.so app_softhangup.so app_lookupblacklist.so \
@@ -60,6 +60,7 @@
 
 install: all
 	for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+	rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
 
 app_todd.o: app_todd.c
 	gcc -pipe -O6 -g  -Iinclude -I../include -D_REENTRANT -march=i586 -DDO_CRASH -c -o  app_todd.o app_todd.c




More information about the svn-commits mailing list