예제 #1
0
        public void OnHook(List <CallRecord> myCallHistoryRecords)
        {
            try
            {
                CallRecord tmpCallRecord;
                switch (_CallDirection)
                {
                case CALL_DIRECTION.CallDirectionIn:
                    if (_CallDuration > 0)
                    {
                        tmpCallRecord = new CallRecord(DateTime.Now, CallStatus.CallReceived, _LastDialedNumber, _CallDuration);
                    }
                    else
                    {
                        tmpCallRecord = new CallRecord(DateTime.Now, CallStatus.CallMissed, _LastDialedNumber, _CallDuration);
                    }
                    myCallHistoryRecords.Add(tmpCallRecord);
                    break;

                case CALL_DIRECTION.CallDirectionOut:
                    tmpCallRecord = new CallRecord(DateTime.Now, CallStatus.CallDialed, _LastDialedNumber, _CallDuration);
                    myCallHistoryRecords.Add(tmpCallRecord);
                    break;
                }
            }
            catch (Exception)
            {
                //throw;
            }



            _CallActive           = false;
            _CallConferenceActive = false;
            _CallDirection        = CALL_DIRECTION.CallDirectionNone;
            _CallHoldActive       = false;
            _CallRecordingActive  = false;
            _CallTransferActive   = false;
            _State        = TELEPHONY_RETURN_VALUE.SipOnHook;
            _CallDuration = 0;
        }
예제 #2
0
        public void OnHook(List<CallRecord> myCallHistoryRecords)
        {

            try
            {
                CallRecord tmpCallRecord ;
                switch (_CallDirection)
                {
                    case CALL_DIRECTION.CallDirectionIn:
                        if (_CallDuration > 0)
                        {
                          tmpCallRecord = new CallRecord(DateTime.Now, CallStatus.CallReceived, _LastDialedNumber, _CallDuration);
                        }
                        else
                        {
                            tmpCallRecord = new CallRecord(DateTime.Now, CallStatus.CallMissed, _LastDialedNumber, _CallDuration);
                        }
                        myCallHistoryRecords.Add(tmpCallRecord);
                        break;
                    case CALL_DIRECTION.CallDirectionOut:
                        tmpCallRecord = new CallRecord(DateTime.Now, CallStatus.CallDialed, _LastDialedNumber, _CallDuration);
                        myCallHistoryRecords.Add(tmpCallRecord);
                        break;
                }
                
            }
            catch (Exception)
            {

                //throw;
            }



            _CallActive = false;
            _CallConferenceActive = false;
            _CallDirection = CALL_DIRECTION.CallDirectionNone;
            _CallHoldActive = false;
            _CallRecordingActive = false;
            _CallTransferActive = false;
            _State = TELEPHONY_RETURN_VALUE.SipOnHook;
            _CallDuration = 0;
        }