I am trying to transfer call to next extension if previous is using (INUSE) or call is in progress. I tried to use EXTENSION_STATE(extension[@context])
to find the status as follow:
[sales]
exten => s,1,Dial(SIP/123)
exten => s,n,GotoIf($["${EXTENSION_STATE(123)}"="INUSE"]?passed:failed)
exten => s,n(passed),Dial(SIP/124)
exten => s,n(failed),Hangup();if other
But wasn't successful. How can I do that?