Beispiel #1
0
        public bool Initialize(string uafile, SupernovaSetting spnvSetting)
        {
            SipuaExecPath = uafile;

            if (!KillProcesses(SipuaExecPath))
            {
                return(false);
            }

            HandsetLeft = new Handset(0, SipuaExecPath, LeftGpio,
                                      spnvSetting.RecordingFileDir)
            {
                CaptureDevice = LeftCaptureDevice, PlaybakDevice = LeftPlaybackDevice
            };
            if (HandsetLeft.IsEnabled)
            {
                HandsetLeft.Run();
            }

            HandsetRight = new Handset(1, SipuaExecPath, RightGpio,
                                       spnvSetting.RecordingFileDir)
            {
                CaptureDevice = RightCaptureDevice, PlaybakDevice = RightPlaybackDevice
            };
            if (HandsetRight.IsEnabled)
            {
                HandsetRight.Run();
            }

            InitGpioDetectThread();

            IsInitialized = true;
            return(true);
        }
Beispiel #2
0
        public bool MakeCall(int accoutId, string dest, ref int callId, bool nogroupcall = false)
        {
            Log.Debug("Protocal Stack Log: (SpnvChannels)MakeCall, Start");

            if (App.HandsetMgr != null)
            {
                Handset.Handset handset = App.HandsetMgr.GetPreparedHandset();
                if (handset != null && !handset.IsBusy)
                {
                    Log.Debug(String.Format("Protocal Stack Log: (SpnvChannels)MakeCall, Switch To Handset, dest:{0}, End", dest));
                    return(handset.MakeCall(dest));
                }
            }

            if (GetIdleChannel() == null)
            {
                Log.Debug("Protocal Stack Log: (SpnvChannels)MakeCall, NoIdleChannel, False End");
                return(false);
            }

            if (nogroupcall && GetGroupCallChannel() != null)
            {
                Log.Debug("Protocal Stack Log: (SpnvChannels)MakeCall, nogroupcall && GetGroupCallChannel() != null, False End");
                return(false);
            }

            HoldActiveCall();

            callId = App.SIPUA.MakeCall(accoutId, dest, 0);

            //Log.Debug(string.Format("Protocal Stack Log: App.SIPUA.MakeCall:{0},{1},{2},{3}", accoutId, dest, 0, callId));

            Log.Debug(string.Format("Protocal Stack Log: (SpnvChannels)MakeCall, MakeCall:{0},{1},{2}", accoutId, dest, 0));

            Log.Debug("Protocal Stack Log: (SpnvChannels)MakeCall, End");
            return(true);
        }
Beispiel #3
0
 public HandsetInfo(Handset.Handset handset, string name)
 {
     Id       = handset.Id;
     IsOnLine = handset.IsOnLine;
     Name     = name;
 }