You can detecet when the call has ended by binding an event handler to the "conversationEnd.cwic" event. Here is an example:
$('#phone').bind('conversationEnd.cwic', function(evt, conversation) {
console.log('conversationEnd');
$('#answer').attr('disabled', true);
});