Index: include/asterisk/strings.h =================================================================== --- include/asterisk/strings.h (revision 192353) +++ include/asterisk/strings.h (working copy) @@ -899,4 +899,23 @@ return abs(hash); } +/*! + * \brief Check if an input to the function is a number string or not + * + * This is a shamefull hack for this, and it really needs to be + * changed into something more suitable. Return value is set to 0 in + * case str includes non-numeric characters. + */ +static force_inline int ast_is_numeric(const char *str) +{ + if (strncmp(str,"-",1) || strncmp(str,"+",1)) + str++; + while(*str) { + if(!isdigit(*str)) + return 0; + str++; + } + return 1; +} + #endif /* _ASTERISK_STRINGS_H */