[Asterisk-Dev] dialplan hint case sensitive

Sergio Chersovani mlists at c-net.it
Fri Nov 25 07:56:06 MST 2005


I noticed that the hint was not working when I write the channel name 
upcase for zap channel
for example
exten = 1,hint,zap/1
does not work
exten = 1,hint,ZAP/1
does not work

exten = 1,hint,Zap/1
work because the zt_requst create the channel with this name.

Every channel type match in the code is done with strcasecmp except in 
the ast_hint_state_changed and this could a problem


so this is the patch for the CVS v1-2 but it could be manually applied 
to all asterisk versions

Index: asterisk/pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.303
diff -u -r1.303 pbx.c
--- asterisk/pbx.c    14 Nov 2005 19:00:38 -0000    1.303
+++ asterisk/pbx.c    25 Nov 2005 14:50:36 -0000
@@ -1888,7 +1888,7 @@
         ast_copy_string(buf, ast_get_extension_app(hint->exten), 
sizeof(buf));
         parse = buf;
         for (cur = strsep(&parse, "&"); cur; cur = strsep(&parse, "&")) {
-            if (strcmp(cur, device))
+            if (strcasecmp(cur, device))
                 continue;
 
             /* Get device state for this hint */



More information about the asterisk-dev mailing list