Jump to content
Fórum Script Brasil
  • 0

Script de softphone VoIP (c#.net)


LuanFelipe

Question

Olá,
Eu criei um telefone de software que é capaz de se conectar a um sistema telefônico.
Eu escrevi o seguinte script usando uma biblioteca C# Voip comercial.
Infelizmente, a minha versão de avaliação irá expirar em breve, mas eu gostaria de implementar algumas características adicionais (áudio e vidio telefônicos SIP).
Alguém pode me recomendar um (fonte ou aberto) alternativa livre para esta biblioteca que pode ser usado para melhorar o meu softphone Voip em C#.net?
Graças
namespace SIP_Register
{
    class Program
    {
        private static ISoftPhone softphone;
        private static IPhoneLine phoneLine;


        private static void Main(string[] args)
        {
            softphone = SoftPhoneFactory.CreateSoftPhone(5000, 10000);


            var registrationRequired = true;
            var userName = "sipusername";
            var displayName = "sipdisplayname";
            var authenticationId = "authenticationid";
            var registerPassword = "Password";
            var domainHost = "pbxip.voipprovider.com";
            var domainPort = 5060;


            var account = new SIPAccount(registrationRequired, displayName, userName, authenticationId, registerPassword, domainHost, domainPort);


            RegisterAccount(account);


            Console.ReadLine();
        }


        static void RegisterAccount(SIPAccount account)
        {
            try
            {
                phoneLine = softphone.CreatePhoneLine(account);
                phoneLine.RegistrationStateChanged += sipAccount_RegStateChanged;
                softphone.RegisterPhoneLine(phoneLine);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error during SIP registration: " + ex);
            }
        }


        static void sipAccount_RegStateChanged(object sender, RegistrationStateChangedArgs e)
        {
            if (e.State == RegState.Error || e.State == RegState.NotRegistered)
                Console.WriteLine("Registration failed!");


            if (e.State == RegState.RegistrationSucceeded)
                Console.WriteLine("Registration succeeded - Online!");
        }
    }
}

(Fonte: voip softphone)

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      652k
×
×
  • Create New...