[asterisk-commits] tilghman: trunk r42638 - /trunk/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Sep 10 10:35:08 MST 2006


Author: tilghman
Date: Sun Sep 10 12:35:08 2006
New Revision: 42638

URL: http://svn.digium.com/view/asterisk?rev=42638&view=rev
Log:
If the leading underscore is not stripped before comparison,
pbx_builtin_getvar_helper() will never find the associated variable.
(Bug 7892)

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=42638&r1=42637&r2=42638&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Sun Sep 10 12:35:08 2006
@@ -16314,7 +16314,8 @@
 		no++;
 		snprintf(varbuf, sizeof(varbuf), "_SIPADDHEADER%.2d", no);
 
-		if( (pbx_builtin_getvar_helper(chan, (const char *) varbuf) == (const char *) NULL) )
+		/* Compare without the leading underscore */
+		if( (pbx_builtin_getvar_helper(chan, (const char *) varbuf + 1) == (const char *) NULL) )
 			ok = TRUE;
 	}
 	if (ok) {



More information about the asterisk-commits mailing list