You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
252 lines
5.4 KiB
252 lines
5.4 KiB
[%
|
|
hostname = ngcp.get_hostname();
|
|
|
|
is_proxy = ngcp.has_role(hostname, 'proxy');
|
|
is_lb = ngcp.has_role(hostname, 'lb');
|
|
is_mgmt = ngcp.has_role(hostname, 'mgmt');
|
|
is_db = ngcp.has_role(hostname, 'db');
|
|
is_rtp = ngcp.has_role(hostname, 'rtp');
|
|
|
|
argv.host = hostname;
|
|
argv.type = 'sip_ext';
|
|
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host';
|
|
sip_ext_ips = out;
|
|
|
|
IF !sip_ext_ips.size;
|
|
argv.host = hostname;
|
|
argv.type = 'sip_ext';
|
|
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host';
|
|
sip_ext_ips = out;
|
|
END;
|
|
|
|
argv.host = hostname;
|
|
argv.type = 'sip_int';
|
|
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host';
|
|
sip_int_ips = out;
|
|
|
|
IF !sip_int_ips.size;
|
|
argv.host = hostname;
|
|
argv.type = 'sip_int';
|
|
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host';
|
|
sip_int_ips = out;
|
|
END;
|
|
|
|
IF haproxy.enable == 'yes';
|
|
sip_proxy_ip = sip_int_ips.0;
|
|
ELSE;
|
|
sip_proxy_ip = sip_ext_ips.0;
|
|
END;
|
|
|
|
argv.host = hostname;
|
|
argv.type = 'web_ext';
|
|
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host';
|
|
web_ext_ips = out;
|
|
|
|
IF !web_ext_ips.size;
|
|
argv.host = hostname;
|
|
argv.type = 'web_ext';
|
|
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host';
|
|
web_ext_ips = out;
|
|
END;
|
|
|
|
argv.host = hostname;
|
|
argv.type = 'web_int';
|
|
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host';
|
|
web_int_ips = out;
|
|
|
|
IF !web_int_ips.size;
|
|
argv.host = hostname;
|
|
argv.type = 'web_int';
|
|
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host';
|
|
web_int_ips = out;
|
|
END;
|
|
|
|
argv.host = hostname;
|
|
argv.type = 'ha_int';
|
|
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host';
|
|
ha_int_ips = out;
|
|
|
|
redis_ips = ['127.0.0.1', ha_int_ips.0];
|
|
redis_ips = redis_ips.sort.unique;
|
|
-%]
|
|
|
|
port:
|
|
|
|
[% IF is_mgmt -%]
|
|
# Nginx (IPv6 due to listening on all address families)
|
|
tcp6:80:
|
|
listening: true
|
|
|
|
# Nginx HTTPS (NGCP Panel)
|
|
tcp:443:
|
|
listening: true
|
|
ip: ["[% web_ext_ips.0 %]"]
|
|
|
|
# Nginx HTTPS (NGCP Panel API)
|
|
tcp:1442:
|
|
listening: true
|
|
ip: ["127.0.0.1"]
|
|
tcp6:1442:
|
|
listening: true
|
|
ip: ["::1"]
|
|
|
|
# Nginx HTTPS (NGCP Panel Admin)
|
|
tcp:1443:
|
|
listening: true
|
|
ip: ["[% web_int_ips.0 %]"]
|
|
|
|
# Nginx status port
|
|
tcp:[% nginx.status_port %]:
|
|
listening: true
|
|
ip: ["127.0.0.1"]
|
|
tcp6:[% nginx.status_port %]:
|
|
listening: true
|
|
ip: ["::1"]
|
|
|
|
[% END -%]
|
|
[% IF is_mgmt && pbx.enable == 'yes' -%]
|
|
# HTTPS PBX autoprovisioning
|
|
tcp:1444:
|
|
listening: true
|
|
ip: ["[% web_ext_ips.0 %]"]
|
|
|
|
# HTTP PBX autoprovisioning
|
|
tcp:1445:
|
|
listening: true
|
|
ip: ["[% web_ext_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
# MySQL
|
|
tcp:3306:
|
|
listening: true
|
|
ip: ["[% general.ngcp_type == 'spce' ? '127.0.0.1' : '0.0.0.0' %]"]
|
|
|
|
[% IF is_lb -%]
|
|
# Kamailio load-balancer
|
|
tcp:5060:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_ext_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
[% IF is_proxy -%]
|
|
# Kamailio proxy
|
|
tcp:5062:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_int_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
[% IF is_proxy -%]
|
|
# Prosody (xmpp-client)
|
|
tcp:5222:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_proxy_ip %]"]
|
|
|
|
[% ELSIF is_lb -%]
|
|
# HAProxy: Prosody (xmpp-client)
|
|
tcp:5222:
|
|
listening: [% haproxy.enable == 'yes' ? 'true' : 'false' %]
|
|
ip: ["[% sip_ext_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
[% IF is_proxy -%]
|
|
# Prosody (xmpp-server)
|
|
tcp:5269:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_proxy_ip %]"]
|
|
|
|
[% ELSIF is_lb -%]
|
|
# HAProxy: Prosody (xmpp-server)
|
|
tcp:5269:
|
|
listening: [% haproxy.enable == 'yes' ? 'true' : 'false' %]
|
|
ip: ["[% sip_ext_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
[% IF is_proxy -%]
|
|
# Prosody (http)
|
|
tcp:5280:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_int_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
[% IF is_proxy -%]
|
|
# Prosody (https)
|
|
tcp:5281:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_int_ips.0 %]"]
|
|
|
|
[% ELSIF is_lb -%]
|
|
# HAProxy: Prosody (http)
|
|
tcp:5281:
|
|
listening: [% haproxy.enable == 'yes' ? 'true' : 'false' %]
|
|
ip: ["[% sip_ext_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
[% IF is_proxy -%]
|
|
# Prosody (ctrl)
|
|
tcp:5582:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_int_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
[% IF is_lb -%]
|
|
# HAProxy admin
|
|
tcp:8080:
|
|
listening: [% haproxy.enable == 'yes' && haproxy.admin == 'yes' ? 'true' : 'false' %]
|
|
ip: ["[% sip_ext_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
[% IF is_proxy -%]
|
|
[% IF b2b.enable == "yes" -%]
|
|
# SEMS: XMLRPC server of B2B
|
|
tcp:[% b2b.xmlrpcport %]:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_int_ips.0 %]"]
|
|
|
|
# SEMS: B2B server UDP listener
|
|
udp:[% b2b.bindport %]:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_int_ips.0 %]"]
|
|
|
|
# SEMS: B2B server TCP listener
|
|
tcp:[% b2b.bindport %]:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_int_ips.0 %]"]
|
|
|
|
# SEMS: Monit UDP port
|
|
udp:[% general.ngcp_type == 'spce' ? '5040' : '5048' %]:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_int_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
# Asterisk
|
|
tcp:5038:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["127.0.0.1"]
|
|
|
|
# Asterisk
|
|
udp:5070:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_int_ips.0 %]"]
|
|
|
|
[% END -%]
|
|
[% IF is_rtp || is_proxy || is_db -%]
|
|
# Redis
|
|
tcp:6379:
|
|
listening: true
|
|
ip:
|
|
[% FOREACH ip IN redis_ips -%]
|
|
- "[% ip %]"
|
|
[% END -%]
|
|
tcp6:6379:
|
|
listening: true
|
|
ip: ["::1"]
|
|
|
|
[% END -%]
|
|
[% IF is_rtp -%]
|
|
# rtpengine
|
|
udp:2223:
|
|
listening: {{.Vars.NODE_ACTIVE}}
|
|
ip: ["[% sip_int_ips.0 %]"]
|
|
|
|
[% END -%]
|