Beispiel #1
0
 private Tapstream(string accountName, string developerSecret, string hardware)
 {
     del = new DelegateImpl(this);
     platform = new PlatformImpl();
     listener = new CoreListenerImpl();
     core = new Core(del, platform, listener, accountName, developerSecret, hardware);
 }
Beispiel #2
0
 public Tapstream(OperationQueue queue, string accountName, string developerSecret, string hardware)
 {
     del = new DelegateImpl();
     platform = new PlatformImpl();
     listener = new CoreListenerImpl(queue);
     core = new Core(del, platform, listener, accountName, developerSecret, hardware);
 }
Beispiel #3
0
        public MainPage()
        {
            InitializeComponent();

            welcome.Text = "Linphone Xamarin version: " + Core.Version;

            Listener = Factory.Instance.CreateCoreListener();
            Listener.OnRegistrationStateChanged        = OnRegistration;
            Listener.OnCallStateChanged                = OnCall;
            Listener.OnCallStatsUpdated                = OnStats;
            Listener.OnLogCollectionUploadStateChanged = OnLogCollectionUpload;
            Core.AddListener(Listener);

            Transports = new Dictionary <string, TransportType>
            {
                { "UDP", TransportType.Udp }, { "TCP", TransportType.Tcp }, { "TLS", TransportType.Tls },
            };
            foreach (string protocol in Transports.Keys)
            {
                transport.Items.Add(protocol);
            }
            transport.SelectedIndex = 2;

            if (Core.DefaultProxyConfig?.State == RegistrationState.Ok)
            {
                register.IsEnabled        = false;
                stack_registrar.IsVisible = false;
                registration_status.Text  = "Registration state: " + Core.DefaultProxyConfig.State;
            }
        }
Beispiel #4
0
 AeonixInfoRepository()
 {
     LinphoneCore            = LinphoneBase.Instance.linphoneCore;
     Listener                = LinphoneBase.Instance.coreListener;
     Listener.OnInfoReceived = OnInfoRecived;
     LinphoneCore.AddListener(Listener);
 }
Beispiel #5
0
 CallService()
 {
     LinphoneCore = LinphoneBase.Instance.linphoneCore;
     Listener     = LinphoneBase.Instance.coreListener;
     Listener.OnCallStateChanged = OnCall;
     LinphoneCore.AddListener(Listener);
 }
Beispiel #6
0
 private Tapstream(string accountName, string developerSecret, Config config)
 {
     del      = new DelegateImpl(this);
     platform = new PlatformImpl();
     listener = new CoreListenerImpl();
     core     = new Core(del, platform, listener, accountName, developerSecret, config);
     core.Start();
 }
Beispiel #7
0
 public Tapstream(OperationQueue queue, string accountName, string developerSecret, Config config)
 {
     del      = new DelegateImpl();
     platform = new PlatformImpl();
     listener = new CoreListenerImpl(queue);
     core     = new Core(del, platform, listener, accountName, developerSecret, config);
     core.Start();
 }
 RegistrationService()
 {
     LinphoneCore = LinphoneBase.Instance.linphoneCore;
     Listener     = LinphoneBase.Instance.coreListener;
     Listener.OnRegistrationStateChanged = OnRegistration;
     LinphoneCore.AddListener(Listener);
     logger();
 }
Beispiel #9
0
 private Tapstream(string accountName, string developerSecret, Config config)
 {
     del = new DelegateImpl(this);
     platform = new PlatformImpl();
     listener = new CoreListenerImpl();
     core = new Core(del, platform, listener, accountName, developerSecret, config);
     core.Start();
 }
