How can I get call status Dial plan

Hi i am new to asterisk and php agi

i am making call using below script

i am trying to get the call status on same page/scripts.
how do I get the call status from agi script, whether call is answered or busy after the call hes made.

Kindly help and give some suggestion.

Ajai :smile:

use the phpagi library. It has all handy functions and examples here is the link