mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-16 00:04:13 +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:
1 parent
445731eea1
commit
0477cb67f5
3 files changed
+41
No files matched your search
@@ -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