Beispiel #10
0
        private LinphoneEngineAndroid()
        {
            Log("C# WRAPPER=" + LinphoneWrapper.VERSION);
            Log($"Linphone version {Core.Version}");
            CoreListener      = Factory.Instance.CreateCoreListener();
            LinphoneListeners = new List <ILinphoneListener>();
            RegisterState     = RegistrationState.None;


            // Giving app context in CreateCore is mandatory for Android to be able to load grammars (and other assets) from AAR
            linphoneCore = Factory.Instance.CreateCore(CoreListener, RcPath, FactoryPath, IntPtr.Zero, LinphoneAndroid.AndroidContext);
            // Required to be able to store logs as file
            Core.SetLogCollectionPath(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData));
            Core.EnableLogCollection(LogCollectionState.Enabled);
            UploadLogCommand();

            //LoggingService.Instance.LogLevel = LogLevel.Debug;
            //LoggingService.Instance.Listener.OnLogMessageWritten = OnLog;

            CoreListener.OnGlobalStateChanged = OnGlobal;
            CoreListener.OnLogCollectionUploadStateChanged = OnLogUpload;
            linphoneCore.NetworkReachable             = true;
            linphoneCore.RingDuringIncomingEarlyMedia = false;

            linphoneCore.VideoCaptureEnabled = false;
            linphoneCore.VideoDisplayEnabled = true;

            linphoneCore.Transports.TcpPort = -1;
            linphoneCore.Transports.TlsPort = 0;
            linphoneCore.Transports.UdpPort = 0;


            Log($"Transports, TCP: {linphoneCore.Transports.TcpPort}, TLS: {linphoneCore.Transports.TlsPort}, UDP: {linphoneCore.Transports.UdpPort}");
            Log($"used transports is {linphoneCore.TransportsUsed.ToString()}");


            LogCodecs();

            CoreListener.OnCallStateChanged         = OnCall;
            CoreListener.OnCallStatsUpdated         = OnStats;
            CoreListener.OnRegistrationStateChanged = OnRegistration;

            CoreListener.OnConfiguringStatus = OnConfigurationStatus;

            linphoneCore.EchoCancellationEnabled = true;


            //For MTS 4: beamforming_mic_dist_mm=74 beamforming_angle_deg=0 DON'T DELETE!
            //For MTS 7: beamforming_mic_dist_mm =184 beamforming_angle_deg=0 default value in linphonerc DON'T DELETE!

            // DON'T DELETE!
            // linphoneCore.BeamformingMicDist = 184f;
            // linphoneCore.BeamformingAngleDeg = 0;
            // linphoneCore.BeamformingEnabled = true;

            LinphoneCoreIterateAsync();
        }
 public Tapstream(OperationQueue queue, string accountName, string developerSecret, Config config)
 {
     del = new DelegateImpl();
     platform = new PlatformImpl();
     listener = new CoreListenerImpl(queue);
     this.config = config;
     core = new Core(del, platform, listener, null, accountName, developerSecret, config);
     core.Start();
 }
Beispiel #12
0
        public MainPage()
        {
            InitializeComponent();

            Listener = Factory.Instance.CreateCoreListener();
            Listener.OnRegistrationStateChanged = OnRegistration;
            Listener.OnCallStateChanged         = OnCall;
            Listener.OnCallStatsUpdated         = OnStats;
            LinphoneCore.AddListener(Listener);
        }
Beispiel #13
0
        public Core(Delegate del, Platform platform, CoreListener listener, String accountName, String developerSecret, String hardware)
        {
		    this.del = del;
		    this.platform = platform;
		    this.listener = listener;
		
		    this.accountName = Clean(accountName);
		    MakePostArgs(developerSecret, hardware);
		
		    firedEvents = platform.LoadFiredEvents();
	    }
Beispiel #14
0
        private void chatListenerInit()
        {
            CoreListener listener = LinphoneManager.Instance.getCoreListener();

            if (listener == null)
            {
                return;
            }
            listener.OnMessageReceived     = this.MessageReceived;
            listener.OnIsComposingReceived = this.ComposeReceived;
        }
Beispiel #15
0
        public Core(Delegate del, Platform platform, CoreListener listener, String accountName, String developerSecret, Config config)
        {
            this.del      = del;
            this.platform = platform;
            this.listener = listener;
            this.config   = config;

            this.accountName = Clean(accountName);
            MakePostArgs(developerSecret);

            firedEvents = platform.LoadFiredEvents();
        }
Beispiel #16
0
        private void ParseRecieved(MemoryStream stream)
        {
            if (stream == null || stream.Length <= 0)
            {
                return;
            }

            var json = Encoding.UTF8.GetString(stream.ToArray());

            if (string.IsNullOrEmpty(json))
            {
                return;
            }

            IRecieved recieved;

            try
            {
                recieved = JsonConvert.DeserializeObject <IRecieved>(json);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);

                return;
            }

            if (recieved is JsonRpcParamsResponse)
            {
                var response = (JsonRpcParamsResponse)recieved;

                if (response == null || response.Id == null)
                {
                    return;
                }

                var id = (int)response.Id;
                if (this._responseDictionary.ContainsKey(id))
                {
                    var resSet = this._responseDictionary[id];
                    resSet.CompleteTask(response);

                    this._responseDictionary.TryRemove(id, out ResponseSet tmp);
                }
            }

            if (recieved is IEventArgs)
            {
                //Debug.WriteLine($"Event Recieved: {json}");
                CoreListener.FireEvent((IEventArgs)recieved);
            }
        }
Beispiel #17
0
        public App(string rc_path = null)
        {
            LinphoneWrapper.setNativeLogHandler();
            LinphoneCore = LinphoneBase.Instance.linphoneCore;
            coreListener = LinphoneBase.Instance.coreListener;
            var page = new NavigationPage(new components.Login());

            page.BarBackgroundColor = Color.Brown;
            page.BarTextColor       = Color.White;
            MainPage = page;
            //MainPage = new components.navBar();
        }
