Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 341369) +++ channels/chan_sip.c (working copy) @@ -264,7 +264,6 @@ #include "asterisk/cel.h" #include "asterisk/data.h" #include "asterisk/aoc.h" -#include "asterisk/pval.h" #include "sip/include/sip.h" #include "sip/include/globals.h" #include "sip/include/config_parser.h" @@ -5273,7 +5272,7 @@ dialog->relatedpeer = ref_peer(peer, "create_addr: setting dialog's relatedpeer pointer"); unref_peer(peer, "create_addr: unref peer from find_peer hashtab lookup"); return res; - } else if (is_int(peername)) { + } else if (ast_check_digits(peername)) { /* Although an IPv4 hostname *could* be represented as a 32-bit integer, it is uncommon and * it makes dialing SIP/${EXTEN} for a peer that isn't defined resolve to an IP that is * almost certainly not intended. It is much better to just reject purely numeric hostnames */ Index: include/asterisk/strings.h =================================================================== --- include/asterisk/strings.h (revision 341369) +++ include/asterisk/strings.h (working copy) @@ -872,6 +872,25 @@ ) /*! + * \brief Check if a string is only digits + * + * \retval 1 The string contains only digits + * \retval 0 The string contains non-digit characters + */ +AST_INLINE_API( +int ast_check_digits(char *arg), +{ + char *s; + for (s=arg; *s; s++) { + if (*s < '0' || *s > '9') { + return 0; + } + } + return 1; +} +) + +/*! * \brief Compute a hash value on a string * * This famous hash algorithm was written by Dan Bernstein and is