Is there anyway to get FreePBX to fail gracefully if a subscriber is ‘absent’? At the moment the call just rings 4 times or so then hangs up. It’s only by trawling through the logs that I can see what’s amiss.
For bonus points if the subscriber is absent it would be great if it could send an email or execute a local command so I can be notified something has gone wrong…
“Not reachable” is where you define what happens when the phone is “absent” (not registered, not responding to SIP).
You have a lot of options to choose from. If you want e-mail or a linux command you could set those up as custom dialplan and then route your Not Reachable calls there.
But there’s the rub - where would I configure those settings for an IAX trunk? I’m not calling an extension on my system so going to
extensions>advanced and setting a “not reachable” setting for an extension I’m not trying to reach wouldn’t seem to make any sense?
Do forgive me if I’ve totally lost your point!
Yeah, it would be good to give the details up front when asking your question. The typical “subscriber is absent” message shows up in the logs when the extension is unregistered.
What is the failure scenario? The trunk itself has failed, or an extension on the other end of the trunk is unavailable?
I would say dig into the log further and figure out why. The failure method you describe is not normal. FreePBX normally detects a trunk failure and says back to the caller “All circuits are busy now.” Alternatively, if you have multiple trunks set up for your outbound route, it will just move on to the next one in the list – that is the most graceful failure mode.
I cannot think of any reason you should be experiencing four rings and then hangup on a trunk failure.
hmmm OK. I know WHY the trunk failed this morning - it’s an IAX connection being made over ZeroTier and on this occasion an employee had pulled the plug on the server at the other end so the server just was not there to receive the call when it was put through. From experience this is exactly what happens every time there’s some similar problem.
If your logs are verbose you can see more of what is happening on the failure. If asterisk says it is playing the “all circuits are busy now” message but your phone just plays ringing that means it is not playing early media.