mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
two small fixes when using stun (reported by Marta Carbone):
+ externexpire was not initialized properly; + stunaddr was not handled properly on a sip reload git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -17623,6 +17623,7 @@ static int reload_config(enum channelreloadreason reason)
|
||||
stunaddr.sin_port = htons(3478);
|
||||
if (ast_parse_arg(v->value, PARSE_INADDR, &stunaddr))
|
||||
ast_log(LOG_WARNING, "Invalid STUN server address: %s\n", v->value);
|
||||
externexpire = time(NULL);
|
||||
} else if (!strcasecmp(v->name, "bindaddr")) {
|
||||
if (ast_parse_arg(v->value, PARSE_INADDR, &bindaddr))
|
||||
ast_log(LOG_WARNING, "Invalid address: %s\n", v->value);
|
||||
@@ -17868,6 +17869,10 @@ static int reload_config(enum channelreloadreason reason)
|
||||
if (option_verbose > 1)
|
||||
ast_verbose(VERBOSE_PREFIX_2 "SIP Listening on %s:%d\n",
|
||||
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
|
||||
ast_netsock_set_qos(sipsock, global_tos_sip, global_cos_sip);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (stunaddr.sin_addr.s_addr != 0) {
|
||||
ast_debug(1, "stun to %s:%d\n",
|
||||
ast_inet_ntoa(stunaddr.sin_addr) , ntohs(stunaddr.sin_port));
|
||||
@@ -17876,10 +17881,6 @@ static int reload_config(enum channelreloadreason reason)
|
||||
ast_debug(1, "STUN sees us at %s:%d\n",
|
||||
ast_inet_ntoa(externip.sin_addr) , ntohs(externip.sin_port));
|
||||
}
|
||||
ast_netsock_set_qos(sipsock, global_tos_sip, global_cos_sip);
|
||||
}
|
||||
}
|
||||
}
|
||||
ast_mutex_unlock(&netlock);
|
||||
|
||||
/* Add default domains - host name, IP address and IP:port */
|
||||
|
Reference in New Issue
Block a user