If you use the Dial application then it will set DIALSTATUS. You can use the AGI command to retrieve a dialplan variable to get it.
That’s pretty much it. If you’d like more you’d need to describe in further detail exactly what you are trying to achieve and show the complete details.