From 29de15a8b469bfc08147f9ecfa350947a3961ccd Mon Sep 17 00:00:00 2001 From: Francesco Castellano Date: Fri, 20 Nov 2015 15:02:48 +0100 Subject: [PATCH] ASTERISK-21301 Avoid complaining about "Could not resolve... for '10.2.0.2:5060 '" check_via() already skips leading blanks where the sent-by address (with the optional port) should be placed. Since RFC 3261 allows for blanks between the port ant the Via parameters: > https://tools.ietf.org/html/rfc3261#section-20.42 (actually it allows a lot of blanks more ;-)). I just switched from ast_skip_blanks() to ast_strip() on the local copy of the string. --- channels/chan_sip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2d5843d..dd79019 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -18507,7 +18507,7 @@ static void check_via(struct sip_pvt *p, const struct sip_request *req) c = strchr(via, ' '); if (c) { *c = '\0'; - c = ast_skip_blanks(c+1); + c = ast_strip(c+1); if (strcasecmp(via, "SIP/2.0/UDP") && strcasecmp(via, "SIP/2.0/TCP") && strcasecmp(via, "SIP/2.0/TLS")) { ast_log(LOG_WARNING, "Don't know how to respond via '%s'\n", via); return; -- 2.5.0