Menu with ari4java

how can i write a menu in java with ari4java ?
i want get call from asterisk(how?) and answer this then hangout .