summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-08-21 17:35:15 +0000
committerMatthew Jordan <mjordan@digium.com>2014-08-21 17:35:15 +0000
commit77ddc5b713233674127e13ceef73f1e20d7fa6e6 (patch)
tree28647a04ce9c9b3adb98cb54559f75beabfe2e14 /channels
parentf3a525e9a6241c3c345bceae09903d46acff52b7 (diff)
chan_sip: Don't use port derived from fromdomain if it isn't set
If a user does not provide a port in the fromdomain setting, chan_sip will set the fromdomainport to STANDARD_SIP_PORT (5060). The fromdomainport value will then get used unilaterally in certain places. This causes issues with TLS, where the default port is expected to be 5061. This patch modifies chan_sip such that fromdomainport is only used if it is not the standard SIP port; otherwise, the port from the SIP pvt's recorded self IP address is used. Review: https://reviewboard.asterisk.org/r/3893/ ASTERISK-24178 #close Reported by: Elazar Broad patches: fromdomainport_fix.diff uploaded by Elazar Broad (License 5835) ........ Merged revisions 421717 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 421718 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 421719 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 421720 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index f28ad5821..41ea8e6dc 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13954,7 +13954,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) {
@@ -14920,7 +14920,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);