Recording on DIALSTATUS=ANSWER

Hello All,
I have the following code

[color=#0000BF][incoming-call]
exten=>s,1,Dial(sip/100&sip/101)
exten =>s,n,Goto(s-${DIALSTATUS},1)

exten=>s-ANSWER,1,Set(CALLFILENAME=${FileName})
exten=>s-ANSWER,2,Monitor(wav,${CALLFILENAME},m)

exten=>s-BUSY,1,Hangup()[/color]

when the calls answered by extensions 100 & 101. I want to start the recording but if the extensions are busy it is simply hanging up.
The problem is it works for busy status but if the call is answered the recording don’t start or it don’t jumps to ANSWER status.
any idea or help in this regard.

why not use the b option in mixmonitor much neater.

Ian

Normally, DIAL doesn’t return on an answer…the caller is connected to the callee and they talk. When they hang up the call is ended. (you can use the g option to make it continue lines after the dial if the called party hangs up or turn on the priorityjump, but I’d stay away from handling it that way)

[incoming-call]
exten=>s,1,MixMonitor(${FileName}.wav,b)
exten=>s,n,Dial(sip/100&sip/101)

I haven’t tried it but the above should work. As Ian said, use the b option with mixmonitor to only record the call when bridged.

Be warned that unless your changing that FileName to be unique each time, you will be overwriting your recorded call.

Hello,
Thank you so much for the replies. I solved my problem by using M(x) option in the Dial application.
I wrote the macro for recording and than called the macro in the dial application and this really solved the problem.
but anyway thank you all again.

[[1clicktocall]
exten => _XXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _XXXXXXXX,n,Set(UniqueID={UNIQUEID}) exten => _XXXXXXXX,n,Set(CALLED={EXTEN})
exten => _XXXXXXXX,n,Set(DID={CALLERID(num)}) exten => _XXXXXXXX,n,NoOp(============ {UniqueID} ==============)
exten => _XXXXXXXX,n,Set(CALLTIME={STRFTIME({EPOCH},%d%m%Y-%H%M%S)})
exten => XXXXXXXX,n,Set(CALLFILE={CALLTIME}_{DID}{CALLED}) exten => _XXXXXXXX,n,Set(CALLTYPE=outbound) exten => _XXXXXXXX,n,MixMonitor(/var/spool/asterisk/monitorDONE/MP3/{CALLFILE}.wav,b)
;exten => _XXXXXXXX,n,MixMonitor(/var/spool/asterisk/clicktocall/{CALLFILE}.wav) exten => _XXXXXXXX,n,AGI(recording_log.php,{CALLFILE},{DID},{UniqueID},{Caller},{CALLED})
exten => _XXXXXXXX,n,Dial(SIP/{EXTEN}@zain,40,g) exten => _XXXXXXXX,n,NoOp(============ dial status is {DIALSTATUS} by irfan ==============)
exten => _XXXXXXXX,n,Goto(s-{DIALSTATUS},1) exten => s-ANSWER,1,Goto(connected,1) exten => s-ANSWERED,1,Goto(connected,1) exten => s-NOANSWER,1,Goto(misscall,1) exten => s-BUSY,1,Goto(notconnected,1) exten =>misscall,1,AGI(misscall_log.php,{CALLFILE},{DID},{UniqueID},{Caller},{CALLED})
exten =>misscall,2,AGI(CallLogApi.php,{DID},{Caller},{CALLED},2) exten => _XXXXXXXX,n,NoOp(============ This was a misscall ==============); exten =>connected,1,AGI(CallLogApi.php,{DID},{Caller},{CALLED},1)
exten => _XXXXXXXX,n,NoOp(============ This was a misscall ==============);
exten =>notconnected,1,AGI(CallLogApi.php,{DID},{Caller},${CALLED},0)
exten => _XXXXXXXX,n,NoOp(============ This was a misscall ==============);
;exten => _XXXXXXXX,n,Hangup

i have this dial plan but i am not able to grab the dialstatus for answer if the caller hangs up the call. i would appreciate if someone good guide how can i grap the ANSWER status

Please edit your dialplan snippet and apply Preformatted text tags.

Based on the narrative, you need to use an h extension.