using System;
using System.ServiceModel;

namespace GatewayAPI
{
    [ServiceContract(Namespace = "rf.services",
        CallbackContract = typeof(IServerCallbacks),
        SessionMode = SessionMode.Required)]
    public interface IServerMethods
    {
        [OperationContract]
        bool IsServerAlive();

        [OperationContract(IsOneWay = true)]
        void SubscribeCallback(Guid clientGuid);
        [OperationContract(IsOneWay = true)]
        void UnsubscribeCallback(Guid clientGuid);

        [OperationContract]
        bool Test();
        [OperationContract]
        string[] GetGatewayInformation();
        [OperationContract]
        int GetSignalStatus();
        [OperationContract]
        bool SendSMS(string phoneNumber, string smsMessage, bool approve);
        [OperationContract]
        bool RingThePhone(string phoneNumber, bool approve);

    }

    public interface IServerCallbacks
    {
        [OperationContract(IsOneWay = true)]
        void IncommingMessage(string message, string phone, DateTime incommingTime);
        [OperationContract(IsOneWay = true)]
        void IncommingCall(string phone, DateTime incommingTime);
    }
}
