mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Ensure that a valid bind host is specified for transports.
(closes issue ASTERISK-22017) Reported by: Rusty Newton git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -101,6 +101,11 @@ static int transport_apply(const struct ast_sorcery *sorcery, void *obj)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (transport->host.addr.sa_family != PJ_AF_INET && transport->host.addr.sa_family != PJ_AF_INET6) {
|
||||
ast_log(LOG_ERROR, "Transport '%s' could not be started as binding not specified\n", ast_sorcery_object_get_id(obj));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Set default port if not present */
|
||||
if (!pj_sockaddr_get_port(&transport->host)) {
|
||||
pj_sockaddr_set_port(&transport->host, (transport->type == AST_TRANSPORT_TLS) ? 5061 : 5060);
|
||||
|
Reference in New Issue
Block a user