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); }
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); }
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); } }