Beispiel #1
0
        private void HandleHandsetMsg(object sender, HandsetMsgArgs args)
        {
            HandsetNotifyMsg notify = args.Message as HandsetNotifyMsg;

            if (notify == null)
            {
                return;
            }

            switch (notify.MsgNotifyCode)
            {
            case HANDSETMSG_NOTIFY_CODE.MSG_NOTIFY_CALLSTATE:
                HandsetNotifyCallStateMsg statemsg = notify as HandsetNotifyCallStateMsg;
                HandleCallStateMsg(statemsg);
                break;

            case HANDSETMSG_NOTIFY_CODE.MSG_NOTIFY_INFO:
                HandsetNotifyInfoMsg info = notify as HandsetNotifyInfoMsg;
                if (info != null)
                {
                    OnHandsetAddrInfoUpdated(info);
                }
                break;

            case HANDSETMSG_NOTIFY_CODE.MSG_NOTIFY_ONLINE:
                RunSIPUA(CaptureDevice, PlaybakDevice);
                break;
            }
        }
Beispiel #2
0
        private void HandleCallStateMsg(HandsetNotifyCallStateMsg msg)
        {
            if (msg == null)
            {
                return;
            }

            RemoteUri = msg.remoteUri;
            CallState = (sua_inv_state)msg.state;
            CallRole  = (sua_role_e)msg.role;
            IsBusy    = (CallState != sua_inv_state.PJSIP_INV_STATE_DISCONNECTED);

            if (OnCallStateChanged == null)
            {
                return;
            }

            HandsetCallStateArgs arg = new HandsetCallStateArgs(msg.remoteUri,
                                                                (sua_role_e)msg.role, (sua_inv_state)msg.state);

            OnCallStateChanged(this, arg);
        }