Fail over to second proxy

I am trying to setip Redundant Proxy or redundant server for outbound calls

I have setup primary trunk and secondary trunk.

Outbound calls are using primary trunk. How can I make Asterisk switch to secondary proxy if primary fails?

Analyze the hangup cause and try a different peer if the cause suggests a local failure.

I believe that one of the popular GUIs has a subroutine containing something like “failover” in its name, which does this.

OK, will do.

Because that GUI had it inbuilt, I thought there could be some configuration in Asterisk that I could use straightaway.