]> sjero.net Git - linphone/blobdiff - coreapi/linphonecall.c
implements reporting of declined calls
[linphone] / coreapi / linphonecall.c
index 2cd8236f79f656833be0d5e5a8239d28178b4c1b..ee2910e35a9d5e349d5df328835c0f8aeadfadb1 100644 (file)
@@ -216,7 +216,10 @@ static void linphone_call_set_terminated(LinphoneCall *call){
        
        linphone_core_update_allocated_audio_bandwidth(lc);
        if (call->state==LinphoneCallEnd){
-               status=LinphoneCallSuccess;
+               if (call->reason==LinphoneReasonDeclined){
+                       status=LinphoneCallDeclined;
+               }
+               else status=LinphoneCallSuccess;
                
        }
        linphone_call_log_completed(call->log,call, status);
@@ -384,6 +387,13 @@ LinphoneCallState linphone_call_get_state(const LinphoneCall *call){
        return call->state;
 }
 
+/**
+ * Returns the reason for a call termination (either error or normal termination)
+**/
+LinphoneReason linphone_call_get_reason(const LinphoneCall *call){
+       return call->reason;
+}
+
 /**
  * Get the user_pointer in the LinphoneCall
  *