Ejemplo n.º 1
0
        public void PlaceCallOnHold(ActiveCall call)
        {
            // Build action
            var holdCallAction = new CXSetHeldCallAction(call.UUID, true);

            // Create transaction
            var transaction = new CXTransaction(holdCallAction);

            // Inform system of call request
            SendTransactionRequest(transaction);
        }
Ejemplo n.º 2
0
        public void EndCall(ActiveCall call)
        {
            // Build action
            var endCallAction = new CXEndCallAction(call.UUID);

            // Create transaction
            var transaction = new CXTransaction(endCallAction);

            // Inform system of call request
            SendTransactionRequest(transaction);
        }
Ejemplo n.º 3
0
        public override void PerformStartCallAction(CXProvider provider, CXStartCallAction action)
        {
            // Create new call record
            var activeCall = new ActiveCall(action.CallUuid, action.CallHandle.Value, true);

            // Monitor state changes
            activeCall.StartingConnectionChanged += (call) => {
                if (call.IsConnecting)
                {
                    // Inform system that the call is starting
                    Provider.ReportConnectingOutgoingCall(call.UUID, Tools.ConvertDateTimeToNSDate(call.StartedConnectingOn));
                }
            };

            activeCall.ConnectedChanged += (call) => {
                if (call.IsConnected)
                {
                    // Inform system that the call has connected
                    provider.ReportConnectedOutgoingCall(call.UUID, Tools.ConvertDateTimeToNSDate(call.ConnectedOn));
                }
            };

            // Start call
            activeCall.StartCall((successful) => {
                // Was the call able to be started?
                if (successful)
                {
                    // Yes, inform the system
                    action.Fulfill();

                    // Add call to manager
                    CallManager.Calls.Add(activeCall);
                }
                else
                {
                    // No, inform system
                    action.Fail();
                }
            });
        }