2

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?

Jibon
  • 31
  • 5

2 Answers2

0

Your solution is way compilcated, it's basically one of the reasons it's not working. You should rather try this, this is a common simplier approach using internal variable ${DIALSTATUS}. Since when answered - the call will be simply hung up, you just need to handle all of the erroneius statuses:

[sales] exten => s,1,Dial(SIP/123) exten => s,2,Goto(${EXTEN}-${DIALSTATUS},1) exten => s-BUSY,1,Dial(SIP/other) exten => s-CONGESTION,1,Dial(SIP/someone)

drookie
  • 8,625
  • 1
  • 19
  • 29
0

This one worked for me using GROUP_COUNT() instead of EXTENSION_STATE:

exten => s,1,Set(GROUP()=OUTBOUND_GROUP)
exten => s,2,GotoIf($[ ${GROUP_COUNT()} > 1 ]?try1:try2)
exten => s,3(try1),Dial(SIP/124)
exten => s,4(try2),Dial(SIP/123)
Jibon
  • 31
  • 5