[Asterisk-cvs] asterisk pbx.c,1.189,1.190

markster at lists.digium.com markster at lists.digium.com
Tue Dec 28 17:57:48 CST 2004


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

Modified Files:
	pbx.c 
Log Message:
Fix pbx.c to be able to display hints (bug #3074)


Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -d -r1.189 -r1.190
--- pbx.c	28 Dec 2004 20:31:37 -0000	1.189
+++ pbx.c	28 Dec 2004 22:52:40 -0000	1.190
@@ -2869,6 +2869,7 @@
 				e = ast_walk_context_extensions(c, NULL);
 				while (e) {
 					struct ast_exten *p;
+					int prio;
 
 					/* looking for extension? is this our extension? */
 					if (exten &&
@@ -2897,11 +2898,18 @@
 					snprintf(buf, sizeof(buf), "'%s' =>",
 						ast_get_extension_name(e));
 
-					snprintf(buf2, sizeof(buf2),
-						"%d. %s(%s)",
-						ast_get_extension_priority(e),
-						ast_get_extension_app(e),
-						(char *)ast_get_extension_app_data(e));
+					prio = ast_get_extension_priority(e);
+					if (prio == PRIORITY_HINT) {
+						snprintf(buf2, sizeof(buf2),
+							"hint: %s",
+							ast_get_extension_app(e));
+					} else {
+						snprintf(buf2, sizeof(buf2),
+							"%d. %s(%s)",
+							prio,
+							ast_get_extension_app(e),
+							(char *)ast_get_extension_app_data(e));
+					}
 
 					ast_cli(fd, "  %-17s %-45s [%s]\n", buf, buf2,
 						ast_get_extension_registrar(e));
@@ -2915,11 +2923,18 @@
 						bzero((void *)buf, sizeof(buf));
 						if (ast_get_extension_label(p))
 							snprintf(buf, sizeof(buf), "   [%s]", ast_get_extension_label(p));
-						snprintf(buf2, sizeof(buf2),
-							"%d. %s(%s)",
-							ast_get_extension_priority(p),
-							ast_get_extension_app(p),
-							(char *)ast_get_extension_app_data(p));
+						prio = ast_get_extension_priority(p);
+						if (prio == PRIORITY_HINT) {
+							snprintf(buf2, sizeof(buf2),
+								"hint: %s",
+								ast_get_extension_app(p));
+						} else {
+							snprintf(buf2, sizeof(buf2),
+								"%d. %s(%s)",
+								prio,
+								ast_get_extension_app(p),
+								(char *)ast_get_extension_app_data(p));
+						}
 
 						ast_cli(fd,"  %-17s %-45s [%s]\n",
 							buf, buf2,




More information about the svn-commits mailing list