diff --git a/channels/sip/config_parser.c b/channels/sip/config_parser.c index 0ab9ed7693..72a7b2c7d0 100644 --- a/channels/sip/config_parser.c +++ b/channels/sip/config_parser.c @@ -672,7 +672,9 @@ int sip_parse_host(char *line, int lineno, char **hostname, int *portnum, enum s ast_log(LOG_NOTICE, "'%s' is not a valid port number on line %d of sip.conf. using default.\n", port, lineno); port = NULL; } - } else { + } + + if (!port) { if (*transport & SIP_TRANSPORT_TLS) { *portnum = STANDARD_TLS_PORT; } else {