Пример #1
0
        public MyAVSession(MySipStack sipStack, CallSession session, MediaType mediaType, InviteState callState)
            : base(sipStack)
        {
            this.session = (session == null) ? new CallSession(sipStack) : session;
            base.mediaType = mediaType;
            this.state = callState;

            // commons
            base.init();

            // SigComp
            base.SigCompId = sipStack.SigCompId;

            // 100rel
            this.session.set100rel(true); // will add "Supported: 100rel"

            /* 3GPP TS 24.173
            *
            * 5.1 IMS communication service identifier
            * URN used to define the ICSI for the IMS Multimedia Telephony Communication Service: urn:urn-7:3gpp-service.ims.icsi.mmtel.
            * The URN is registered at http://www.3gpp.com/Uniform-Resource-Name-URN-list.html.
            * Summary of the URN: This URN indicates that the device supports the IMS Multimedia Telephony Communication Service.
            *
            * Contact: <sip:[email protected];gr=urn:uuid:xxx;comp=sigcomp>;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
            * Accept-Contact: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
            * P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel
            */
            this.session.addCaps("+g.3gpp.icsi-ref", "\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"");
            this.session.addHeader("Accept-Contact", "*;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"");
            this.session.addHeader("P-Preferred-Service", "urn:urn-7:3gpp-service.ims.icsi.mmtel");
        }
Пример #2
0
        internal override void Load(JToken Json)
        {
            base.Load(Json);

            string Message;

            if (JsonHelper.GetJsonString(Json, "message", out Message))
            {
                this.Message = Message ?? string.Empty;
            }
            else
            {
                this.Message = string.Empty;
            }

            string Judge;

            if (JsonHelper.GetJsonString(Json, "judge", out Judge))
            {
                this.Judge = Judge ?? string.Empty;
            }
            else
            {
                this.Judge = string.Empty;
            }

            int State;

            if (JsonHelper.GetJsonNumber(Json, "state", out State))
            {
                this.State = (InviteState)State;
            }
        }
Пример #3
0
 internal virtual Invite ChangeState(InviteState newState)
 {
     state        = newState;
     Status       = newState.Status;
     ModifiedDate = newState.ModifiedDate;
     return(this);
 }
Пример #4
0
        private string getSessionState(InviteState state, int code = 0)
        {
            switch (state)
            {
            case InviteState.INCOMING:
                return("来话");

            case InviteState.INPROGRESS:
                return("呼叫进展中");

            case InviteState.INCALL:
                return("通话中");

            case InviteState.REMOTE_RINGING:
                return("振铃中");

            case InviteState.LOCAL_HELD:
                return("本端保持");

            case InviteState.REMOTE_HELD:
                return("远端保持");

            case InviteState.TERMINATED:
            {
                switch (code)
                {
                case 403:
                    return("不允许呼叫");

                case 404:
                    return("用户不存在");

                case 406:
                    return("来话不可接听");

                case 415:
                    return("媒体不支持");

                case 480:
                    return("用户不可达");

                case 486:
                    return("用户忙");

                case 503:
                    return("服务不可用");

                default:
                    return("通话已结束");
                }
            }

            default:
                return("通话已结束");
            }
        }
Пример #5
0
        protected MyAVSession(MySipStack sipStack, CallSession session, MediaType mediaType, InviteState callState)
            : base(sipStack)
        {
            mSession = (session == null) ?
            #if WINDOWS_PHONE
            org.doubango.WindowsPhone.BackgroundProcessController.Instance.rtCallSessionNew(sipStack.WrappedStack)
            #else
            new CallSession(sipStack.WrappedStack)
            #endif
                : session;
            base.mMediaType = mediaType;
            this.mState = callState;
            mMute = false;

            // commons
            base.init();

            // SigComp
            base.SigCompId = sipStack.SigCompId;

            // 100rel
            // mSession.set100rel(true); // See defaults

            // T.140 callback
            if ((mediaType & MediaType.T140) == MediaType.T140)
            {
                mT140Callback = new MyT140Callback(this);
                // do not set the callback as it requires a media session manager (only available when session is connected)
            }

            /* 3GPP TS 24.173
            *
            * 5.1 IMS communication service identifier
            * URN used to define the ICSI for the IMS Multimedia Telephony Communication Service: urn:urn-7:3gpp-service.ims.icsi.mmtel.
            * The URN is registered at http://www.3gpp.com/Uniform-Resource-Name-URN-list.html.
            * Summary of the URN: This URN indicates that the device supports the IMS Multimedia Telephony Communication Service.
            *
            * Contact: <sip:[email protected];gr=urn:uuid:xxx;comp=sigcomp>;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
            * Accept-Contact: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
            * P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel
            */
            mSession.addCaps("+g.3gpp.icsi-ref", "\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"");
            mSession.addHeader("Accept-Contact", "*;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"");
            mSession.addHeader("P-Preferred-Service", "urn:urn-7:3gpp-service.ims.icsi.mmtel");
        }
        public void SetState(InviteState state)
        {
            m_inviteState = state;
            switch (m_inviteState)
            {
            case InviteState.Empty:
                m_standardStuffParent.SetActive(true);
                m_leaveStuffParent.SetActive(false);
                m_inviteButton.get_gameObject().SetActive(false);
                m_cancelInviteButton.get_gameObject().SetActive(false);
                m_name.get_gameObject().SetActive(false);
                break;

            case InviteState.Leaving:
                m_standardStuffParent.SetActive(false);
                m_leaveStuffParent.SetActive(true);
                break;

            case InviteState.Normal:
                m_standardStuffParent.SetActive(true);
                m_leaveStuffParent.SetActive(false);
                m_inviteButton.set_interactable(true);
                m_inviteButton.get_gameObject().SetActive(true);
                m_cancelInviteButton.get_gameObject().SetActive(false);
                break;

            case InviteState.Invited_By_Me:
                m_standardStuffParent.SetActive(true);
                m_leaveStuffParent.SetActive(false);
                m_inviteButton.get_gameObject().SetActive(false);
                m_cancelInviteButton.get_gameObject().SetActive(true);
                break;

            case InviteState.Invite_Me:
                m_standardStuffParent.SetActive(true);
                m_leaveStuffParent.SetActive(false);
                m_inviteButton.set_interactable(false);
                m_inviteButton.get_gameObject().SetActive(true);
                m_cancelInviteButton.get_gameObject().SetActive(false);
                break;
            }
        }
Пример #7
0
        private void AddInviteStateList(ulong uid, uint time, enInviteState state)
        {
            for (int i = 0; i < this.m_stateList.Count; i++)
            {
                if (uid == this.m_stateList[i].uid)
                {
                    this.m_stateList[i].uid   = uid;
                    this.m_stateList[i].time  = time;
                    this.m_stateList[i].state = state;
                    return;
                }
            }
            InviteState item = new InviteState {
                uid   = uid,
                time  = time,
                state = state
            };

            this.m_stateList.Add(item);
        }
Пример #8
0
 public MyInviteSession(string remoteParty, MediaType mediaType) : base(remoteParty, mediaType)
 {
     this.mState = InviteState.NONE;
 }
Пример #9
0
        public MyAVSession(MySipStack sipStack, CallSession session, MediaType mediaType, InviteState callState)
            : base(sipStack)
        {
            this.session   = (session == null) ? new CallSession(sipStack) : session;
            base.mediaType = mediaType;
            this.state     = callState;

            // commons
            base.init();

            // SigComp
            base.SigCompId = sipStack.SigCompId;

            // 100rel
            this.session.set100rel(true); // will add "Supported: 100rel"

            /* 3GPP TS 24.173
             *
             * 5.1 IMS communication service identifier
             * URN used to define the ICSI for the IMS Multimedia Telephony Communication Service: urn:urn-7:3gpp-service.ims.icsi.mmtel.
             * The URN is registered at http://www.3gpp.com/Uniform-Resource-Name-URN-list.html.
             * Summary of the URN: This URN indicates that the device supports the IMS Multimedia Telephony Communication Service.
             *
             * Contact: <sip:[email protected];gr=urn:uuid:xxx;comp=sigcomp>;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
             * Accept-Contact: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
             * P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel
             */
            this.session.addCaps("+g.3gpp.icsi-ref", "\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"");
            this.session.addHeader("Accept-Contact", "*;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"");
            this.session.addHeader("P-Preferred-Service", "urn:urn-7:3gpp-service.ims.icsi.mmtel");
        }
Пример #10
0
 public TrunkAVSession(MySipStack sipStack, CallSession session, MediaType mediaType, InviteState callState) : base(sipStack, session, mediaType, callState)
 {
     this.iWallDstObjId = -1;
 }
Пример #11
0
 protected MyInviteSession(MySipStack sipStack) : base(sipStack)
 {
     this.mState = InviteState.NONE;
 }
Пример #12
0
 public MyAVSession(MySipStack sipStack, CallSession session, MediaType mediaType, InviteState callState, TrunkCallParam callParam) : base(sipStack)
 {
     this.mSession   = ((session == null) ? new CallSession(sipStack.WrappedStack) : session);
     this.mMediaType = mediaType;
     this.mState     = callState;
     this.mMute      = false;
     base.init();
     base.SigCompId = sipStack.SigCompId;
     if (callParam != null)
     {
         this.strCallType      = callParam.strCallType;
         this.strPrioAttribute = callParam.strPrioAttribute;
         this.stre2ee          = callParam.stre2ee;
         this.strduplex        = callParam.strduplex;
         this.strfoaoroacsu    = callParam.strfoaoroacsu;
         this.strpriority      = callParam.strpriority;
         this.strcallerUDN     = callParam.strcallerUDN;
         this.strOnlineCallID  = callParam.strOnlineCallID;
         this.strCalledType    = callParam.strCalledType;
     }
 }
Пример #13
0
 public MyAVSession(string remoteParty, MediaType mediaType, InviteState callState) : base(remoteParty, mediaType)
 {
     this.mMediaType = mediaType;
     this.mState     = callState;
 }
Пример #14
0
 public void Mark(InviteState state)
 {
     this.State = state;
 }
Пример #15
0
 public MyAVSession(MySipStack sipStack, CallSession session, MediaType mediaType, InviteState callState) : base(sipStack)
 {
     this.mSession   = ((session == null) ? new CallSession(sipStack.WrappedStack) : session);
     this.mMediaType = mediaType;
     this.mState     = callState;
     this.mMute      = false;
     base.init();
     base.SigCompId = sipStack.SigCompId;
 }
Пример #16
0
        protected MyAVSession(MySipStack sipStack, CallSession session, MediaType mediaType, InviteState callState)
            : base(sipStack)
        {
            mSession = (session == null) ?
#if WINDOWS_PHONE
                       org.doubango.WindowsPhone.BackgroundProcessController.Instance.rtCallSessionNew(sipStack.WrappedStack)
#else
                       new CallSession(sipStack.WrappedStack)
#endif
                : session;
            base.mMediaType = mediaType;
            this.mState     = callState;
            mMute           = false;

            // commons
            base.init();

            // SigComp
            base.SigCompId = sipStack.SigCompId;

            // 100rel
            // mSession.set100rel(true); // See defaults

            // T.140 callback
            if ((mediaType & MediaType.T140) == MediaType.T140)
            {
                mT140Callback = new MyT140Callback(this);
                // do not set the callback as it requires a media session manager (only available when session is connected)
            }

            /* 3GPP TS 24.173
             *
             * 5.1 IMS communication service identifier
             * URN used to define the ICSI for the IMS Multimedia Telephony Communication Service: urn:urn-7:3gpp-service.ims.icsi.mmtel.
             * The URN is registered at http://www.3gpp.com/Uniform-Resource-Name-URN-list.html.
             * Summary of the URN: This URN indicates that the device supports the IMS Multimedia Telephony Communication Service.
             *
             * Contact: <sip:[email protected];gr=urn:uuid:xxx;comp=sigcomp>;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
             * Accept-Contact: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
             * P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel
             */
            mSession.addCaps("+g.3gpp.icsi-ref", "\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"");
            mSession.addHeader("Accept-Contact", "*;+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"");
            mSession.addHeader("P-Preferred-Service", "urn:urn-7:3gpp-service.ims.icsi.mmtel");
        }
Пример #17
0
 internal virtual InviteState GetState()
 {
     state ??= InviteState.NewState(this);
     return(state);
 }
Пример #18
0
 protected MyInviteSession(MySipStack sipStack)
     : base(sipStack)
 {
     this.state = InviteState.NONE;
 }
Пример #19
0
 public TrunkVideoDispSession(string remoteParty, string VideoId, MediaType mediaType, InviteState callState) : base(remoteParty, mediaType, callState)
 {
     this.callType    = TrunkCallType.TCT_DUMMY_VIDEO_DISPATCH;
     this.strVideoId  = VideoId;
     this.strDstObjId = remoteParty;
     this.strFormat   = base.MediaType.ToString();
 }
Пример #20
0
 public TrunkVideoDispSession(MySipStack sipStack, CallSession session, MediaType mediaType, InviteState callState) : base(sipStack, session, mediaType, callState)
 {
     this.callType = TrunkCallType.TCT_DUMMY_VIDEO_DISPATCH;
 }