aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-21 19:27:26 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-21 19:27:26 +0000
commit858df9dd8759e24caf3e271c86255a75fd0e2273 (patch)
treec0da2affc9b573da97b70e24b48b892c2e99d5ec
parentd4f49b35f212d205cfc05f8944c6fe54033901a7 (diff)
fix port number handling in peer building functions
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7182 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xChangeLog7
-rwxr-xr-xchannels/chan_iax2.c2
-rwxr-xr-xchannels/chan_sip.c5
3 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d94e3ac7..6e709e0ef 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,10 @@
2005-11-21 Kevin P. Fleming <kpfleming@digium.com>
- * channels/chan_sip.c: ensure that case changes made to peer/user names are not ignored during reload operations
- * channels/chan_iax2.c: ensure that case changes made to peer/user names are not ignored during reload operations
+ * 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 Josh Roberson <josh@asteriasgi.com>
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index fa95b9185..74b5da3f9 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 e6faa6b4e..0daf12f89 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)) {