Dial plan conditional not working


I have a dial plan which uses ${EXTENSION_STATE($EXTEN)} to checking for INUSE or NOT_INUSE and then sends the plan to a label based on a negative match to NOT_INUSE which skips a hangup. Tried many different ways but I get hung up on no matter how I try to skip the hangup. Hoping another set of eyes will catch what I’m doing wrong.

exten => do_playback,1,Answer()

exten => do_playback,n,Wait(0.3)

exten => do_playback,n,Playback(${WhatToPlay})

exten => do_playback,n,Log(NOTICE, Before queue result bbb: ${EXTENSION_STATE($EXTEN)})

;exten => do_playback,n,GotoIf($["${EXTENSION_STATE(614)} = “NOT_INUSE”] ?hang )

exten => do_playback,n,Set(USE=${EXTENSION_STATE($EXTEN)})

;THIS is not working
exten => do_playback,n,GotoIf($["${USE}" != “NOT_INUSE”] ?allgood )

exten => do_playback,n(hang),10,Hangup()

exten => do_playback,n(allgood),Log(NOTICE, Call back queue result: ${USE})

exten => do_playback,n,DIAL(DAHDI/i2/xxxxxxxxx,gT)

;exten => do_playback,n.NoOp(DS INUSE)

Thanks in advance for your time

I’m not sure but trailing space could be an issue with label.
Try this and see
exten => do_playback,n,GotoIf($["${USE}" != “NOT_INUSE”]?allgood:)

If it still doesn’t work then provide CLI output for one such call.

–Satish Barot

Hey Satish,

We ended up fixing this by removing that logic and going with

exten => do_playback,n,GotoIf($["${EXTENSION_STATE(614)}" = “NOT_INUSE”]?hang:allgood)

We also found the playback was playing the sound file to a defunct channel after the hangup was called. Fixed by moving the playback logic below the hangup call. It wasn’t that big of a deal but if we got really busy we could have had many wav files kicking off to no channels creating unneeded overhead.

Thanks for looking into this.