Dialing between two different channel technologies

Hi.
I have to trunks for outgoing calls DAHDI and SIP.
What i want to do is to try to dial out through DAHDI first and if its busy to continue dialing the number through SIP trunk.
I have found some ways to do it but wondered what would be the correct approach to achive this.
Thanks.

The “correct way” doesn’t really exist as this intends to be the “only way possible”. A standard approach would be (for the busy case):

exten => _X.,1,Dial(DAHDI/xxx/${EXTEN}) exten => _X.,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?sipd:end) exten => _X.,n(sipd),Dial(SIP/xxx/${EXTEN}) exten => _X.,n(end),Hangup

Yes is see , DIALSTATUS checking was the the way mostly mentioned but i thought perhaps there was a better alternative.
Anyhow will have to go with that. Thank you for your help.