diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 76b184bb8e58307f7b93a5d97a0667cfc24b4329..fa20512b145fce6b14bd26b4e4488eca769e5456 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -13795,7 +13795,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho ast_uri_encode(l, tmp_l, sizeof(tmp_l), ast_uri_sip_user); } - ourport = (p->fromdomainport) ? p->fromdomainport : ast_sockaddr_port(&p->ourip); + ourport = (p->fromdomainport && (p->fromdomainport != STANDARD_SIP_PORT)) ? p->fromdomainport : ast_sockaddr_port(&p->ourip); /* If a caller id name was specified, add a display name. */ if (cid_has_name || !cid_has_num) { @@ -14737,7 +14737,7 @@ static int transmit_notify_with_mwi(struct sip_pvt *p, int newmsgs, int oldmsgs, { struct sip_request req; struct ast_str *out = ast_str_alloca(500); - int ourport = (p->fromdomainport) ? p->fromdomainport : ast_sockaddr_port(&p->ourip); + int ourport = (p->fromdomainport && (p->fromdomainport != STANDARD_SIP_PORT)) ? p->fromdomainport : ast_sockaddr_port(&p->ourip); const char *domain; const char *exten = S_OR(vmexten, default_vmexten);