Exemplo n.º 1
0
        public long StartCall(string ParticipantA, string ParticipantB, bool IsFree = false)
        {
            if (Com.WebServiceDefinitions.Platform == Com.WebServiceDefinitions.PlatformCode.Static)
            {
                return(1234);
            }

            string callRequestString = "ParticipantA:" + ParticipantA + ";ParticipantB:" + ParticipantB;

            try
            {
                var serializer = new LIB.Serialize();

                var req = new startCallRequest();
                req.campaignCode = !IsFree ? this.CampaignCode : this.CampaignCodeFree;
                req.participantA = ParticipantA;
                req.participantB = ParticipantB;

                startCallResponse resp = WebServiceLoader.TiklaKonusClient().startCall(req);

                var a = GetCallInformation(resp.callId);

                try
                {
                    callRequestString = serializer.SerializeObject(req);
                    string callInformationString = serializer.SerializeObject(a);

                    WebServiceLoader.Log(new WebServiceLog
                    {
                        Status       = LogService.LogStatus.Success.ToString(),
                        Naming       = Com.WebServiceDefinitions.Naming.TiklaKonusWsdl.ToString(),
                        RequestUrl   = callRequestString,
                        ResponseData = callInformationString
                    });
                }
                catch (Exception) { }

                return(resp.callId);
            }
            catch (Exception ex)
            {
                //LOG KAYIT
                WebServiceLoader.Log(new WebServiceLog
                {
                    Status       = LogService.LogStatus.Failure.ToString(),
                    Naming       = Com.WebServiceDefinitions.Naming.TiklaKonusWsdl.ToString(),
                    RequestUrl   = callRequestString,
                    ResponseData = ex.Message
                });
                return(0);
            }
        }
Exemplo n.º 2
0
        public getCallInformationResponse GetCallInformation(long CallId)
        {
            string callRequestString = "getCallInformationRequest(" + CallId.ToString() + ")";

            try
            {
                getCallInformationRequest g = new getCallInformationRequest();
                g.callId = CallId;

                var resp = WebServiceLoader.TiklaKonusClient().getCallInformation(g);

                try
                {
                    var serializer = new LIB.Serialize();
                    callRequestString = serializer.SerializeObject(g);

                    string callInformationString = serializer.SerializeObject(resp);

                    WebServiceLoader.Log(new WebServiceLog
                    {
                        Status       = LogService.LogStatus.Success.ToString(),
                        Naming       = Com.WebServiceDefinitions.Naming.TiklaKonusWsdl.ToString(),
                        RequestUrl   = callRequestString,
                        ResponseData = callInformationString
                    });
                }
                catch (Exception) { }

                return(resp);
            }
            catch (Exception ex)
            {
                //LOG KAYIT
                WebServiceLoader.Log(new WebServiceLog
                {
                    Status       = LogService.LogStatus.Failure.ToString(),
                    Naming       = Com.WebServiceDefinitions.Naming.TiklaKonusWsdl.ToString(),
                    RequestUrl   = callRequestString,
                    ResponseData = ex.Message + " - innerEx: " + ex.InnerException
                });
                return(null);
            }
        }