Exemplo n.º 1
0
        public DefaultSipClient(SipClientAccount account)
        {
            if (account == null)
            {
                throw new ArgumentNullException("Invalid account.");
            }

            Account          = account;
            TransactionLayer = new TransactionAgent(Account.RegistrarUri);
        }
Exemplo n.º 2
0
        public static ISipClient UseDefaultSipClient(this ISipBuilder builder)
        {
            SipClientAccount account = new SipClientAccount()
            {
                RegistrarUri = builder.RegistrarUri,
                User         = builder.User
            };

            DefaultSipClient sipClient = new DefaultSipClient(account);

            sipClient.TransactionLayer.StartListening(builder.ClientUri.Host, builder.ClientUri.Port);

            return(sipClient);

            // TODO this method should create sip builder and save it to some temp variable... sip client definition should be handled by some final builder method
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Creates user identification from sip account.
        /// </summary>
        /// <param name="account">Sip client account.</param>
        /// <returns>Identification.</returns>
        public static Identification GetAccountIdentification(this SipClientAccount account)
        {
            SipUri identification = new SipUri(account.RegistrarUri.Host, account.User);

            return(new Identification(identification, null));
        }
Exemplo n.º 4
0
 public DefaultSipClient(SipClientAccount account, IEnumerable <string> allowedMethods)
     : this(account)
 {
     AllowedMethods = allowedMethods ?? throw new ArgumentNullException("Allowed methods cann't be null.");
 }