Esempio n. 1
0
        private void OnCallState(int accId, int callId, int state)
        {
            if (CallStateInfo != null)
            {
                sua_call_info info = new sua_call_info();
                PJSIPInterop.sua_call_get_info(callId, ref info);

                CallStateInfo(this, new CallStateArgs(accId, callId, (sua_inv_state)state,
                                                      info.remote_uri, (sua_role_e)info.call_role, info.last_status));
            }
        }
Esempio n. 2
0
        private int GetCallVideoWinId(int callId)
        {
            sua_call_info info = new sua_call_info();

            PJSIPInterop.sua_call_get_info(callId, ref info);

            for (int i = 0; i < info.media_count; i++)
            {
                if (((pjmedia_type)info.media[i].media_type) == pjmedia_type.PJMEDIA_TYPE_VIDEO)
                {
                    return(info.media[i].win_in);
                }
            }
            return(-1);
        }
Esempio n. 3
0
        public bool StartRecording(string dir)
        {
            if (!IsChannelBusy || RecorderId != -1)
            {
                return(false);
            }

            sua_call_info info = new sua_call_info();

            App.SIPUA.GetCallInfo(CallId, ref info);

            SIPUri remteUri = new SIPUri(info.remote_uri);
            SIPUri localUri = new SIPUri(info.local_uri);

            string caller, callee;

            if ((sua_role_e)info.call_role == sua_role_e.SUA_ROLE_UAS)
            {
                caller = remteUri.User;
                callee = localUri.User;
            }
            else
            {
                callee = remteUri.User;
                caller = localUri.User;
            }

            string filename = RecordingFiles.BuildRecordingFileName(dir, DateTime.Now, caller, callee);

            int recordId = -1;

            if (App.SIPUA.StartRecording(CallId, filename, ref recordId))
            {
                RecorderId = recordId;
                return(true);
            }

            return(false);
        }
Esempio n. 4
0
        public bool GetCallInfo(int callId, ref sua_call_info info)
        {
            int status = PJSIPInterop.sua_call_get_info(callId, ref info);

            return(status == PJSIPInterop.OK);
        }