示例#1
0
        private static MyAVSession CreateOutgoingSession(MySipStack sipStack, CallSession session, MediaType mediaType)
        {
            lock (MyAVSession.sessions)
            {
                MyAVSession avSession = new MyAVSession(sipStack, session, mediaType, InviteState.INPROGRESS);
                MyAVSession.sessions.Add(avSession.Id, avSession);

                return(avSession);
            }
        }
示例#2
0
        public static MyAVSession TakeOutgoingTranferSession(MySipStack sipStack, CallSession session, twrap_media_type_t mediaType, SipMessage sipMessage)
        {
            MediaType media = MediaTypeUtils.ConvertFromNative(mediaType);

            if (media == MediaType.None)
            {
                return(null);
            }

            MyAVSession avSession = MyAVSession.CreateOutgoingSession(sipStack, session, media);

            if (sipMessage != null)
            {
                avSession.RemotePartyUri = sipMessage.getSipHeaderValue("refer-to");
            }
            return(avSession);
        }
示例#3
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");
        }
示例#4
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");
        }
示例#5
0
        public static MyAVSession TakeIncomingSession(MySipStack sipStack, CallSession session, twrap_media_type_t mediaType, SipMessage sipMessage)
        {
            MediaType media = MediaTypeUtils.ConvertFromNative(mediaType);

            if (media == MediaType.None)
            {
                return(null);
            }

            lock (MyAVSession.sessions)
            {
                MyAVSession avSession = new MyAVSession(sipStack, session, media, InviteState.INCOMING);
                if (sipMessage != null)
                {
                    avSession.RemotePartyUri = sipMessage.getSipHeaderValue("f");
                }
                MyAVSession.sessions.Add(avSession.Id, avSession);
                return(avSession);
            }
        }
示例#6
0
        private static MyAVSession CreateOutgoingSession(MySipStack sipStack, CallSession session, MediaType mediaType)
        {
            lock (MyAVSession.sessions)
            {
                MyAVSession avSession = new MyAVSession(sipStack, session, mediaType, InviteState.INPROGRESS);
                MyAVSession.sessions.Add(avSession.Id, avSession);

                return avSession;
            }
        }
示例#7
0
        public static MyAVSession TakeOutgoingTranferSession(MySipStack sipStack, CallSession session, twrap_media_type_t mediaType, SipMessage sipMessage)
        {
            MediaType media = MediaTypeUtils.ConvertFromNative(mediaType);
            if (media == MediaType.None)
            {
                return null;
            }

            MyAVSession avSession = MyAVSession.CreateOutgoingSession(sipStack, session, media);
            if (sipMessage != null)
            {
                avSession.RemotePartyUri = sipMessage.getSipHeaderValue("refer-to");
            }
            return avSession;
        }
示例#8
0
        public static MyAVSession TakeIncomingSession(MySipStack sipStack, CallSession session, twrap_media_type_t mediaType, SipMessage sipMessage)
        {
            MediaType media = MediaTypeUtils.ConvertFromNative(mediaType);
            if (media == MediaType.None)
            {
                return null;
            }

            lock (MyAVSession.sessions)
            {
                MyAVSession avSession = new MyAVSession(sipStack, session, media, InviteState.INCOMING);
                if (sipMessage != null)
                {
                    avSession.RemotePartyUri = sipMessage.getSipHeaderValue("f");
                }
                MyAVSession.sessions.Add(avSession.Id, avSession);
                return avSession;
            }
        }