Mainline forward when Busy/DND

Hello,

Im attempting to forward an incoming call to the main reception number if the extension is busy or the user has pressed “do not Disturb”.

I added this into the main extensions.conf ;

exten => 502,104, Dial(SIP/500,20,tr)
exten => 502,105,Hangup

To give this ;

exten => 502,hint,SIP/502
exten => 502,1,Set(CALLFILENAME=${EXTEN}-${CALLERID(num)}-IN-${STRFTIME(${EPOCH},%Y%m%d%H%M%S)})
exten => 502,2,Monitor(gsm,${CALLFILENAME},m)
exten => 502,3,Dial(SIP/502,20,tr)
exten => 502,104, Dial(SIP/500,20,tr)
exten => 502,105,Hangup
exten => 502,4,Voicemail(u502)
exten => 502,5,Hangup

However the when the extension is busy or DND is pressed the call is going to voice mail as before the change, rather than the 500 extension

Any help would be greatly appreciated.

Many thanks
Gavin

Asterisk 1.2 & above need the j flag to enable the jump on busy: -

exten => 502,3,Dial(SIP/502,20,trj)