/// <summary>
        /// Creates a phone line and adds it to the collection.
        /// </summary>
        public IPhoneLine AddPhoneLine(SIPAccount account, Ozeki.Network.TransportType transportType, NatConfiguration natConfig, SRTPMode srtpMode)
        {
            var config = new PhoneLineConfiguration(account);

            config.TransportType = transportType;
            config.NatConfig     = natConfig;
            config.SRTPMode      = srtpMode;
            return(AddPhoneLine(config));
        }
        /// <summary>
        /// Creates a phone line and adds it to the collection.
        /// </summary>
        public IPhoneLine AddPhoneLine(PhoneLineConfiguration config)
        {
            IPhoneLine line = softPhone.CreatePhoneLine(config);

            SubscribeToLineEvents(line);

            // add to collection
            PhoneLines.Add(line);

            return(line);
        }
Exemple #3
0
 static void RegisterAccount(SIPAccount account)
 {
     try
     {
         var phoneLineConfig = new PhoneLineConfiguration(account);
         phoneLineConfig.TransportType = TransportType.Tls;
         phoneLine = softphone.CreatePhoneLine(phoneLineConfig);
         phoneLine.RegistrationStateChanged += line_RegStateChanged;
         softphone.RegisterPhoneLine(phoneLine);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error during SIP registration: " + ex.ToString());
     }
 }
Exemple #4
0
        private void InitalizeSoftPhone()
        {
            try
            {
                SoftPhone             = SoftPhoneFactory.CreateSoftPhone(SoftPhoneFactory.GetLocalIP(), 5000, 10000);
                InvokeGUIThread(mymsg = "SoftPhoneCreated!");

                SoftPhone.IncomingCall += new EventHandler <VoIPEventArgs <IPhoneCall> >(SoftPhone_inComingCall);

                var        registrationRequired = true;
                var        userName             = "******";
                var        displayName          = "858";
                var        authenticationId     = "858";
                var        registerPassword     = "******";
                var        domainHost           = SoftPhoneFactory.GetLocalIP().ToString();
                var        domainPort           = 5060;
                SIPAccount sa = new SIPAccount(registrationRequired, displayName, userName, authenticationId, registerPassword, domainHost, domainPort);
                InvokeGUIThread(mymsg = "SIP Acc Created!!");

                NatConfiguration nc = new NatConfiguration();
                nc.AutoDetect = true;

                PhoneLineConfiguration config = new PhoneLineConfiguration(sa);
                config.NatConfig = nc;

                PhoneLine = SoftPhone.CreatePhoneLine(config);
                PhoneLine.RegistrationStateChanged += PhoneLine_PhoneLineInfo;
                InvokeGUIThread(mymsg = "PhoneLine Created!!");
                SoftPhone.RegisterPhoneLine(PhoneLine);

                ConnectMedia();
            }
            catch (Exception ex)
            {
                InvokeGUIThread(mymsg = ("Unknown Error: " + ex));
            }
        }
        /// <summary>
        /// Creates a phone line and adds it to the collection.
        /// </summary>
        public IPhoneLine AddPhoneLine(PhoneLineConfiguration config)
        {
            IPhoneLine line = softPhone.CreatePhoneLine(config);
            SubscribeToLineEvents(line);

            // add to collection
            PhoneLines.Add(line);

            return line;
        }
 /// <summary>
 /// Creates a phone line and adds it to the collection.
 /// </summary>
 public IPhoneLine AddPhoneLine(SIPAccount account, Ozeki.Network.TransportType transportType, NatConfiguration natConfig, SRTPMode srtpMode)
 {
     var config = new PhoneLineConfiguration(account);
     config.TransportType = transportType;
     config.NatConfig = natConfig;
     config.SRTPMode = srtpMode;
     return AddPhoneLine(config);
 }