我正在尝试构建一个UCMA独立的出站拨号器 . 不幸的是,我找不到很多关于如何连接到SIP或如何配置它的信息 . 我有一个GetOnSIP,并希望将它与我的应用程序联系起来 . 任何帮助,将不胜感激!

谢谢

//设置我的应用程序

internal void Start()
        {
            _applicationId = ConfigurationManager.AppSettings["applicationId"];
            _recipientSipUri = ConfigurationManager.AppSettings["recipientSipUri"];
            //string urisToDialString = ConfigurationManager.AppSettings["numbersToDial"];

            _urisToDial.Add("phone number goes here");

            ServerPlatformSettings platformSettingsObj = new ServerPlatformSettings(_applicationId,  Dns.GetHostEntry("localhost").HostName,              
                5060, string.Empty /* empty string for the GRUU */);
            Utils.WriteDebug("Endpoint: " + platformSettingsObj.Localhost);

            _platform = new CollaborationPlatform(platformSettingsObj);
            _platform.AllowedAuthenticationProtocol = SipAuthenticationProtocols.None;

            try
            {
                _platform.BeginStartup(ar =>
                {
                    try
                    {
                        _platform.EndStartup(ar);

                        Console.WriteLine("Platform started.");
                        StartEndpoint();

                        Console.WriteLine("Platform Endpoint Initiated.");
                        CallSession sessionObj = new CallSession(_urisToDial.First(), _endpoint);
                        sessionObj.InitiateCall();
                    }
                    catch (RealTimeException ex)
                    {
                        Console.WriteLine(ex);
                    }
                }, null);
            }
            catch (InvalidOperationException ex)
            {
                Console.WriteLine(ex);
            }
        }
private void StartEndpoint()
            {
                // Create a placeholder URI for the endpoint.
                ApplicationEndpointSettings endpointSettings =
                    new ApplicationEndpointSettings("sip:default@" +
                        Dns.GetHostEntry("localhost").HostName);

                // Make this a default routing endpoint, so that
                // all requests sent to the listening port on this IP,
                // regardless of To URI, will come to the endpoint.
                endpointSettings.IsDefaultRoutingEndpoint = true;

                // Create a new endpoint and register for AV calls.
                _endpoint = new ApplicationEndpoint(_platform, endpointSettings);
                _endpoint.RegisterForIncomingCall<AudioVideoCall>(OnCallReceived);

                try
                {
                    _endpoint.BeginEstablish(ar =>
                    {
                        try
                        {
                            _endpoint.EndEstablish(ar);

                            Console.WriteLine("Endpoint started.");
                        }
                        catch (RealTimeException ex)
                        {
                            Console.WriteLine(ex);
                        }
                    }, null);
                }
                catch (InvalidOperationException ex)
                {
                    Console.WriteLine(ex);
                }
            }

public CallSession(string number,ApplicationEndpoint endpointObj){//设置应该发送INVITE的主机和端口//我要猜测这是sbc ip的去向ConnectionContext connectionContextObj = new ConnectionContext(“192.168.0.56” “,5060);

optionsObj.ConnectionContext = connectionContextObj;
        //configure this to use udp

        _phoneNumber = number;
        _endpoint = endpointObj;

    }

    public bool InitiateCall()
    {
        bool isInitiated = true;

        try
        {
            Utils.WriteDebug("About to Initiate a phone Call");
            Conversation convObj = new Conversation(_endpoint);

            AudioVideoCall avcallObj = new AudioVideoCall(convObj);

            // Establish the call using the options we created
            //avcall.BeginEstablish("sip:test@test.greenl.ee", optionsObj,
            avcallObj.BeginEstablish("tel:+" + _phoneNumber, optionsObj,
                ar =>
                {
                    try
                    {
                        avcallObj.EndEstablish(ar);
                        Console.WriteLine("The call with Local Participant: " + avcallObj.Conversation.LocalParticipant + " and Remote Participant: " + avcallObj.RemoteEndpoint.Participant + " is now in the established state.");
                    }
                    catch (RealTimeException ex)
                    {                           
                        isInitiated = false;
                        Utils.LogError(ex);
                    }
                },
                null);

        }
        catch (InvalidOperationException ex)
        {               
            isInitiated = false;
            Utils.LogError(ex);
        }

        return isInitiated;
    }