BACKGROUNDSTATUS - where is it?

PlayBack returns PLAYBACKSTATUS -> SUCCESS|FAILURE
BackGround does not.

I’ve googled and found that BACKGROUNDSTATUS was added and should be included in current releases, but it is not.

I need to check sound file existence and send caller to different labels according result. As long as there is no file_exists in asterisk, this could be done by BackGrounding and sending according its status.

Any ideas how this can be done alternatively?

There is a “file exist” with the name STAT. I think it is one of the best kept secrets of Asterisk :wink:

see voip-info.org/wiki/index.php … +func+stat

I think this will help you out. Below is a copy and past from a working asterisk . STAT return 1 when the file exists. There are lots of other very usefull options.
exten => s,n,Set(PAD=/etc/asterisk/accounts.d/${ACCOUNT_NUMBER}.conf)
exten => s,n,Set(FILE_EXISTS=0)
exten => s,n,Set(FILE_EXISTS=${STAT(e,${PAD})})
exten => s,n,NoOp(${FILE_EXISTS})
;**********

exten => s,n,GotoIf($[ “${FILE_EXISTS}” : “1”]?<label or context/extensie/priority to jump to>)

lesouvage
kewl :smile: thanks