コード例 #1
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));
            }
        }
コード例 #2
0
        /// <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)
        {
            IPhoneLine line = softPhone.CreatePhoneLine(account, natConfig, transportType, srtpMode);
            SubscribeToLineEvents(line);

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

            return line;
        }
コード例 #3
0
 /// <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);
 }
コード例 #4
0
        /// <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)
        {
            IPhoneLine line = softPhone.CreatePhoneLine(account, natConfig, transportType, srtpMode);

            SubscribeToLineEvents(line);

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

            return(line);
        }
コード例 #5
0
        /// <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));
        }