[[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