Skip to content
Snippets Groups Projects
Commit 5f3f32c4 authored by Mark Michelson's avatar Mark Michelson
Browse files

Prevent resetting of NATted realtime peer address on reload.

If a "sip reload" is issued for a SIP peer, then his
IP address will be cleared, thus resulting in forgetting the
public IP address. Asterisk will then attempt to route SIP
traffic to the private IP address.

The fix here is to make "sip reload" ignore realtime peers
when "host = dynamic" is spotted. Realtime peers can now only
have their IP address reset if they have gone from being not
dynamic to being dynamic.

(closes issue ASTERISK-18203)
reported by daren ferreira

(closes issue ASTERISK-20572)
reported by JoshE
Patches:
	fix_nat_realtime.diff uploaded by JoshE (license #6075)
........

Merged revisions 375415 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375417 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375437 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent da85f848
Branches
Tags
No related merge requests found
...@@ -30445,7 +30445,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str ...@@ -30445,7 +30445,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
} else if (!strcasecmp(v->name, "host")) { } else if (!strcasecmp(v->name, "host")) {
if (!strcasecmp(v->value, "dynamic")) { if (!strcasecmp(v->value, "dynamic")) {
/* They'll register with us */ /* They'll register with us */
if (!found || !peer->host_dynamic) { if ((!found && !realtime) || !peer->host_dynamic) {
/* Initialize stuff if this is a new peer, or if it used to /* Initialize stuff if this is a new peer, or if it used to
* not be dynamic before the reload. */ * not be dynamic before the reload. */
ast_sockaddr_setnull(&peer->addr); ast_sockaddr_setnull(&peer->addr);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment