[Asterisk-cvs] asterisk/apps app_enumlookup.c,1.17,1.18

kpfleming kpfleming
Tue Sep 13 21:37:40 CDT 2005


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

Modified Files:
	app_enumlookup.c 
Log Message:
extensive ENUM support update, including ENUMLOOKUP() dialplan function (issue #5201 with mods)


Index: app_enumlookup.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_enumlookup.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- app_enumlookup.c	7 Aug 2005 22:32:30 -0000	1.17
+++ app_enumlookup.c	14 Sep 2005 01:36:15 -0000	1.18
@@ -38,7 +38,7 @@
 
 static char *synopsis = "Lookup number in ENUM";
 
-static char *descrip = 
+static char *descrip =
 "  EnumLookup(exten):  Looks up an extension via ENUM and sets\n"
 "the variable 'ENUM'. For VoIP URIs this variable will \n"
 "look like 'TECHNOLOGY/URI' with the appropriate technology.\n"
@@ -71,6 +71,9 @@
 	char dest[80];
 	char tmp[256];
 	char *c,*t;
+
+       tech[0] = '\0';
+
 	struct localuser *u;
 
 	if (!data || ast_strlen_zero(data)) {
@@ -79,7 +82,7 @@
 	}
 	LOCAL_USER_ADD(u);
 	if (!res) {
-		res = ast_get_enum(chan, data, dest, sizeof(dest), tech, sizeof(tech));
+               res = ast_get_enum(chan, data, dest, sizeof(dest), tech, sizeof(tech), NULL, NULL);
 		printf("ENUM got '%d'\n", res);
 	}
 	LOCAL_USER_REMOVE(u);
@@ -105,7 +108,7 @@
 			snprintf(tmp, sizeof(tmp), "%s/%s", h323driver, c);
 /* do a s!;.*!! on the H323 URI */
 			t = strchr(c,';');
-			if (t) 
+                       if (t)
 				*t = 0;
 			pbx_builtin_setvar_helper(chan, "ENUM", tmp);
 		} else if (!strcasecmp(tech, "iax")) {
@@ -130,7 +133,7 @@
 				res = 0;
 			} else {
 /* now copy over the number, skipping all non-digits and stop at ; or NULL */
-				t = tmp;	
+                               t = tmp;
 				while( *c && (*c != ';') && (t - tmp < (sizeof(tmp) - 1))) {
 					if (isdigit(*c))
 						*t++ = *c;




More information about the svn-commits mailing list