Beispiel #18
0
        public App(string rc_path = null)
        {
            LinphoneWrapper.setNativeLogHandler();

            Core.SetLogLevelMask(0xFF);
            CoreListener listener = Factory.Instance.CreateCoreListener();

            listener.OnGlobalStateChanged = OnGlobal;
            LinphoneCore = Factory.Instance.CreateCore(listener, rc_path, null);
            LinphoneCore.NetworkReachable = true;
            MainPage = new MainPage();
        }
Beispiel #19
0
        private Tapstream(string accountName, string developerSecret, Config config)
        {
            del      = new DelegateImpl(this);
            platform = new PlatformImpl();
            listener = new CoreListenerImpl();
#if TEST_WINPHONE || WINDOWS_PHONE
            appEventSource = new AppEventSourceImpl();
#else
            appEventSource = null;
#endif
            core = new Core(del, platform, listener, appEventSource, accountName, developerSecret, config);
            core.Start();
        }
 private Tapstream(string accountName, string developerSecret, Config config)
 {
     del = new DelegateImpl(this);
     platform = new PlatformImpl();
     listener = new CoreListenerImpl();
     #if TEST_WINPHONE || WINDOWS_PHONE
     appEventSource = new AppEventSourceImpl();
     #else
     appEventSource = null;
     #endif
     core = new Core(del, platform, listener, appEventSource, accountName, developerSecret, config);
     core.Start();
 }
Beispiel #21
0
		public Core(Delegate del, Platform platform, CoreListener listener, AppEventSource appEventSource, String accountName, String developerSecret, Config config)
		{
			this.del = del;
			this.platform = platform;
			this.listener = listener;
            this.appEventSource = appEventSource;
			this.config = config;
		
			this.accountName = Clean(accountName);
            this.secret = developerSecret;
			MakePostArgs();
		
			firedEvents = platform.LoadFiredEvents();
		}
Beispiel #22
0
        public void Init(string configPath, string factoryPath)
        {
            CoreListener listener = Factory.Instance.CreateCoreListener();

            listener.OnGlobalStateChanged = OnGlobal;
#if ANDROID
            // Giving app context in CreateCore is mandatory for Android to be able to load grammars (and other assets) from AAR
            Core = Factory.Instance.CreateCore(listener, configPath, factoryPath, IntPtr.Zero, LinphoneAndroid.AndroidContext);
            // Required to be able to store logs as file
            Core.SetLogCollectionPath(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
#else
            Core = Factory.Instance.CreateCore(listener, configPath, factoryPath);
#endif
            Core.NetworkReachable = true;
        }
Beispiel #23
0
        public LinphoneBase()
        {
            Console.WriteLine("omer50: initialize");
            Core.SetLogLevelMask(0xFF);
            CoreListener listener = Factory.Instance.CreateCoreListener();

            listener.OnGlobalStateChanged = OnGlobal;
            linphoneCore = Factory.Instance.CreateCore(listener, null, null);
            coreListener = Factory.Instance.CreateCoreListener();
            linphoneCore.VerifyServerCertificates(false);
            linphoneCore.VerifyServerCn(false);
            linphoneCore.NetworkReachable = true;

            //if (App.Current != null)
            //    iterate = new Thread(startForgroundLinphoneIteration);
            //else
            //    iterate = new Thread(startBackgroundLinphoneIteration);

            //iterate.IsBackground = false;
            //iterate.Start();
            //Thread iterate = new Thread(LinphoneCoreIterate);
        }
Beispiel #24
0
        /// <summary>
        /// Instanciate a <see cref="Core" /> object.
        /// </summary>
        public Core CreateCore(CoreListener cbs, string configPath, string factoryConfigPath, IntPtr userData, IntPtr systemContext)
        {
            IntPtr ptr = linphone_factory_create_core_2(nativePtr, cbs != null ? cbs.nativePtr : IntPtr.Zero, configPath, factoryConfigPath, userData, systemContext);

            return(fromNativePtr <Core>(ptr, false));
        }
Beispiel #25
0
        /// <summary>
        /// Instantiates a <see cref="Core" /> object with a given LpConfig.
        /// </summary>
        public Core CreateCoreWithConfig(CoreListener cbs, Config config)
        {
            IntPtr ptr = linphone_factory_create_core_with_config(nativePtr, cbs != null ? cbs.nativePtr : IntPtr.Zero, config != null ? config.nativePtr : IntPtr.Zero);

            return(fromNativePtr <Core>(ptr, false));
        }
Beispiel #26
0
        /// <summary>
        /// Instantiates a <see cref="Core" /> object with a given LpConfig.
        /// </summary>
        public Core CreateCoreWithConfig(CoreListener cbs, Config config, IntPtr userData, IntPtr systemContext)
        {
            IntPtr ptr = linphone_factory_create_core_with_config_2(nativePtr, cbs != null ? cbs.nativePtr : IntPtr.Zero, config != null ? config.nativePtr : IntPtr.Zero, userData, systemContext);

            return(fromNativePtr <Core>(ptr, false));
        }