mirror of https://github.com/sipwise/ngcpcfg.git
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.
47 lines
904 B
47 lines
904 B
[%
|
|
# vi: ft=tt2
|
|
|
|
# Returns a list of RTP-enabled interfaces from all hosts.
|
|
#
|
|
# @param argv.status node status [ online, offline, inactive ]
|
|
# default value: ['online', 'inactive']
|
|
# @return out The array of interfaces.
|
|
|
|
IF !argv.status.size;
|
|
argv.status = ['online', 'inactive'];
|
|
END;
|
|
|
|
status = {
|
|
online = 0
|
|
offline = 0
|
|
inactive = 0
|
|
};
|
|
FOREACH val IN argv.status;
|
|
status.$val = 1;
|
|
END;
|
|
|
|
X_out = {};
|
|
|
|
FOREACH X_host IN hosts.keys;
|
|
X_hd = hosts.$X_host;
|
|
NEXT UNLESS status.item(X_hd.status);
|
|
NEXT UNLESS ngcp.has_role(X_host, 'rtp');
|
|
|
|
FOREACH X_iface IN X_hd.interfaces;
|
|
X_if = X_hd.$X_iface;
|
|
X_types = X_if.type;
|
|
X_tgl = X_types.grep('^rtp_.');
|
|
NEXT IF X.tgl.size() == 0;
|
|
|
|
FOREACH X_type IN X_tgl;
|
|
X_type = X_type.remove('^rtp_');
|
|
X_out.$X_type = 1;
|
|
END;
|
|
END;
|
|
END;
|
|
|
|
X_vals = X_out.keys;
|
|
out = X_vals.sort;
|
|
|
|
-%]
|