BogheCore.Sip.MyAVSession.GetSession C# (CSharp) Method

GetSession() public static method

public static GetSession ( long id ) : MyAVSession
id long
return MyAVSession
        public static MyAVSession GetSession(long id)
        {
            lock(MyAVSession.sessions)
            {
                if (MyAVSession.sessions.ContainsKey(id))
                    return MyAVSession.sessions[id];
                else
                    return null;
            }
        }

Usage Example

Example #1
0
        public static bool HandleMediaUpdate(long id, twrap_media_type_t newMediaType)
        {
            MyAVSession avSession = MyAVSession.GetSession(id);

            if (avSession != null)
            {
                if ((newMediaType & twrap_media_type_t.twrap_media_msrp) == twrap_media_type_t.twrap_media_msrp)
                {
                    return(false); // For now MSRP update is not suportted
                }
                avSession.mMediaType = MediaTypeUtils.ConvertFromNative(newMediaType);
                return(true);
            }

            return(false);
        }