How to know whether call is answered or rejected

Hi ,

I have a java program which initiates call to other mobile number using ami class library, my question is how can i know whether call is picked or rejected at recipient end?.

originate action returns always error/* for not picking up call*/ , or success /if call is picked, or rejected/

According to the documentation it says that the originate command sets the following channel variable before exiting: ${ORIGINATE_STATUS}: This indicates the result of the call origination.
Possible values:
FAILED
SUCCESS
BUSY
CONGESTION
HANGUP
RINGING

My suggestion could be also check the AMI events generated when the call is answered or rejected and check if there is any difference,