[Asterisk-cvs] asterisk/apps app_voicemail.c,1.147,1.148

markster at lists.digium.com markster at lists.digium.com
Wed Sep 15 15:53:19 CDT 2004


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

Modified Files:
	app_voicemail.c 
Log Message:
Make ADSI in voicemail configurable (bug #2209)


Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -d -r1.147 -r1.148
--- app_voicemail.c	6 Sep 2004 15:43:43 -0000	1.147
+++ app_voicemail.c	15 Sep 2004 19:54:46 -0000	1.148
@@ -184,14 +184,8 @@
 
 static char *tdesc = "Comedian Mail (Voicemail System)";
 
-static char *adapp = "\x00\x00\x00\x0F";
-
-static char *adsec = "\x9B\xDB\xF7\xAC";
-
 static char *addesc = "Comedian Mail";
 
-static int adver = 1;
-
 static char *synopsis_vm =
 "Leave a voicemail message";
 
@@ -283,6 +277,10 @@
 static char emailtitle[100];
 static char charset[32] = "ISO-8859-1";
 
+static char adsifdn[4] = "\x00\x00\x00\x0F";
+static char adsisec[4] = "\x9B\xDB\xF7\xAC";
+static int adsiver = 1;
+
 
 STANDARD_LOCAL_USER;
 
@@ -2044,7 +2042,7 @@
 	bytes += adsi_data_mode(buf + bytes);
  	adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
 
-	if (adsi_begin_download(chan, addesc, adapp, adsec, adver)) {
+	if (adsi_begin_download(chan, addesc, adsifdn, adsisec, adsiver)) {
 		bytes = 0;
 		bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Load Cancelled.", "");
 		bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "ADSI Unavailable", "");
@@ -2142,7 +2140,7 @@
 
 	bytes = 0;
 	/* Load the session now */
-	if (adsi_load_session(chan, adapp, adver, 1) == 1) {
+	if (adsi_load_session(chan, adsifdn, adsiver, 1) == 1) {
 		*useadsi = 1;
 		bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Scripts Loaded!", "");
 	} else
@@ -2157,7 +2155,7 @@
 	int x;
 	if (!adsi_available(chan))
           return;
-	x = adsi_load_session(chan, adapp, adver, 1);
+	x = adsi_load_session(chan, adsifdn, adsiver, 1);
 	if (x < 0)
 		return;
 	if (!x) {
@@ -4347,6 +4345,7 @@
 	char *exitcxt = NULL;	
 	char *extpc;
 	int x;
+	int tmpadsi[4];
 
 	cfg = ast_load(VOICEMAIL_CONFIG);
 	ast_mutex_lock(&vmlock);
@@ -4642,6 +4641,22 @@
 			strncpy(pagerfromstring,s,sizeof(pagerfromstring)-1);	
 		if ((s=ast_variable_retrieve(cfg, "general", "charset")))
 			strncpy(charset,s,sizeof(charset)-1);
+		if ((s=ast_variable_retrieve(cfg, "general", "adsifdn"))) {
+			sscanf(s, "%2x%2x%2x%2x", &tmpadsi[0], &tmpadsi[1], &tmpadsi[2], &tmpadsi[3]);
+			for (x=0; x<4; x++) {
+				memcpy(&adsifdn[x], &tmpadsi[x], 1);
+			}
+		}
+		if ((s=ast_variable_retrieve(cfg, "general", "adsisec"))) {
+			sscanf(s, "%2x%2x%2x%2x", &tmpadsi[0], &tmpadsi[1], &tmpadsi[2], &tmpadsi[3]);
+			for (x=0; x<4; x++) {
+				memcpy(&adsisec[x], &tmpadsi[x], 1);
+			}
+		}
+		if ((s=ast_variable_retrieve(cfg, "general", "adsiver")))
+			if (atoi(s)) {
+				adsiver = atoi(s);
+			}
 		if ((s=ast_variable_retrieve(cfg, "general", "emailtitle"))) {
 			ast_log(LOG_NOTICE, "Keyword 'emailtitle' is DEPRECATED, please use 'emailsubject' instead.\n");
 			strncpy(emailtitle,s,sizeof(emailtitle)-1);




More information about the svn-commits mailing list