[Asterisk-cvs] asterisk/apps app_directory.c,1.14,1.14.2.1

markster at lists.digium.com markster at lists.digium.com
Tue Mar 23 00:36:36 CST 2004


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

Modified Files:
      Tag: v1-0_stable
	app_directory.c 
Log Message:
Clarify documentation on directory


Index: app_directory.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_directory.c,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -d -r1.14 -r1.14.2.1
--- app_directory.c	9 Nov 2003 06:16:07 -0000	1.14
+++ app_directory.c	23 Mar 2004 05:32:54 -0000	1.14.2.1
@@ -37,7 +37,8 @@
 "discovered from  voicemail.conf. The  context  argument  is  required,  and\n"
 "specifies  the  context  in  which to interpret the extensions. Returns 0\n"
 "unless the user hangs up. It  also sets up the channel on exit to enter the\n"
-"extension the user selected.\n";
+"extension the user selected.  Please note that the context must be the same\n"
+"as the section in voicemail.conf that the mailbox is processed from as well.\n";
 
 /* For simplicity, I'm keeping the format compatible with the voicemail config,
    but i'm open to suggestions for isolating it */
@@ -199,10 +200,15 @@
 				ast_stopstream(chan);
 				if (res > -1) {
 					if (res == '1') {
-						strncpy(chan->exten, v->name, sizeof(chan->exten)-1);
-						chan->priority = 0;
-						strncpy(chan->context, context, sizeof(chan->context)-1);
-						res = 0;
+						if (ast_exists_extension(chan, context, v->name, 1, chan->callerid)) {
+							strncpy(chan->exten, v->name, sizeof(chan->exten)-1);
+							chan->priority = 0;
+							strncpy(chan->context, context, sizeof(chan->context)-1);
+							res = 0;
+						} else {
+							ast_log(LOG_WARNING, "Can't find extension '%s' in context '%s'.  Did you pass the wrong context to Directory?\n", v->name, context);
+							res = -1;
+						}
 						break;
 					} else if (res == '*') {
 						res = 0;




More information about the svn-commits mailing list