From 3b50570c9ba60e9ce83cb275a202d8ea8201e7ae Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Mon, 21 Nov 2005 19:31:26 +0000 Subject: [PATCH] backport fix from HEAD branch git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-2@7184 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- ChangeLog | 2 ++ channels/chan_iax2.c | 2 ++ channels/chan_sip.c | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6c4a447aae..2d4dec5d0e 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,10 @@ 2005-11-21 Kevin P. Fleming * channels/chan_sip.c (build_peer): ensure that case changes made to peer names are not ignored during reload operations + (build_peer): when a peer is changed from dynamic to static mode, reset the default port number if no other has been specified * channels/chan_iax2.c (build_peer and build_user): ensure that case changes made to peer/user names are not ignored during reload operations + (build_peer): when a peer is changed from dynamic to static mode, reset the default port number if no other has been specified 2005-11-21 Russell Bryant diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 87295d6a3c..61a07772c3 100755 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -8200,6 +8200,8 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, in free(peer); return NULL; } + if (!peer->addr.sin_port) + peer->addr.sin_port = htons(IAX_DEFAULT_PORTNO); } if (!maskfound) inet_aton("255.255.255.255", &peer->mask); diff --git a/channels/chan_sip.c b/channels/chan_sip.c index e6faa6b4ea..0daf12f89d 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12100,8 +12100,11 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int } if (!strcasecmp(v->name, "outboundproxy")) obproxyfound=1; - else + else { ast_copy_string(peer->tohost, v->value, sizeof(peer->tohost)); + if (!peer->addr.sin_port) + peer->addr.sin_port = htons(DEFAULT_SIP_PORT); + } } } else if (!strcasecmp(v->name, "defaultip")) { if (ast_get_ip(&peer->defaddr, v->value)) {