mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
add sofia profile <profile> gwlist up|down to list up or downed profiles for feeding into mod distributor to exclude dead gateways
This commit is contained in:
@@ -4267,6 +4267,28 @@ void sofia_glue_del_every_gateway(sofia_profile_t *profile)
|
||||
}
|
||||
|
||||
|
||||
void sofia_glue_gateway_list(sofia_profile_t *profile, switch_stream_handle_t *stream, int up)
|
||||
{
|
||||
sofia_gateway_t *gp = NULL;
|
||||
char *r = (char *) stream->data;
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
for (gp = profile->gateways; gp; gp = gp->next) {
|
||||
int reged = (gp->state == REG_STATE_REGED);
|
||||
|
||||
if (up ? reged : !reged) {
|
||||
stream->write_function(stream, "%s ", gp->name);
|
||||
}
|
||||
}
|
||||
|
||||
if (r) {
|
||||
end_of(r) = '\0';
|
||||
}
|
||||
|
||||
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
|
||||
}
|
||||
|
||||
|
||||
void sofia_glue_del_gateway(sofia_gateway_t *gp)
|
||||
{
|
||||
if (!gp->deleted) {
|
||||
|
||||
Reference in New Issue
Block a user