[Asterisk-Users] dialplan logic, logical not

Johann johann.hoehn at ecommerce.com
Thu Jul 14 11:35:24 MST 2005


In the dial plan, with GotoIf...is there a way to do a logical 
negation(NOT)?  I want to check if the year is a leap year and the below 
code is how I would write the check in C.  According to the wiki there 
isn't a logical NOT as a valid expression.  From reading the 
asterisk/docs/README.variables, this seems to be missing.

int year = 2005;

if ( (year % 4 = 0) && !(year % 100 = 0) && (year % 400 = 0) ) {
    leapyear = true;
}


--johann



More information about the asterisk-users mailing list