Monitor Trunk Failures doesn't seem to be working

image

I created a Bash script to run when the trunk goes unreachable (fails to qualify) but I can’t seem to make Asterisk fire-off the script. From the CLI, I ban the SRV server it is currently registered to/qualifying against and I can watch Asterisk flip the trunk to unreachable when it fails the next Qualify, but the referenced script is never executed.

What conditions constitute a trunk failure that would make this script execute?

Based off of this, I would says making calls. As the tooltip points out:

If checked, supply the name of a custom AGI Script that will be called to report, log, email or otherwise take some action on trunk failures that are not caused by either NOANSWER or CANCEL.

So I’d say other 4xx errors, 5xx errors, etc. This doesn’t seem to be about monitoring the “status” of the trunk since qualify is an optional thing to use.

Well, if it only monitor’s failed calls, I guess that would be ok…I will have to test it that way and see.

Unreachable seems to me like something that should trigger it because unreachable always means the next outbound call fails - It shouldn’t wait for an outbound call to fail the trunk when the trunk has already flipped into a non-working state…

I will do some tests with failed calls and post the results.

It doesn’t always mean that it really depends on what the scenario is. It could qualify just fine the next attempt. Also there are plenty of providers that ignore qualifies so having it on does nothing but give you timeouts. It’s not a 100% reliable source of truth.

PJSIP won’t even attempt an outbound call on a trunk that is set to Qualify but currently isn’t - it keeps trying to qualify, but if you try a Dial on that trunk, it fails - every time.

I understand what you are saying. For proper monitoring to happen and not wait for a call to fail you need to run this externally and in a systemd timer or cronjob because there’s no mechanism to trigger this another way.