Esempio n. 1
0
        public static MyAVSession TakeIncomingSession(MySipStack sipStack, CallSession session, twrap_media_type_t mediaType, SipMessage sipMessage)
        {
            MediaType media;

            lock (MyAVSession.sessions)
            {
                switch (mediaType)
                {
                case twrap_media_type_t.twrap_media_audio:
                    media = MediaType.Audio;
                    break;

                case twrap_media_type_t.twrap_media_video:
                    media = MediaType.Video;
                    break;

                case twrap_media_type_t.twrap_media_audiovideo:
                    media = MediaType.AudioVideo;
                    break;

                default:
                    return(null);
                }
                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);
            }
        }
Esempio n. 2
0
        async Task SetSession(CallSession session)
        {
            await _distributedCache.SetStringAsync(CallParticipantsKey,
                                                   JsonConvert.SerializeObject(session));

            await Clients.Group(CallSessionGroup).ParticipantsChanged(session.Participants.Keys.ToArray());
        }
Esempio n. 3
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");
        }
Esempio n. 4
0
        public IActionResult Put(CallSession callsession)
        {
            var currentUser = GetCurrentUserProfile();

            callsession.UserProfileId = currentUser.Id;
            _callSessionRepo.Update(callsession);
            return(NoContent());
        }
Esempio n. 5
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;
 }
Esempio n. 6
0
        public IActionResult CallSession(CallSession callsession)
        {
            var currentUser = GetCurrentUserProfile();

            callsession.UserProfileId = currentUser.Id;

            _callSessionRepo.Add(callsession);
            return(CreatedAtAction("Get", new { id = callsession.Id }, callsession));
        }
Esempio n. 7
0
        private static void TestSession(CallSession session)
        {
            session.Answer();

            while (session.IsActive)
            {
                session.Speak("Hello World!");
                session.Hangup();
            }
        }
Esempio n. 8
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;
     }
 }
Esempio n. 9
0
 public void Update(CallSession callsession)
 {
     _context.Entry(callsession).State = EntityState.Modified;
     _context.SaveChanges();
 }
Esempio n. 10
0
 public void Add(CallSession callsession)
 {
     _context.Add(callsession);
     _context.SaveChanges();
 }
Esempio n. 11
0
 public TrunkVideoDispSession(MySipStack sipStack, CallSession session, MediaType mediaType, InviteState callState) : base(sipStack, session, mediaType, callState)
 {
     this.callType = TrunkCallType.TCT_DUMMY_VIDEO_DISPATCH;
 }
 public RabbitMQServiceConnection(CallSession callSession)
 {
     _callSession           = callSession;
     _callSession.Received += CallSessionReceived;
 }
Esempio n. 13
0
 public TrunkAVSession(MySipStack sipStack, CallSession session, MediaType mediaType, InviteState callState) : base(sipStack, session, mediaType, callState)
 {
     this.iWallDstObjId = -1;
 }
 public RabbitMQServiceConnection(CallSession callSession)
 {
     _callSession = callSession;
     _callSession.ReceivedAsync += (_, e) => OnReceivedAsync(new EventArgsT <ReadOnlyMemory <byte> >(e.Value));
 }