簡體   English   中英

無法使用ucma 5.0從pstn轉接來電

[英]cannot transfer calls in inbound call from pstn with ucma 5.0

我正在為buisienss和UCMA 5.0開發基於skype的自定義IVR系統

在我的應用程序中,我使用begintransfer方法將調用轉移給用戶。 當我從Skype客戶端內部呼叫時,一切正常,呼叫路由正確。 來自pstn網關呼叫的入站呼叫被應答,並且無需異常執行begintransfer,但呼叫不會路由到分機。

這是我的代碼: call.BeginTransfer()

我不能使用前進(而不是轉移),因為當呼叫尚未建立時,前向工作。 我需要播放錄音並為沒有IVR的轉接而不轉發的來電做出選擇。

我想我在“_toneController_ToneReceived”事件中遺漏了一些東西

我究竟做錯了什么?

在此輸入圖像描述

public class IVR
{

    private static void _toneController_ToneReceived(object sender, ToneControllerEventArgs e)
        {

            number += getToneString(tone);

            if (number.Length == 3)
            {
                try
                {    
                    CallTransferOptions unattendedTransferOptions = new CallTransferOptions(CallTransferType.Unattended);

                    //  currentCall.BeginTransfer(number, unattendedTransferOptions, TransferCallBack, null);
                    //currentCall.BeginTransfer(number , null,null);//, EndEndpointEstablish, new object());

                    currentCall.BeginTransfer(
                                       number,
                                       new CallTransferOptions(CallTransferType.Attended),
                                       result =>
                                       {
                                           try
                                           {
                                               currentCall.EndTransfer(result);
                                           }
                                           catch (OperationFailureException ofe)
                                           {
                                               Logger_Call.log(string.Format("The recipient declined or did not answer the call:{0}",
                                                   ofe));
                                           }
                                           catch (RealTimeException rte)
                                           {
                                               Logger_Call.log(string.Format("Error transferring call:{0}", rte));
                                           }
                                       }, null);


                    Logger_Call.log(currentCall.OriginalDestinationUri + " ==> " + number);
                }
                catch (Exception ex)
                {
                    Logger_Call.log(currentCall.OriginalDestinationUri + " ==ex==> " + ex.Message);
                }
            }

        }

    private void InitializeCallReceive(string applicationUri, string serverName, int serverPort, NetworkCredential credential)
    {
        try
        {
            Debugger.Launch();

            ClientPlatformSettings clientPlatformSettings;
            clientPlatformSettings = new ClientPlatformSettings("IVR.Server", SipTransportType.Tls);

            collaborationPlatform = new CollaborationPlatform(clientPlatformSettings);
            collaborationPlatform.EndStartup(collaborationPlatform.BeginStartup(null, null));

            UserEndpointSettings endpointSettings;

            endpointSettings = new UserEndpointSettings(applicationUri, serverName, serverPort);


            endpoint = new UserEndpoint(collaborationPlatform, endpointSettings);


            endpoint.Credential = credential;

            endpoint.RegisterForIncomingCall<AudioVideoCall>(AudioVideoCallReceived);

            endpoint.EndEstablish(endpoint.BeginEstablish(null, endpoint));
        }
        catch (Exception ex)
        {
        }
    }


    private void AudioVideoCallReceived(object sender, CallReceivedEventArgs<AudioVideoCall> e)
    {
        currentCall = e.Call;

        currentCall.AudioVideoFlowConfigurationRequested += new EventHandler<AudioVideoFlowConfigurationRequestedEventArgs>(Call_AudioVideoFlowConfigurationRequested);


        currentCall.EndAccept(currentCall.BeginAccept(null, null));

    }
    private void Call_AudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e)
    {
        currentCall.Flow.StateChanged += new EventHandler<MediaFlowStateChangedEventArgs>(Flow_StateChanged);
    }
    private void Flow_StateChanged(object sender, MediaFlowStateChangedEventArgs e)
    {
        _flow = (AudioVideoFlow)sender;

        if (e.State == MediaFlowState.Active)
        {
            try
            {
                ToneController _toneController = new ToneController();
                _toneController.ToneReceived += _toneController_ToneReceived;
                _toneController.AttachFlow(_flow);

                MediaSource source = new WmaFileSource("rec.wma");
                source.EndPrepareSource(source.BeginPrepareSource(MediaSourceOpenMode.Buffered, null, null));
                Player _player = new Player();
                _player.SetSource(source);

                _player.AttachFlow(_flow);
                _player.SetMode(PlayerMode.Automatic);

                _player.Start();
            }
            catch (Exception)
            {
            }
        }
    }





}

代碼是正確的。 我在Skype服務器上設置錯誤。 如果傳輸正在運行,則必須在中繼配置中啟用suport

檢查此鏈接: https//support.microsoft.com/en-us/kb/2506083

重要的提示 :

Lync Server全局,站點或池中繼配置策略啟用了“啟用引用支持”選項

本地部署的IP網關或由Internet服務提供商(ISP)SIP中繼服務部署的IP網關不支持使用SIP REFER方法

樹干配置的圖像

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM