id,time_stamp,source,ip,action,object_type,user_name,object_name,prev_data,new_data
359,2025-01-20 10:55:12.781312+00,0,91.216.43.225,18,1001,"2000 Guiraud, Nicolas",Web Client,,
361,2025-02-06 14:06:41.20191+00,0,86.248.54.130,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 5 Beta 2,,
368,2025-03-10 17:43:38.112612+00,0,91.165.186.164,18,1001,4999 Koesio,Web Client,,
369,2025-03-10 17:44:23.388136+00,0,91.165.186.164,1,86,4999 Koesio,New 20.0 Update 5 Release,,
376,2025-04-11 13:49:27.551542+00,0,91.216.43.225,1,7,"2000 Guiraud, Nicolas","2000 Guiraud, Nicolas","{""MyPhoneShowRecordings"":true}","{""MyPhoneShowRecordings"":false}"
377,2025-04-11 13:49:35.825976+00,0,91.216.43.225,1,7,"2000 Guiraud, Nicolas","2000 Guiraud, Nicolas","{""MyPhoneShowRecordings"":false,""MyPhoneAllowDeleteRecordings"":false}","{""MyPhoneShowRecordings"":true,""MyPhoneAllowDeleteRecordings"":true}"
378,2025-04-23 07:58:50.648777+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 6 Beta,,
385,2025-05-14 14:54:14.51163+00,0,91.216.43.225,1,7,4999 Koesio,1000 YANN,"{""SendEmailMissedCalls"":true,""VMEmailOptions"":""Notification"",""Blfs"":""<PhoneDevice Version=\""1\""><BLFS></BLFS></PhoneDevice>"",""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T46S"",""MacAddress"":""805EC0D5ED50"",""Interface"":""demo.agilucs.fr"",""ProvisioningLinkLocal"":""http://demo.agilucs.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMU"",""PCMA"",""G722"",""G729""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""English"",""TimeZone"":"""",""ProvisionType"":""SBC"",""ProvisionExtendedData"":""<sip:3cxBridge@127.0.0.1:5080;user=proxy;uri=sbc.cb93e25a>"",""SbcName"":""Y7lpp3dtDCsc"",""RemoteSpmHost"":"""",""RemoteSpmPort"":5060,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW MMM DD (Mon Jan 15)"",""TimeFormat"":""24-hour clock"",""PowerLed"":""Both (Voicemail and Missed calls)"",""Backlight"":""15 seconds"",""ScreenSaver"":""15 seconds"",""Secret"":"""",""IsSBC"":false,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}","{""SendEmailMissedCalls"":false,""VMEmailOptions"":""None"",""Blfs"":""<PhoneDevice><BLFS><BLF ID=\""-1\"" BLFNo=\""1\"" BLFType=\""Line\"" BLFTypeID=\""6\""/><BLF ID=\""-1\"" BLFNo=\""2\"" BLFType=\""Line\"" BLFTypeID=\""6\""/><BLF ID=\""-1\"" BLFNo=\""3\"" BLFType=\""Line\"" BLFTypeID=\""6\""/></BLFS></PhoneDevice>"",""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T46S"",""MacAddress"":""805EC0D5ED50"",""Interface"":""demo.agilucs.fr"",""ProvisioningLinkLocal"":""http://demo.agilucs.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMA"",""G722"",""G729"",""PCMU""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""English"",""TimeZone"":"""",""ProvisionType"":""SBC"",""ProvisionExtendedData"":""<sip:3cxBridge@127.0.0.1:5080;user=proxy;uri=sbc.cb93e25a>"",""SbcName"":""Y7lpp3dtDCsc"",""RemoteSpmHost"":"""",""RemoteSpmPort"":5060,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW MMM DD (Mon Jan 15)"",""TimeFormat"":""24-hour clock"",""PowerLed"":""Both (Voicemail and Missed calls)"",""Backlight"":""15 seconds"",""ScreenSaver"":""15 seconds"",""Secret"":"""",""IsSBC"":false,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}"
389,2025-05-26 14:22:33.924576+00,0,91.165.186.164,18,1001,4999 Koesio,Web Client,,
395,2025-06-12 13:12:25.817227+00,0,91.165.186.164,1,1006,4999 Koesio,,"{""CompanyName"":""Labo Koesio""}","{""CompanyName"":""Labo Koesio (NFR)""}"
407,2025-06-16 07:43:14.088042+00,0,91.165.186.164,18,1001,6666 Eric,Web Client,,
409,2025-06-16 07:44:23.644375+00,0,91.165.186.164,18,1001,4999 Koesio,Web Client,,
420,2025-06-25 09:42:47.939904+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
421,2025-06-25 09:43:46.815329+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
452,2025-06-25 13:59:58.087223+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""https://agtruck.fr/transport/api/external/phone-call-event/3cx\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:`{MyCall.Status}`\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:`{MyCall.Status}`\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}"
466,2025-06-25 14:48:15.183282+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         logFormatter.Info(\""📞 Incoming call detected!\"");\r\n         logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n         logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:{MyCall.Status}\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/your-url\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(this, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
470,2025-06-25 15:00:19.467896+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            \r\n            ITrunkCall trunkCall = MyCall as ITrunkCall;\r\n            variableMap[\""session.dnis\""] = new Variable(trunkCall?.CalledNumber ?? \""Unknown\"");\r\n            \r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
471,2025-06-25 15:01:01.523433+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            \r\n            ITrunkCall trunkCall = MyCall as ITrunkCall;\r\n            variableMap[\""session.dnis\""] = new Variable(trunkCall?.CalledNumber ?? \""Unknown\"");\r\n            \r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
506,2025-09-01 15:25:32.707722+00,0,92.184.112.212,18,1001,4999 Koesio,Web Client,,
360,2025-01-21 13:36:38.36744+00,0,86.248.54.130,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 5 Beta,,
362,2025-02-14 13:45:09.528705+00,0,91.216.43.225,18,1001,4999 Koesio,Web Client,,
370,2025-03-28 15:28:59.064593+00,0,91.216.43.225,18,1001,"2000 Guiraud, Nicolas",Web Client,,
371,2025-03-28 15:29:28.153876+00,0,91.216.43.225,1,1009,"2000 Guiraud, Nicolas",MULTICOMPANYMODE,"{""value"":""1""}","{""value"":""0""}"
372,2025-03-28 15:29:28.15781+00,0,91.216.43.225,1,1009,"2000 Guiraud, Nicolas",MULTICOMPANYMODE,"{""value"":""0""}","{""value"":""1""}"
379,2025-04-23 13:09:58.799289+00,0,91.216.43.225,18,1001,4999 Koesio,Web Client,,
380,2025-04-23 13:10:34.31715+00,0,91.216.43.225,0,30,4999 Koesio,SBC238094,,"{""Name"":""4tqXm7b5AYdp"",""DisplayName"":""SBC238094"",""Password"":""****""}"
381,2025-04-23 13:11:06.958777+00,0,91.216.43.225,1,30,4999 Koesio,SBC-Atelier-NE PAS EFFACER,"{""DisplayName"":""SBC238094""}","{""DisplayName"":""SBC-Atelier-NE PAS EFFACER""}"
386,2025-05-14 14:55:51.490981+00,0,91.216.43.225,1,7,4999 Koesio,1000 YANN,"{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T46S"",""MacAddress"":""805EC0D5ED50"",""Interface"":""demo.agilucs.fr"",""ProvisioningLinkLocal"":""http://demo.agilucs.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMA"",""G722"",""G729"",""PCMU""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""English"",""TimeZone"":"""",""ProvisionType"":""SBC"",""ProvisionExtendedData"":""<sip:3cxBridge@127.0.0.1:5080;user=proxy;uri=sbc.cb93e25a>"",""SbcName"":""Y7lpp3dtDCsc"",""RemoteSpmHost"":"""",""RemoteSpmPort"":5060,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW MMM DD (Mon Jan 15)"",""TimeFormat"":""24-hour clock"",""PowerLed"":""Both (Voicemail and Missed calls)"",""Backlight"":""15 seconds"",""ScreenSaver"":""15 seconds"",""Secret"":"""",""IsSBC"":false,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}","{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T46S"",""MacAddress"":""805EC0D5ED50"",""Interface"":""demo.agilucs.fr"",""ProvisioningLinkLocal"":""http://demo.agilucs.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMA"",""G722"",""G729"",""PCMU""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""French"",""TimeZone"":"""",""ProvisionType"":""SBC"",""ProvisionExtendedData"":""<sip:3cxBridge@127.0.0.1:5080;user=proxy;uri=sbc.cb93e25a>"",""SbcName"":""Y7lpp3dtDCsc"",""RemoteSpmHost"":"""",""RemoteSpmPort"":5060,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW DD MMM  (Mon 15 Jan)"",""TimeFormat"":""24-hour clock"",""PowerLed"":""Both (Voicemail and Missed calls)"",""Backlight"":""2 hour"",""ScreenSaver"":""6 hours"",""Secret"":"""",""IsSBC"":false,""CustomLogo"":""t54yealink.png"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}"
390,2025-05-26 14:23:23.265332+00,0,91.165.186.164,23,1001,4999 Koesio,installedprograms,,
396,2025-06-16 07:19:01.608633+00,0,91.165.186.164,1,7,4999 Koesio,4999 Koesio,"{""EmailAddress"":""cloud@koesio-telecom.fr"",""Blfs"":""<PhoneDevice><BLFS><BLF ID=\""-1\"" BLFNo=\""1\"" BLFType=\""Line\"" BLFTypeID=\""6\"" /><BLF ID=\""-1\"" BLFNo=\""2\"" BLFType=\""Line\"" BLFTypeID=\""6\"" /><BLF ID=\""-1\"" BLFNo=\""3\"" BLFType=\""Line\"" BLFTypeID=\""6\"" /></BLFS></PhoneDevice>""}","{""EmailAddress"":""labo@koesio-telecom.fr"",""Blfs"":""<PhoneDevice><BLFS><BLF ID=\""-1\"" BLFNo=\""1\"" BLFType=\""Line\"" BLFTypeID=\""6\""/><BLF ID=\""-1\"" BLFNo=\""2\"" BLFType=\""Line\"" BLFTypeID=\""6\""/><BLF ID=\""-1\"" BLFNo=\""3\"" BLFType=\""Line\"" BLFTypeID=\""6\""/></BLFS></PhoneDevice>""}"
398,2025-06-16 07:19:49.153346+00,0,91.165.186.164,1,30,4999 Koesio,Alphalink,"{""RoutingRules"":[{""CustomData"":"""",""Data"":""0987660607"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660601"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660604"",""RuleName"":""Grenoble"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660605"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660606"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660609"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660608"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8006"",""To"":""RingGroup"",""Name"":""Groupement test"",""Type"":""RingGroup"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8006"",""To"":""RingGroup"",""Name"":""Groupement test"",""Type"":""RingGroup"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660602"",""RuleName"":""Nicolas"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""Queue"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""None"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660603"",""RuleName"":""Nico"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":"""",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""ForwardAll"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}}]}","{""RoutingRules"":[{""CustomData"":"""",""Data"":""0987660607"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660601"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660604"",""RuleName"":""Grenoble"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660605"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660606"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660609"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660608"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8006"",""To"":""RingGroup"",""Name"":""Groupement test"",""Type"":""RingGroup"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8006"",""To"":""RingGroup"",""Name"":""Groupement test"",""Type"":""RingGroup"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660602"",""RuleName"":""Nicolas"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""Queue"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""None"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660603"",""RuleName"":""Nico"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660600"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4999"",""To"":""Extension"",""Name"":""Koesio"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4999"",""To"":""Extension"",""Name"":""Koesio"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""4999"",""To"":""Extension"",""Name"":""Koesio"",""Type"":""Extension"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":"""",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""ForwardAll"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}}]}"
408,2025-06-16 07:44:10.556474+00,0,91.165.186.164,18,1001,6666 Eric,Web Client,,
410,2025-06-16 07:44:46.442324+00,0,91.165.186.164,1,7,4999 Koesio,"6400 CHARLAT, Jerome","{""Groups"":[{""GroupId"":21,""Number"":""6400"",""MemberName"":""CHARLAT, Jerome"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""system_admins""},""CanDelete"":true,""TranscriptionMode"":""Voicemail""}]}","{""Groups"":[{""GroupId"":21,""Number"":""6400"",""MemberName"":""CHARLAT, Jerome"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""system_owners""},""CanDelete"":true,""TranscriptionMode"":""Voicemail""}]}"
411,2025-06-16 07:46:27.367825+00,0,91.165.186.164,21,7,4999 Koesio,"6400 CHARLAT, Jerome",,"{""RpsKey"":true,""SipAuth"":true,""WebclientPassword"":true,""VoicemailPIN"":true,""DeskphonePassword"":true,""SendWelcomeEmail"":true,""ConfigurationLink"":true}"
423,2025-06-25 09:46:58.294889+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
424,2025-06-25 09:47:02.201043+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
425,2025-06-25 09:49:20.392669+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
426,2025-06-25 09:49:33.595264+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
518,2025-10-28 08:22:29.934607+00,0,91.216.43.225,18,1001,"2000 Guiraud, Nicolas",Web Client,,
519,2025-10-28 08:22:50.682637+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 8 Alpha,,
363,2025-02-19 16:42:59.277094+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 5 RC,,
373,2025-03-28 15:38:03.681511+00,0,91.216.43.225,1,7,"2000 Guiraud, Nicolas","2001 Vermeille, Alice","{""PrimaryGroupId"":21,""Groups"":[{""GroupId"":24,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Avant-vente"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""group_owners""},""CanDelete"":true,""TranscriptionMode"":""Both""},{""GroupId"":21,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""group_owners""},""CanDelete"":true,""TranscriptionMode"":""Voicemail""}]}","{""PrimaryGroupId"":24,""Groups"":[{""GroupId"":21,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""group_owners""},""CanDelete"":true,""TranscriptionMode"":""Voicemail""},{""GroupId"":24,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Avant-vente"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""group_owners""},""CanDelete"":true,""TranscriptionMode"":""Both""}]}"
382,2025-05-13 07:32:31.447459+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 6 RC,,
387,2025-05-14 15:03:56.303514+00,0,91.216.43.225,1,7,4999 Koesio,1000 YANN,"{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T46S"",""MacAddress"":""805EC0D5ED50"",""Interface"":""demo.agilucs.fr"",""ProvisioningLinkLocal"":""http://demo.agilucs.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMA"",""G722"",""G729"",""PCMU""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""French"",""TimeZone"":"""",""ProvisionType"":""SBC"",""ProvisionExtendedData"":""<sip:3cxBridge@127.0.0.1:5080;user=proxy;uri=sbc.cb93e25a>"",""SbcName"":""Y7lpp3dtDCsc"",""RemoteSpmHost"":"""",""RemoteSpmPort"":5060,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW DD MMM  (Mon 15 Jan)"",""TimeFormat"":""24-hour clock"",""PowerLed"":""Both (Voicemail and Missed calls)"",""Backlight"":""2 hour"",""ScreenSaver"":""6 hours"",""Secret"":"""",""IsSBC"":false,""CustomLogo"":""t54yealink.png"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}","{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T46S"",""MacAddress"":""805EC0D5ED50"",""Interface"":""demo.agilucs.fr"",""ProvisioningLinkLocal"":""http://demo.agilucs.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMA"",""G722"",""G729"",""PCMU""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""French"",""TimeZone"":"""",""ProvisionType"":""SBC"",""ProvisionExtendedData"":""<sip:3cxBridge@127.0.0.1:5080;user=proxy;uri=sbc.cb93e25a>"",""SbcName"":""Y7lpp3dtDCsc"",""RemoteSpmHost"":"""",""RemoteSpmPort"":5060,""XferType"":""AttXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW DD MMM  (Mon 15 Jan)"",""TimeFormat"":""24-hour clock"",""PowerLed"":""Both (Voicemail and Missed calls)"",""Backlight"":""2 hour"",""ScreenSaver"":""6 hours"",""Secret"":"""",""IsSBC"":false,""CustomLogo"":""t54yealink.png"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}"
391,2025-05-28 15:50:58.760698+00,0,91.216.43.225,16,36,4999 Koesio,,,
397,2025-06-16 07:19:22.431605+00,0,91.165.186.164,1,52,4999 Koesio,,"{""NotifyTrunkFailover"":false,""NotifyRequestAntiHacked"":true,""NotifyCallDenied"":true}","{""NotifyTrunkFailover"":true,""NotifyRequestAntiHacked"":false,""NotifyCallDenied"":false}"
412,2025-06-17 07:09:14.938286+00,0,90.39.195.115,18,1001,"6400 CHARLAT, Jerome",Web Client,,
427,2025-06-25 09:49:57.68069+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
428,2025-06-25 09:50:02.367028+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
429,2025-06-25 09:50:16.514819+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
430,2025-06-25 09:50:22.407315+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
431,2025-06-25 09:50:34.281418+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
432,2025-06-25 09:50:42.544161+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
453,2025-06-25 14:26:31.335397+00,0,90.39.195.115,2,18,"6400 CHARLAT, Jerome",logisync,"{""CompilationSucceeded"":true,""InvalidScript"":false,""CompilationResult"":"":[39..53)H: (3,0)-(3,14): Hidden CS8019: Directive using non nécessaire.\nusing MimeKit;\n^^^^^^^^^^^^^^\n:[108..126)H: (6,0)-(6,18): Hidden CS8019: Directive using non nécessaire.\nusing System.Linq;\n^^^^^^^^^^^^^^^^^^\n:[199..222)H: (9,0)-(9,23): Hidden CS8019: Directive using non nécessaire.\nusing System.Threading;\n^^^^^^^^^^^^^^^^^^^^^^^"",""CompilationLastSuccess"":""2025-06-25T15:59:58.3714567+02:00"",""Name"":""test"",""IsRegistered"":true,""RoutingType"":""DialCode"",""Number"":""logisync"",""Groups"":[]}",
454,2025-06-25 14:30:40.709062+00,0,90.39.195.115,0,18,"6400 CHARLAT, Jerome",logisync,,"{""AppName"":""test"",""RoutingType"":""DialCode"",""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:`{MyCall.Status}`\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}\r\n"",""Number"":""logisync"",""GroupId"":"""",""Trunk"":""""}"
488,2025-06-30 08:13:16.945904+00,0,91.165.186.164,1,7,4999 Koesio,"6400 CHARLAT, Jerome","{""Enabled"":true}","{""Enabled"":false}"
491,2025-07-06 14:57:54.620462+00,0,91.216.43.225,1,16,4999 Koesio,TEST Standard,"{""Agents"":[{""Number"":""1000"",""SkillGroup"":""1"",""Name"":""YANN""}],""Groups"":[]}","{""Agents"":[{""Number"":""4999"",""SkillGroup"":""1"",""Name"":""Koesio""}],""Groups"":[{""GroupId"":21,""Number"":""8005"",""MemberName"":""TEST Standard"",""Name"":""Demo"",""Type"":""Queue"",""Tags"":[],""Rights"":{""RoleName"":""system""},""CanDelete"":false,""TranscriptionMode"":""Voicemail""}]}"
508,2025-09-01 15:26:05.8811+00,0,92.184.112.212,18,1001,4999 Koesio,Web Client,,
392,2025-05-28 16:03:10.086466+00,0,91.216.43.225,0,36,4999 Koesio,"",,"{""FirstName"":"""",""LastName"":"""",""PhoneNumber"":""060606060606"",""CompanyName"":""toto"",""Tag"":"""",""Mobile2"":"""",""Email"":"""",""Home"":"""",""Business"":"""",""Other"":"""",""Business2"":"""",""Title"":"""",""BusinessFax"":"""",""Department"":"""",""Pager"":"""",""ContactType"":""3CX""}"
399,2025-06-16 07:23:16.495429+00,0,91.165.186.164,0,7,4999 Koesio,"6400 CHARLAT, Jerome",,"{""Enable2FA"":false,""Require2FA"":false,""MyPhoneShowRecordings"":false,""MyPhoneAllowDeleteRecordings"":false,""MyPhoneHideForwardings"":false,""MyPhonePush"":true,""RecordCalls"":false,""AllowOwnRecordings"":false,""RecordExternalCallsOnly"":false,""RecordEmailNotify"":false,""PrimaryGroupId"":21,""FirstName"":""Jerome"",""LastName"":""CHARLAT"",""DisplayName"":""CHARLAT, Jerome"",""EmailAddress"":""jcharlat@jnjdevelopment.fr"",""Mobile"":"""",""WebMeetingFriendlyName"":""jeromecharlat"",""WebMeetingApproveParticipants"":false,""SendEmailMissedCalls"":false,""VMEnabled"":true,""VMEmailOptions"":""None"",""VMPIN"":""584790"",""VMDisablePinAuth"":true,""VMPlayCallerID"":false,""VMPlayMsgDateTime"":""None"",""Greetings"":[],""ContactImage"":"""",""IsRegistered"":false,""CurrentProfileName"":""Available"",""QueueStatus"":""LoggedIn"",""AuthID"":""OyM0SbTS1z"",""DeskphonePassword"":""****"",""AuthPassword"":""****"",""OutboundCallerID"":"""",""ForwardingProfiles"":[{""Name"":""Custom 2"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Away"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Out of office"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Custom 1"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":false,""DisableRingGroupCalls"":false,""NoAnswerTimeout"":20,""AvailableRoute"":{""NoAnswerAllCalls"":true,""BusyAllCalls"":true,""NotRegisteredAllCalls"":true,""NoAnswerInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NoAnswerExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""BusyInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""BusyExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Available"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":false,""DisableRingGroupCalls"":false,""NoAnswerTimeout"":20,""AvailableRoute"":{""NoAnswerAllCalls"":true,""BusyAllCalls"":true,""NotRegisteredAllCalls"":true,""NoAnswerInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NoAnswerExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""BusyInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""BusyExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]}}}],""ForwardingExceptions"":[],""Blfs"":""<PhoneDevice><BLFS/></PhoneDevice>"",""OfficeHoursProps"":[],""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""BreakTime"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Phones"":[],""Internal"":false,""Enabled"":true,""PromptSet"":""0D767FEA-10A3-4ba4-8A57-FE74BDABE4E5"",""HideInPhonebook"":false,""Tags"":[],""PinProtected"":false,""PinProtectTimeout"":60,""CallScreening"":false,""AllowLanOnly"":true,""SIPID"":"""",""MS365SignInEnabled"":true,""MS365ContactsEnabled"":true,""MS365CalendarEnabled"":true,""MS365TeamsEnabled"":true,""GoogleSignInEnabled"":true,""GoogleContactsEnabled"":true,""GoogleCalendarEnabled"":true,""EnableHotdesking"":false,""SRTPMode"":""SRTPDisabled"",""PbxDeliversAudio"":false,""EmergencyLocationId"":"""",""EmergencyAdditionalInfo"":"""",""CallUsRequirement"":""Both"",""CallUsEnablePhone"":false,""CallUsEnableChat"":true,""CallUsEnableVideo"":false,""ClickToCallId"":""jeromecharlat"",""Number"":""6400"",""Groups"":[{""GroupId"":21,""Number"":""6400"",""MemberName"":""CHARLAT, Jerome"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""system_admins""},""CanDelete"":true,""TranscriptionMode"":""Voicemail""}],""TranscriptionMode"":""Inherit""}"
403,2025-06-16 07:24:22.680396+00,0,91.165.186.164,21,7,4999 Koesio,6666 Eric,,"{""RpsKey"":true,""SipAuth"":true,""WebclientPassword"":true,""VoicemailPIN"":true,""DeskphonePassword"":true,""SendWelcomeEmail"":true,""ConfigurationLink"":true}"
413,2025-06-20 14:42:29.552289+00,0,86.248.54.130,18,1001,4999 Koesio,Web Client,,
433,2025-06-25 09:51:16.279558+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
434,2025-06-25 09:51:29.040671+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
435,2025-06-25 09:51:31.157662+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
436,2025-06-25 09:51:53.35394+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""200"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
437,2025-06-25 09:51:55.98826+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
455,2025-06-25 14:31:07.191157+00,0,90.39.195.115,2,18,"6400 CHARLAT, Jerome",logisync,"{""CompilationSucceeded"":true,""InvalidScript"":false,""CompilationResult"":"":[39..53)H: (3,0)-(3,14): Hidden CS8019: Directive using non nécessaire.\nusing MimeKit;\n^^^^^^^^^^^^^^\n:[108..126)H: (6,0)-(6,18): Hidden CS8019: Directive using non nécessaire.\nusing System.Linq;\n^^^^^^^^^^^^^^^^^^\n:[199..222)H: (9,0)-(9,23): Hidden CS8019: Directive using non nécessaire.\nusing System.Threading;\n^^^^^^^^^^^^^^^^^^^^^^^"",""CompilationLastSuccess"":""2025-06-25T16:30:41.0247049+02:00"",""Name"":""test"",""IsRegistered"":true,""RoutingType"":""DialCode"",""Number"":""logisync"",""Groups"":[]}",
476,2025-06-25 15:40:17.753111+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""FR"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":false,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":""SearchContacts"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://agtruck.fr/transport/api/external/phone-call-event/3cx"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""response"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[],""Outputs"":{""Items"":[{""OutputType"":"""",""Passes"":0,""Value"":""""}],""AllowEmpty"":true}}]}"
495,2025-08-20 12:53:44.801788+00,0,91.216.43.225,18,1001,4999 Koesio,Web Client,,
502,2025-08-27 08:00:23.76733+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 7 Alpha,,
393,2025-05-28 16:06:33.681632+00,0,91.216.43.225,2,36,4999 Koesio,"",,
400,2025-06-16 07:23:16.653807+00,0,91.165.186.164,1,30,4999 Koesio,Alphalink,"{""RoutingRules"":[{""CustomData"":"""",""Data"":""0987660607"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660601"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660604"",""RuleName"":""Grenoble"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660605"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660606"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660609"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660608"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8006"",""To"":""RingGroup"",""Name"":""Groupement test"",""Type"":""RingGroup"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8006"",""To"":""RingGroup"",""Name"":""Groupement test"",""Type"":""RingGroup"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660602"",""RuleName"":""Nicolas"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""Queue"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""None"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660603"",""RuleName"":""Nico"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660600"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4999"",""To"":""Extension"",""Name"":""Koesio"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4999"",""To"":""Extension"",""Name"":""Koesio"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""4999"",""To"":""Extension"",""Name"":""Koesio"",""Type"":""Extension"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":"""",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""ForwardAll"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}}]}","{""RoutingRules"":[{""CustomData"":"""",""Data"":""0987660607"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660601"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660604"",""RuleName"":""Grenoble"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660605"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660606"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660609"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660608"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8006"",""To"":""RingGroup"",""Name"":""Groupement test"",""Type"":""RingGroup"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8006"",""To"":""RingGroup"",""Name"":""Groupement test"",""Type"":""RingGroup"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660602"",""RuleName"":""Nicolas"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""Queue"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""None"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660603"",""RuleName"":""Nico"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660600"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""6400"",""To"":""Extension"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""6400"",""To"":""Extension"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""6400"",""To"":""Extension"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":"""",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""ForwardAll"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}}]}"
414,2025-06-20 14:55:49.393758+00,0,86.248.54.130,1,67,4999 Koesio,,"{""TranscribeEngine"":""None"",""TranscribeSecretKey"":{""Value"":""""}}","{""TranscribeEngine"":""OpenAI"",""TranscribeSecretKey"":{""Value"":""****""}}"
415,2025-06-20 14:56:06.962935+00,0,86.248.54.130,1,67,4999 Koesio,,"{""TranscribeEngine"":""OpenAI""}","{""TranscribeEngine"":""None""}"
438,2025-06-25 09:53:19.874857+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":""SearchContacts"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""200"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
439,2025-06-25 09:53:32.09125+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
440,2025-06-25 09:54:24.475192+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":""SearchContacts"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""response"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
441,2025-06-25 09:54:26.785811+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
442,2025-06-25 09:55:10.401301+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":""SearchContacts"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""response"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[],""Outputs"":{""Items"":[],""AllowEmpty"":false}}]}"
443,2025-06-25 09:55:45.41765+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
444,2025-06-25 09:55:47.85163+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":""SearchContacts"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""response"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[],""Outputs"":{""Items"":[],""AllowEmpty"":false}}]}"
456,2025-06-25 14:31:51.610442+00,0,90.39.195.115,0,18,"6400 CHARLAT, Jerome",logisync,,"{""AppName"":"""",""RoutingType"":""Trunk"",""ScriptCode"":"""",""Number"":""logisync"",""GroupId"":"""",""Trunk"":""10000""}"
457,2025-06-25 14:31:51.682911+00,0,90.39.195.115,1,30,"6400 CHARLAT, Jerome",Alphalink,"{""RUNSCRIPT"":""""}","{""RUNSCRIPT"":""logisync""}"
458,2025-06-25 14:32:05.962211+00,0,90.39.195.115,1,30,"6400 CHARLAT, Jerome",Alphalink,"{""RUNSCRIPT"":""logisync""}","{""RUNSCRIPT"":""""}"
479,2025-06-25 16:15:30.108671+00,0,90.39.195.115,1,30,"6400 CHARLAT, Jerome",Alphalink,"{""RUNSCRIPT"":""logisync""}","{""RUNSCRIPT"":""""}"
394,2025-06-03 08:30:50.349534+00,0,91.216.43.225,18,1001,"2000 Guiraud, Nicolas",Web Client,,
401,2025-06-16 07:23:39.420154+00,0,91.165.186.164,1,7,4999 Koesio,6666 Eric,"{""Groups"":[{""GroupId"":21,""Number"":""6666"",""MemberName"":""Eric"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""system_owners""},""CanDelete"":true,""TranscriptionMode"":""Voicemail""}]}","{""Groups"":[{""GroupId"":21,""Number"":""6666"",""MemberName"":""Eric"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""system_admins""},""CanDelete"":true,""TranscriptionMode"":""Voicemail""}]}"
402,2025-06-16 07:24:04.103722+00,0,91.165.186.164,18,1001,4999 Koesio,Web Client,,
416,2025-06-25 09:35:56.591834+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
445,2025-06-25 10:07:51.015997+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
446,2025-06-25 10:07:54.762188+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":""SearchContacts"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://agtruck.fr/transport/api/external/phone-call-event/3cx"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json"",""PostValues"":{""Values"":[{""Passes"":0,""Value"":""[Number]"",""ValueType"":""String"",""Key"":""entryPhoneNumber"",""If"":"""",""SkipIf"":""""}],""Key"":"""",""If"":"""",""SkipIf"":""""}},""RuleGroups"":[{""Rules"":[{""Path"":""response"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[],""Outputs"":{""Items"":[],""AllowEmpty"":false}}]}"
459,2025-06-25 14:32:06.068168+00,0,90.39.195.115,2,18,"6400 CHARLAT, Jerome",logisync,"{""CompilationSucceeded"":false,""InvalidScript"":true,""CompilationResult"":""Invalid Script structure"",""Name"":"""",""IsRegistered"":true,""RoutingType"":""Trunk"",""Trunk"":{""Gateway"":{""Name"":""Alphalink"",""Type"":""Provider""},""IPRestriction"":""Any"",""TransportRestriction"":""Any"",""Groups"":[]},""Number"":""logisync"",""Groups"":[]}",
467,2025-06-25 14:55:28.466069+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         logFormatter.Info(\""📞 Incoming call detected!\"");\r\n         logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n         logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:{MyCall.Status}\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/your-url\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
468,2025-06-25 14:55:59.148217+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/your-url\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
469,2025-06-25 14:57:20.619609+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.CalledNumber);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
481,2025-06-25 16:23:43.873377+00,0,90.39.195.115,0,18,"6400 CHARLAT, Jerome",logisync,,"{""AppName"":"""",""RoutingType"":""Trunk"",""ScriptCode"":"""",""Number"":""logisync"",""GroupId"":"""",""Trunk"":""10000""}"
482,2025-06-25 16:23:43.885563+00,0,90.39.195.115,1,30,"6400 CHARLAT, Jerome",Alphalink,"{""RUNSCRIPT"":""""}","{""RUNSCRIPT"":""logisync""}"
501,2025-08-27 07:59:36.287011+00,0,91.216.43.225,18,1001,"2000 Guiraud, Nicolas",Web Client,,
503,2025-08-29 07:24:25.306152+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 7 Beta,,
504,2025-08-29 07:30:53.068623+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 7 RC,,
505,2025-09-01 15:23:53.759598+00,0,91.165.186.164,18,1001,4999 Koesio,Web Client,,
404,2025-06-16 07:26:40.534319+00,0,91.165.186.164,18,1001,6666 Eric,Web Client,,
417,2025-06-25 09:40:56.703333+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
418,2025-06-25 09:41:39.145096+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
419,2025-06-25 09:42:30.124067+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
422,2025-06-25 09:43:52.843256+00,0,90.39.195.115,0,88,"6400 CHARLAT, Jerome",LogiSync,,"{""Country"":""US"",""Name"":""LogiSync"",""Version"":1,""SupportsEmojis"":true,""SupportsTranscription"":true,""ListPageSize"":0,""NumberOptions"":{""Prefix"":""AsIs"",""MaxLength"":""[MaxLength]""},""ConnectionOptions"":{""MaxCouncurrentRequests"":2},""Parameters"":[],""Authentication"":{""Type"":""No""},""Scenarios"":[{""Id"":"""",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?number=[Number]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":""application/x-www-form-urlencoded"",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Post"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}},{""Id"":""LookupByEmail"",""ScenarioType"":""REST"",""EntityId"":"""",""EntityOrder"":"""",""Request"":{""SkipIf"":"""",""Url"":""https://api.example.com/search?email=[Email]"",""MessagePasses"":0,""Message"":"""",""RequestContentType"":"""",""RequestEncoding"":""UrlEncoded"",""RequestType"":""Get"",""ResponseType"":""Json""},""RuleGroups"":[{""Rules"":[{""Path"":""contact.id"",""MatchingType"":""Any"",""Ethalon"":""""}]}],""Variables"":[{""Name"":""ContactID"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.id"",""Path"":""contact.id"",""Filter"":[]},{""Name"":""FirstName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.firstname"",""Path"":""contact.firstname"",""Filter"":[]},{""Name"":""LastName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.lastname"",""Path"":""contact.lastname"",""Filter"":[]},{""Name"":""CompanyName"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.company"",""Path"":""contact.company"",""Filter"":[]},{""Name"":""Email"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.email"",""Path"":""contact.email"",""Filter"":[]},{""Name"":""PhoneBusiness"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone"",""Path"":""contact.businessphone"",""Filter"":[]},{""Name"":""PhoneBusiness2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.businessphone2"",""Path"":""contact.businessphone2"",""Filter"":[]},{""Name"":""PhoneMobile"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone"",""Path"":""contact.mobilephone"",""Filter"":[]},{""Name"":""PhoneMobile2"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.mobilephone2"",""Path"":""contact.mobilephone2"",""Filter"":[]},{""Name"":""CustomValue"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.custom"",""Path"":""contact.custom"",""Filter"":[]},{""Name"":""ContactUrl"",""PathInternal"":"""",""LookupValue"":"""",""PathAttribute"":""contact.url"",""Path"":""contact.url"",""Filter"":[]}],""Outputs"":{""Items"":[{""OutputType"":""ContactID"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""FirstName"",""Passes"":0,""Value"":""[FirstName]""},{""OutputType"":""LastName"",""Passes"":0,""Value"":""[LastName]""},{""OutputType"":""CompanyName"",""Passes"":0,""Value"":""[CompanyName]""},{""OutputType"":""Email"",""Passes"":0,""Value"":""[Email]""},{""OutputType"":""PhoneBusiness"",""Passes"":0,""Value"":""[PhoneBusiness]""},{""OutputType"":""PhoneBusiness2"",""Passes"":0,""Value"":""[PhoneBusiness2]""},{""OutputType"":""PhoneMobile"",""Passes"":0,""Value"":""[PhoneMobile]""},{""OutputType"":""PhoneMobile2"",""Passes"":0,""Value"":""[PhoneMobile2]""},{""OutputType"":""CustomValue"",""Passes"":0,""Value"":""[CustomValue]""},{""OutputType"":""ContactUrl"",""Passes"":0,""Value"":""[ContactUrl]""},{""OutputType"":""EntityId"",""Passes"":0,""Value"":""[ContactID]""},{""OutputType"":""EntityType"",""Passes"":0,""Value"":""Contacts""}],""AllowEmpty"":false}}]}"
447,2025-06-25 13:12:24.726872+00,0,90.39.195.115,0,18,"6400 CHARLAT, Jerome",logisync,,"{""AppName"":""test"",""RoutingType"":""DialCode"",""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Get;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:`{MyCall.Status}`\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}\r\n"",""Number"":""logisync"",""GroupId"":"""",""Trunk"":""""}"
460,2025-06-25 14:36:43.948625+00,0,90.39.195.115,0,18,"6400 CHARLAT, Jerome",logisync,,"{""AppName"":"""",""RoutingType"":""Trunk"",""ScriptCode"":"""",""Number"":""logisync"",""GroupId"":"""",""Trunk"":""10000""}"
461,2025-06-25 14:36:43.958688+00,0,90.39.195.115,1,30,"6400 CHARLAT, Jerome",Alphalink,"{""RUNSCRIPT"":""""}","{""RUNSCRIPT"":""logisync""}"
462,2025-06-25 14:37:03.920534+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":"""",""Trunk"":""10000""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:{MyCall.Status}\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}"",""Trunk"":""""}"
463,2025-06-25 14:37:51.441451+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:{MyCall.Status}\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:{MyCall.Status}\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}"
464,2025-06-25 14:38:12.638644+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:{MyCall.Status}\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:{MyCall.Status}\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}"
383,2025-05-14 14:48:27.94915+00,0,91.216.43.225,18,1001,4999 Koesio,Web Client,,
333,2024-11-19 15:51:39.289412+00,0,91.216.43.225,1,7,"2000 Guiraud, Nicolas","2001 Vermeille, Alice","{""Blfs"":""<PhoneDevice Version=\""1\""><BLFS><BLF BLFNo=\""1\"" BLFType=\""Line\"" BLFTypeID=\""6\"" ID=\""-1\"">0</BLF></BLFS></PhoneDevice>"",""Groups"":[{""GroupId"":21,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""system_admins""},""CanDelete"":true},{""GroupId"":24,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Avant-vente"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""system_admins""},""CanDelete"":true}]}","{""Blfs"":""<PhoneDevice><BLFS><BLF ID=\""-1\"" BLFNo=\""1\"" BLFType=\""Line\"" BLFTypeID=\""6\""/></BLFS></PhoneDevice>"",""Groups"":[{""GroupId"":21,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""group_owners""},""CanDelete"":true},{""GroupId"":24,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Avant-vente"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""group_owners""},""CanDelete"":true}]}"
334,2024-11-19 15:51:50.17023+00,0,91.216.43.225,1,7,"2000 Guiraud, Nicolas","2001 Vermeille, Alice","{""PrimaryGroupId"":21}","{""PrimaryGroupId"":24}"
335,2024-11-19 15:52:07.846532+00,0,91.216.43.225,1,17,"2000 Guiraud, Nicolas",Groupement test,"{""Groups"":[]}","{""Groups"":[{""GroupId"":21,""Number"":""8006"",""MemberName"":""Groupement test"",""Name"":""Demo"",""Type"":""RingGroup"",""Tags"":[],""Rights"":{""RoleName"":""system""},""CanDelete"":false}]}"
336,2024-11-19 15:52:16.157988+00,0,91.216.43.225,1,17,"2000 Guiraud, Nicolas",Groupement test,"{""Members"":[{""Number"":""2000"",""Name"":""Guiraud, Nicolas""},{""Number"":""2001"",""Name"":""Vermeille, Alice""},{""Number"":""2004"",""Name"":""Faure-Emieux, Mickael""},{""Number"":""2003"",""Name"":""Blavette, Alexandre""}]}","{""Members"":[{""Number"":""2001"",""Name"":""Vermeille, Alice""},{""Number"":""2004"",""Name"":""Faure-Emieux, Mickael""},{""Number"":""2003"",""Name"":""Blavette, Alexandre""}]}"
337,2024-11-19 15:53:06.655067+00,0,91.216.43.225,18,1001,"2001 Vermeille, Alice",Web Client,,
338,2024-11-19 15:54:17.629877+00,0,91.216.43.225,18,1001,"2001 Vermeille, Alice",Web Client,,
339,2024-11-19 15:55:34.439808+00,0,91.216.43.225,18,1001,"2000 Guiraud, Nicolas",Web Client,,
340,2024-11-19 15:56:04.932024+00,0,91.216.43.225,1,7,"2000 Guiraud, Nicolas","2001 Vermeille, Alice","{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T42S"",""MacAddress"":""805E0C46ADD6"",""Interface"":""demo.agilucs.fr"",""ProvisioningLinkLocal"":""http://demo.agilucs.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMU"",""PCMA"",""G722"",""G729""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""English"",""TimeZone"":"""",""ProvisionType"":""SBC"",""SbcName"":""liUsxHbldZmU"",""RemoteSpmHost"":""172.26.26.201"",""RemoteSpmPort"":0,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW MMM DD (Mon Jan 15)"",""TimeFormat"":""24-hour clock"",""PowerLed"":""Both (Voicemail and Missed calls)"",""Backlight"":""15 seconds"",""ScreenSaver"":""15 seconds"",""Secret"":"""",""IsSBC"":false,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".dob""],""LogoDescription"":""Format .dob, width 132, height 64, bitdepth 1"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}","{""Phones"":[]}"
341,2024-11-19 15:56:43.79948+00,0,91.216.43.225,18,1001,"2001 Vermeille, Alice",Web Client,,
342,2024-11-19 15:57:25.164076+00,0,91.216.43.225,1,7,"2001 Vermeille, Alice","2001 Vermeille, Alice","{""PrimaryGroupId"":24,""Groups"":[{""GroupId"":21,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""group_owners""},""CanDelete"":true},{""GroupId"":24,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Avant-vente"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""group_owners""},""CanDelete"":true}]}","{""PrimaryGroupId"":21,""Groups"":[{""GroupId"":24,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Avant-vente"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""group_owners""},""CanDelete"":true},{""GroupId"":21,""Number"":""2001"",""MemberName"":""Vermeille, Alice"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""group_owners""},""CanDelete"":true}]}"
343,2024-11-19 16:09:00.747309+00,0,91.216.43.225,18,1001,"2000 Guiraud, Nicolas",Web Client,,
344,2024-11-19 16:09:37.880988+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 4 Release,,
345,2024-11-25 13:43:16.412387+00,0,91.165.186.164,18,1001,4999 Koesio,Web Client,,
346,2024-11-25 16:27:31.980773+00,0,90.39.141.105,18,1001,4999 Koesio,Web Client,,
347,2024-12-03 16:46:03.612501+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 4 Release Candidate,,
348,2024-12-04 15:27:35.937+00,0,91.216.43.225,18,1001,4999 Koesio,Web Client,,
374,2025-04-01 13:49:55.392999+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 6 Alpha,,
384,2025-05-14 14:50:24.199157+00,0,91.216.43.225,18,1001,4999 Koesio,Web Client,,
388,2025-05-20 09:44:17.084142+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 6 RC2,,
405,2025-06-16 07:40:29.310535+00,0,91.165.186.164,18,1001,4999 Koesio,Web Client,,
448,2025-06-25 13:19:49.313085+00,0,90.39.195.115,2,18,"6400 CHARLAT, Jerome",logisync,"{""CompilationSucceeded"":true,""InvalidScript"":false,""CompilationResult"":"":[39..53)H: (3,0)-(3,14): Hidden CS8019: Directive using non nécessaire.\nusing MimeKit;\n^^^^^^^^^^^^^^\n:[108..126)H: (6,0)-(6,18): Hidden CS8019: Directive using non nécessaire.\nusing System.Linq;\n^^^^^^^^^^^^^^^^^^\n:[199..222)H: (9,0)-(9,23): Hidden CS8019: Directive using non nécessaire.\nusing System.Threading;\n^^^^^^^^^^^^^^^^^^^^^^^"",""CompilationLastSuccess"":""2025-06-25T15:12:48.8616059+02:00"",""Name"":""test"",""IsRegistered"":true,""RoutingType"":""DialCode"",""Number"":""logisync"",""Groups"":[]}",
449,2025-06-25 13:20:27.085667+00,0,90.39.195.115,0,18,"6400 CHARLAT, Jerome",logisync,,"{""AppName"":""test"",""RoutingType"":""DialCode"",""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:`{MyCall.Status}`\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}\r\n"",""Number"":""logisync"",""GroupId"":"""",""Trunk"":""""}"
465,2025-06-25 14:39:41.352655+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:{MyCall.Status}\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         logFormatter.Info(\""📞 Incoming call detected!\"");\r\n         logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n         logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:{MyCall.Status}\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}"
349,2024-12-11 09:02:44.359729+00,0,91.216.43.225,1,7,"2000 Guiraud, Nicolas","2000 Guiraud, Nicolas","{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T54W"",""MacAddress"":""249AD861A25C"",""Interface"":""demo.agilucs.fr"",""ProvisioningLinkLocal"":""http://demo.agilucs.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMU"",""PCMA"",""G722"",""G729""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""French"",""TimeZone"":"""",""ProvisionType"":""SBC"",""SbcName"":""0FDatk47e3Vs"",""RemoteSpmHost"":""192.168.250.103"",""RemoteSpmPort"":0,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW MMM DD (Mon Jan 15)"",""TimeFormat"":""24-hour clock"",""PowerLed"":""Both (Voicemail and Missed calls)"",""Backlight"":""15 seconds"",""ScreenSaver"":""15 seconds"",""Secret"":"""",""IsSBC"":true,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}","{""Phones"":[]}"
350,2024-12-11 09:04:09.244233+00,0,91.216.43.225,1,7,"2000 Guiraud, Nicolas","2000 Guiraud, Nicolas","{""Phones"":[]}","{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T44U"",""MacAddress"":""001565AD3582"",""Interface"":""labo.koesio-telecom.fr"",""ProvisioningLinkLocal"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMU"",""PCMA"",""G722"",""G729""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""English"",""TimeZone"":"""",""ProvisionType"":""SBC"",""SbcName"":""liUsxHbldZmU"",""RemoteSpmHost"":"""",""RemoteSpmPort"":0,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW MMM DD (Mon Jan 15)"",""TimeFormat"":""24-hour clock"",""Secret"":"""",""IsSBC"":false,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 320, height 240, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}"
351,2024-12-11 09:04:16.093401+00,0,91.216.43.225,1,7,"2000 Guiraud, Nicolas","2000 Guiraud, Nicolas","{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T44U"",""MacAddress"":""001565AD3582"",""Interface"":""labo.koesio-telecom.fr"",""ProvisioningLinkLocal"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMU"",""PCMA"",""G722"",""G729""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""English"",""TimeZone"":"""",""ProvisionType"":""SBC"",""SbcName"":""liUsxHbldZmU"",""RemoteSpmHost"":"""",""RemoteSpmPort"":0,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW MMM DD (Mon Jan 15)"",""TimeFormat"":""24-hour clock"",""Secret"":"""",""IsSBC"":false,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 320, height 240, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}","{""Phones"":[]}"
352,2024-12-19 16:39:51.694414+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 5 Alpha,,
353,2025-01-03 09:30:10.738224+00,0,91.216.43.225,18,1001,4999 Koesio,Web Client,,
354,2025-01-06 09:55:01.325092+00,0,91.165.186.164,18,1001,4999 Koesio,Web Client,,
355,2025-01-06 09:55:45.216155+00,0,91.165.186.164,1,1009,4999 Koesio,ENABLE_CHAT_LOGS,"{""value"":""0""}","{""value"":""1""}"
356,2025-01-10 13:57:26.583573+00,0,86.248.54.130,18,1001,"2000 Guiraud, Nicolas",Web Client,,
357,2025-01-15 14:14:41.836511+00,0,86.248.54.130,16,7,"2000 Guiraud, Nicolas",All Users,,
358,2025-01-15 14:14:42.427844+00,0,86.248.54.130,16,7,"2000 Guiraud, Nicolas",All Users,,
364,2025-02-25 09:37:43.643885+00,0,91.216.43.225,0,18,"2000 Guiraud, Nicolas",sdaentrantes,,"{""AppName"":"""",""RoutingType"":""Trunk"",""ScriptCode"":""#nullable disable\r\nusing CallFlow;\r\nusing System.Threading.Tasks;\r\nusing TCX.Configuration;\r\nusing TCX.PBXAPI;\r\nusing System.IO;\r\nusing System.Text.RegularExpressions;\r\n\r\nnamespace dummy\r\n{\r\n    public class InterceptInboundCall : ScriptBase<InterceptInboundCall>\r\n    {\r\n        //Specify here your csv filename with callerid list that needs to be redirected\r\n        const string csvFileName = \""contacts.csv\"";\r\n\r\n        const string destination = \""Extension.114.\"";\r\n\r\n        public override async Task<bool> StartAsync()\r\n        {\r\n            if (MyCall.Caller.DN is ExternalLine externalLine && MyCall.IsInbound)\r\n            {\r\n                var DIDNumber = MyCall.Caller.CalledNumber;\r\n                var CallerID = MyCall.Caller.CallerID;\r\n                var matched = false;\r\n\r\n                var cfdAppName = MyCall.CallHandler.MyDN.GetPropertyValue(\""CF_APP_NAME\"");\r\n                string cfdPath;\r\n\r\n                if (!string.IsNullOrEmpty(cfdAppName))\r\n                    cfdPath = cfdAppName.Split('.')[0];\r\n                else\r\n                    cfdPath = MyCall.CallHandler.MyDN.Number.Split('.')[0];\r\n\r\n                var csvPath = System.IO.Path.Combine(MyCall.PS.GetParameterValue(\""IVRPROMPTPATH\""), \""Callflows\"", cfdPath, csvFileName);\r\n\r\n                var lines = File.ReadLines(csvPath);\r\n\r\n                foreach (var line in lines)\r\n                {\r\n                    var matchCollection = new Regex(\""([\\\\+]?[0-9]+)\"").Matches(line);\r\n                    if (matched == true)\r\n                    {\r\n                        break;\r\n                    }\r\n                    foreach (Match match in matchCollection)\r\n                    {\r\n                        if (CallerID == match.Value)\r\n                        {\r\n                            matched = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                }\r\n\r\n                var has_valid_destination = DestinationStruct.TryParse(destination, out var destination_struct);\r\n                if (has_valid_destination && matched)\r\n                {\r\n                    var result = await MyCall.RouteToAsync(destination_struct);\r\n                    MyCall.Info($\""{CallerID}->{DIDNumber} has been redirected to {destination} ({result}\"");\r\n                    return true;\r\n                }\r\n\r\n            }\r\n            return false;\r\n        }\r\n    }\r\n}\r\n"",""Number"":""sdaentrantes"",""GroupId"":"""",""Trunk"":""10000""}"
365,2025-02-25 09:37:43.679287+00,0,91.216.43.225,1,30,"2000 Guiraud, Nicolas",Alphalink,"{""RUNSCRIPT"":""""}","{""RUNSCRIPT"":""sdaentrantes""}"
366,2025-02-25 09:38:04.053368+00,0,91.216.43.225,1,30,"2000 Guiraud, Nicolas",Alphalink,"{""RUNSCRIPT"":""sdaentrantes""}","{""RUNSCRIPT"":""""}"
367,2025-02-25 09:38:04.353462+00,0,91.216.43.225,2,18,"2000 Guiraud, Nicolas",sdaentrantes,,
375,2025-04-02 14:03:41.190034+00,0,91.165.186.164,1,7,4999 Koesio,4999 Koesio,"{""MyPhoneShowRecordings"":false,""MyPhoneAllowDeleteRecordings"":false,""Groups"":[{""GroupId"":21,""Number"":""4999"",""MemberName"":""Koesio"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""system_owners""},""CanDelete"":false,""TranscriptionMode"":""Voicemail""}]}","{""MyPhoneShowRecordings"":true,""MyPhoneAllowDeleteRecordings"":true,""Groups"":[{""GroupId"":21,""Number"":""4999"",""MemberName"":""Koesio"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""system_owners"",""ShowMyPresence"":false},""CanDelete"":false,""TranscriptionMode"":""Voicemail""}]}"
406,2025-06-16 07:41:04.900662+00,0,91.165.186.164,6,1016,4999 Koesio,,,
450,2025-06-25 13:53:53.156501+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:`{MyCall.Status}`\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}\r\n""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:`{MyCall.Status}`\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}"
451,2025-06-25 13:54:18.136371+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:`{MyCall.Status}`\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing MimeKit;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Threading.Tasks.Dataflow;\r\nusing System.Threading.Tasks;\r\nusing System.Threading;\r\nusing System;\r\nusing TCX.Configuration;\r\n\r\nnamespace test\r\n{\r\n   public class Main : ScriptBase<Main>, ICallflow, ICallflowProcessor\r\n   {\r\n      private bool executionStarted;\r\n      private bool executionFinished;\r\n      private bool disconnectFlowPending;\r\n\r\n      private BufferBlock<AbsEvent> eventBuffer;\r\n\r\n      private int currentComponentIndex;\r\n      private List<AbsComponent> mainFlowComponentList;\r\n      private List<AbsComponent> disconnectFlowComponentList;\r\n      private List<AbsComponent> errorFlowComponentList;\r\n      private List<AbsComponent> currentFlowComponentList;\r\n\r\n      private LogFormatter logFormatter;\r\n      private TimerManager timerManager;\r\n      private Dictionary<string, Variable> variableMap;\r\n      private TempWavFileManager tempWavFileManager;\r\n      private PromptQueue promptQueue;\r\n      private OnlineServices onlineServices;\r\n      private OfficeHoursManager officeHoursManager;\r\n\r\n      private CfdAppScope scope;\r\n\r\n      private void DisconnectCallAndExitCallflow()\r\n      {\r\n         if (currentFlowComponentList == disconnectFlowComponentList)\r\n            logFormatter.Trace(\""Callflow finished...\"");\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Callflow finished, disconnecting call...\"");\r\n            MyCall.Terminate();\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteErrorFlow()\r\n      {\r\n         if (currentFlowComponentList == errorFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during error handler flow, exiting callflow...\"");\r\n            DisconnectCallAndExitCallflow();\r\n         }\r\n         else if (currentFlowComponentList == disconnectFlowComponentList)\r\n         {\r\n            logFormatter.Trace(\""Error during disconnect handler flow, exiting callflow...\"");\r\n            executionFinished = true;\r\n         }\r\n         else\r\n         {\r\n            currentFlowComponentList = errorFlowComponentList;\r\n            currentComponentIndex = 0;\r\n            if (errorFlowComponentList.Count > 0)\r\n            {\r\n               logFormatter.Trace(\""Start executing error handler flow...\"");\r\n               await ProcessStart();\r\n            }\r\n            else\r\n            {\r\n               logFormatter.Trace(\""Error handler flow is empty...\"");\r\n               DisconnectCallAndExitCallflow();\r\n            }\r\n         }\r\n      }\r\n\r\n      private async Task ExecuteDisconnectFlow()\r\n      {\r\n         currentFlowComponentList = disconnectFlowComponentList;\r\n         currentComponentIndex = 0;\r\n         disconnectFlowPending = false;\r\n         if (disconnectFlowComponentList.Count > 0)\r\n         {\r\n            logFormatter.Trace(\""Start executing disconnect handler flow...\"");\r\n            await ProcessStart();\r\n         }\r\n         else\r\n         {\r\n            logFormatter.Trace(\""Disconnect handler flow is empty...\"");\r\n            executionFinished = true;\r\n         }\r\n      }\r\n\r\n      private EventResults CheckEventResult(EventResults eventResult)\r\n      {\r\n         if (eventResult == EventResults.MoveToNextComponent && ++currentComponentIndex == currentFlowComponentList.Count)\r\n         {\r\n            DisconnectCallAndExitCallflow();\r\n            return EventResults.Exit;\r\n         }\r\n         else if (eventResult == EventResults.Exit)\r\n            DisconnectCallAndExitCallflow();\r\n\r\n         return eventResult;\r\n      }\r\n\r\n      private void InitializeVariables(string callID)\r\n      {\r\n         // Call variables\r\n         variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n         variableMap[\""session.callid\""] = new Variable(callID);\r\n         variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n         variableMap[\""session.did\""] = new Variable(MyCall.Caller.CalledNumber);\r\n         variableMap[\""session.audioFolder\""] = new Variable(Path.Combine(RecordingManager.Instance.AudioFolder, promptQueue.ProjectAudioFolder));\r\n         variableMap[\""session.transferingExtension\""] = new Variable(MyCall.ReferredByDN?.Number ?? string.Empty);\r\n         variableMap[\""session.forwardingExtension\""] = new Variable(MyCall.OnBehalfOf?.Number ?? string.Empty);\r\n\r\n         // Standard variables\r\n         variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n         variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n         variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n         variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n         variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n         variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n         variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n         variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n         variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n         variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n         variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n         variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n         variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n\r\n         // User variables\r\n         variableMap[\""project$.api_url\""] = new Variable(\""https://agtruck.fr/transport/api/external/phone-call-event/3cx\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\""\"");\r\n            variableMap[\""RecordResult.NothingRecorded\""] = new Variable(RecordComponent.RecordResults.NothingRecorded);\r\n            variableMap[\""RecordResult.StopDigit\""] = new Variable(RecordComponent.RecordResults.StopDigit);\r\n            variableMap[\""RecordResult.Completed\""] = new Variable(RecordComponent.RecordResults.Completed);\r\n            variableMap[\""MenuResult.Timeout\""] = new Variable(MenuComponent.MenuResults.Timeout);\r\n            variableMap[\""MenuResult.InvalidOption\""] = new Variable(MenuComponent.MenuResults.InvalidOption);\r\n            variableMap[\""MenuResult.ValidOption\""] = new Variable(MenuComponent.MenuResults.ValidOption);\r\n            variableMap[\""UserInputResult.Timeout\""] = new Variable(UserInputComponent.UserInputResults.Timeout);\r\n            variableMap[\""UserInputResult.InvalidDigits\""] = new Variable(UserInputComponent.UserInputResults.InvalidDigits);\r\n            variableMap[\""UserInputResult.ValidDigits\""] = new Variable(UserInputComponent.UserInputResults.ValidDigits);\r\n            variableMap[\""VoiceInputResult.Timeout\""] = new Variable(VoiceInputComponent.VoiceInputResults.Timeout);\r\n            variableMap[\""VoiceInputResult.InvalidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.InvalidInput);\r\n            variableMap[\""VoiceInputResult.ValidInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidInput);\r\n            variableMap[\""VoiceInputResult.ValidDtmfInput\""] = new Variable(VoiceInputComponent.VoiceInputResults.ValidDtmfInput);\r\n            \r\n        }\r\n\r\n      private void InitializeComponents(ICallflow callflow, ICall myCall, string logHeader)\r\n      {\r\n         scope = CfdModule.Instance.CreateScope(callflow, myCall, logHeader);\r\n\r\n         {\r\n            VariableAssignmentComponent AssignVariable1 = scope.CreateComponent<VariableAssignmentComponent>(\""AssignVariable1\"");\r\n            AssignVariable1.VariableName = \""callflow$.call_payload\"";\r\n            AssignVariable1.VariableValueHandler = () => { return \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""; };\r\n            mainFlowComponentList.Add(AssignVariable1);\r\n            WebInteractionComponent HttpRequest1 = scope.CreateComponent<WebInteractionComponent>(\""HttpRequest1\"");\r\n            HttpRequest1.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            HttpRequest1.ContentType = \""application/json\"";\r\n            HttpRequest1.Timeout = 30000;\r\n            HttpRequest1.UriHandler = () => { return Convert.ToString(CFDFunctions.CONCATENATE(Convert.ToString(variableMap[\""project$.api_url\""].Value),Convert.ToString(\""?key=\""),Convert.ToString(variableMap[\""project$.api_key\""].Value))); };\r\n            HttpRequest1.ContentHandler = () => { return Convert.ToString(variableMap[\""callflow$.call_payload\""].Value); };\r\n            mainFlowComponentList.Add(HttpRequest1);\r\n            }\r\n            {\r\n            }\r\n            {\r\n            }\r\n            \r\n\r\n         // Add a final DisconnectCall component to the main and error handler flows, in order to complete pending prompt playbacks...\r\n         DisconnectCallComponent mainAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""mainAutoAddedFinalDisconnectCall\"");\r\n         DisconnectCallComponent errorHandlerAutoAddedFinalDisconnectCall = scope.CreateComponent<DisconnectCallComponent>(\""errorHandlerAutoAddedFinalDisconnectCall\"");\r\n         mainFlowComponentList.Add(mainAutoAddedFinalDisconnectCall);\r\n         errorFlowComponentList.Add(errorHandlerAutoAddedFinalDisconnectCall);\r\n      }\r\n\r\n      public Main()\r\n      {\r\n         this.executionStarted = false;\r\n         this.executionFinished = false;\r\n         this.disconnectFlowPending = false;\r\n\r\n         this.eventBuffer = new BufferBlock<AbsEvent>();\r\n\r\n         this.currentComponentIndex = 0;\r\n         this.mainFlowComponentList = new List<AbsComponent>();\r\n         this.disconnectFlowComponentList = new List<AbsComponent>();\r\n         this.errorFlowComponentList = new List<AbsComponent>();\r\n         this.currentFlowComponentList = mainFlowComponentList;\r\n\r\n         this.timerManager = new TimerManager();\r\n         this.timerManager.OnTimeout += (state) => eventBuffer.Post(new TimeoutEvent(state));\r\n         this.variableMap = new Dictionary<string, Variable>();\r\n\r\n         AbsTextToSpeechEngine textToSpeechEngine = null;\r\n         AbsSpeechToTextEngine speechToTextEngine = null;\r\n         this.onlineServices = new OnlineServices(textToSpeechEngine, speechToTextEngine);\r\n      }\r\n\r\n      public override void Start()\r\n      {\r\n         string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n         string logHeader = $\""test - CallID {callID}\"";\r\n         this.logFormatter = new LogFormatter(MyCall, logHeader, \""Callflow\"");\r\n         this.promptQueue = new PromptQueue(this, MyCall, \""test\"", logHeader);\r\n         this.tempWavFileManager = new TempWavFileManager(logFormatter);\r\n         this.timerManager.CallStarted();\r\n         this.officeHoursManager = new OfficeHoursManager(MyCall);\r\n\r\n         logFormatter.Info($\""ConnectionStatus:`{MyCall.Status}`\"");\r\n\r\n         if (MyCall.Status == ConnectionStatus.Ringing)\r\n            MyCall.AssureMedia().ContinueWith(_ => StartInternal(logHeader, callID));\r\n         else\r\n            StartInternal(logHeader, callID);\r\n      }\r\n\r\n      private void StartInternal(string logHeader, string callID)\r\n      {\r\n         logFormatter.Trace(\""SetBackgroundAudio to false\"");\r\n         MyCall.SetBackgroundAudio(false, new string[] { });\r\n\r\n         logFormatter.Trace(\""Initialize components\"");\r\n         InitializeComponents(this, MyCall, logHeader);\r\n         logFormatter.Trace(\""Initialize variables\"");\r\n         InitializeVariables(callID);\r\n\r\n         MyCall.OnTerminated += () => eventBuffer.Post(new CallTerminatedEvent());\r\n         MyCall.OnDTMFInput += x => eventBuffer.Post(new DTMFReceivedEvent(x));\r\n\r\n         logFormatter.Trace(\""Start executing main flow...\"");\r\n         eventBuffer.Post(new StartEvent());\r\n         Task.Run(() => EventProcessingLoop());\r\n\r\n         \r\n      }\r\n\r\n      public void PostStartEvent()\r\n      {\r\n         eventBuffer.Post(new StartEvent());\r\n      }\r\n\r\n      public void PostDTMFReceivedEvent(char digit)\r\n      {\r\n         eventBuffer.Post(new DTMFReceivedEvent(digit));\r\n      }\r\n\r\n      public void PostPromptPlayedEvent()\r\n      {\r\n         eventBuffer.Post(new PromptPlayedEvent());\r\n      }\r\n\r\n      public void PostTransferFailedEvent()\r\n      {\r\n         eventBuffer.Post(new TransferFailedEvent());\r\n      }\r\n\r\n      public void PostMakeCallResultEvent(bool result)\r\n      {\r\n         eventBuffer.Post(new MakeCallResultEvent(result));\r\n      }\r\n\r\n      public void PostCallTerminatedEvent()\r\n      {\r\n         eventBuffer.Post(new CallTerminatedEvent());\r\n      }\r\n\r\n      public void PostTimeoutEvent(object state)\r\n      {\r\n         eventBuffer.Post(new TimeoutEvent(state));\r\n      }\r\n\r\n      private async Task EventProcessingLoop()\r\n      {\r\n         executionStarted = true;\r\n         while (!executionFinished)\r\n         {\r\n            AbsEvent evt = await eventBuffer.ReceiveAsync();\r\n            await evt?.ProcessEvent(this);\r\n         }\r\n\r\n         if (scope != null) scope.Dispose();\r\n      }\r\n\r\n      public async Task ProcessStart()\r\n      {\r\n         try\r\n         {\r\n            EventResults eventResult;\r\n            do\r\n            {\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""Start executing component '\"" + currentComponent.Name + \""'\"");\r\n               eventResult = await currentComponent.Start(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n            }\r\n            while (CheckEventResult(eventResult) == EventResults.MoveToNextComponent);\r\n\r\n            if (eventResult == EventResults.Exit) executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessDTMFReceived(char digit)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnDTMFReceived for component '\"" + currentComponent.Name + \""' - Digit: '\"" + digit + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnDTMFReceived(timerManager, variableMap, tempWavFileManager, promptQueue, digit));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessPromptPlayed()\r\n      {\r\n         try\r\n         {\r\n            promptQueue.NotifyPlayFinished();\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnPromptPlayed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnPromptPlayed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTransferFailed()\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTransferFailed for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTransferFailed(timerManager, variableMap, tempWavFileManager, promptQueue));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessMakeCallResult(bool result)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnMakeCallResult for component '\"" + currentComponent.Name + \""' - Result: '\"" + result + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnMakeCallResult(timerManager, variableMap, tempWavFileManager, promptQueue, result));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessCallTerminated()\r\n      {\r\n         try\r\n         {\r\n            if (executionStarted)\r\n            {\r\n               // First notify the call termination to the current component\r\n               AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n               logFormatter.Trace(\""OnCallTerminated for component '\"" + currentComponent.Name + \""'\"");\r\n\r\n               // Don't wrap around CheckEventResult, because the call has been already disconnected, \r\n               // and the following action to execute depends on the returned value.\r\n               EventResults eventResult = await currentComponent.OnCallTerminated(timerManager, variableMap, tempWavFileManager, promptQueue);\r\n               if (eventResult == EventResults.MoveToNextComponent)\r\n               {\r\n                  // Next, if the current component has completed its job, execute the disconnect flow\r\n                  await ExecuteDisconnectFlow();\r\n               }\r\n               else if (eventResult == EventResults.Wait)\r\n               {\r\n                  // If the user component needs more events, wait for it to finish, and signal here that we need to execute\r\n                  // the disconnect handler flow of the callflow next...\r\n                  disconnectFlowPending = true;\r\n               }\r\n               else if (eventResult == EventResults.Exit)\r\n                  executionFinished = true;\r\n            }\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n         finally\r\n         {\r\n            // Finally, delete temporary files\r\n            tempWavFileManager.DeleteFilesAndFolders();\r\n         }\r\n      }\r\n\r\n      public async Task ProcessTimeout(object state)\r\n      {\r\n         try\r\n         {\r\n            AbsComponent currentComponent = currentFlowComponentList[currentComponentIndex];\r\n            logFormatter.Trace(\""OnTimeout for component '\"" + currentComponent.Name + \""'\"");\r\n            EventResults eventResult = CheckEventResult(await currentComponent.OnTimeout(timerManager, variableMap, tempWavFileManager, promptQueue, state));\r\n            if (eventResult == EventResults.MoveToNextComponent)\r\n            {\r\n               if (disconnectFlowPending)\r\n                  await ExecuteDisconnectFlow();\r\n               else\r\n                  await ProcessStart();\r\n            }\r\n            else if (eventResult == EventResults.Exit)\r\n               executionFinished = true;\r\n         }\r\n         catch (Exception exc)\r\n         {\r\n            logFormatter.Error(\""Error executing last component: \"" + exc.ToString());\r\n            await ExecuteErrorFlow();\r\n         }\r\n      }\r\n\r\n\r\n      \r\n   }\r\n}""}"
475,2025-06-25 15:40:12.13068+00,0,90.39.195.115,2,88,"6400 CHARLAT, Jerome",LogiSync,,
490,2025-07-06 14:56:13.024983+00,0,91.216.43.225,18,1001,4999 Koesio,Web Client,,
472,2025-06-25 15:03:01.960616+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\nusing TCX.PBXAPI;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            \r\n            var activeConn = MyCall as IActiveConnection;\r\n            string did = activeConn?.GetSipHeader(\""To\"") ?? \""Unknown\"";\r\n\r\n            // Extract numéro entre 'sip:' et '@'\r\n            if (did.StartsWith(\""sip:\"", StringComparison.OrdinalIgnoreCase))\r\n            {\r\n                int at = did.IndexOf('@');\r\n                did = at > 4 ? did.Substring(4, at - 4) : did.Substring(4);\r\n            }\r\n\r\n            variableMap[\""session.dnis\""] = new Variable(did);\r\n            \r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
473,2025-06-25 15:13:00.301661+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\nusing TCX.PBXAPI;\r\nusing TCX.Configuration;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            \r\n            IActiveConnection active = MyCall as IActiveConnection;\r\nstring toHeader = active?.GetSipHeader(\""To\"") ?? \""\"";\r\n\r\nstring did = \""Unknown\"";\r\nif (!string.IsNullOrEmpty(toHeader))\r\n{\r\n    int start = toHeader.IndexOf(\""sip:\"", StringComparison.OrdinalIgnoreCase);\r\n    int at = toHeader.IndexOf('@');\r\n    if (start >= 0 && at > start)\r\n        did = toHeader.Substring(start + 4, at - (start + 4));\r\n}\r\n\r\nvariableMap[\""session.dnis\""] = new Variable(did);\r\n            \r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
474,2025-06-25 15:25:22.293406+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\nusing TCX.PBXAPI;\r\nusing TCX.Configuration;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            \r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            \r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
477,2025-06-25 15:49:55.96572+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\nusing TCX.PBXAPI;\r\nusing TCX.Configuration;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            \r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            \r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\nusing TCX.PBXAPI;\r\nusing TCX.Configuration;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            \r\n            string did = MyCall.Caller.GetVariable(\""SIP_To_User\"");\r\n            if (string.IsNullOrEmpty(did))\r\n        {\r\n        did = MyCall.DN.Number; // fallback\r\n    }\r\n    variableMap[\""session.dnis\""] = new Variable(did);\r\n            \r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
478,2025-06-25 15:51:02.194814+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\nusing TCX.PBXAPI;\r\nusing TCX.Configuration;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            \r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            \r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\nusing TCX.PBXAPI;\r\nusing TCX.Configuration;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            \r\n            string did = MyCall.GetProperty(\""SIP-To-User\"") as string;\r\nif (string.IsNullOrEmpty(did))\r\n{\r\n    did = MyCall.GetProperty(\""CalledNumber\"") as string;\r\n}\r\nif (string.IsNullOrEmpty(did))\r\n{\r\n    did = MyCall.DN.Number;\r\n}\r\nvariableMap[\""session.dnis\""] = new Variable(did);\r\n            \r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
480,2025-06-25 16:15:30.122987+00,0,90.39.195.115,2,18,"6400 CHARLAT, Jerome",logisync,"{""CompilationSucceeded"":false,""InvalidScript"":false,""CompilationResult"":"":[1216..1227)E: (36,32)-(36,43): Error CS1061: 'ICall' ne contient pas de définition pour 'GetProperty' et aucune méthode d'extension accessible 'GetProperty' acceptant un premier argument de type 'ICall' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?)\n            string did = MyCall.GetProperty(\""SIP-To-User\"") as string;\n                                ^^^^^^^^^^^\n:[1307..1318)E: (39,17)-(39,28): Error CS1061: 'ICall' ne contient pas de définition pour 'GetProperty' et aucune méthode d'extension accessible 'GetProperty' acceptant un premier argument de type 'ICall' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?)\n    did = MyCall.GetProperty(\""CalledNumber\"") as string;\n                 ^^^^^^^^^^^"",""CompilationLastSuccess"":""2025-06-25T17:25:22.4767961+02:00"",""Name"":"""",""IsRegistered"":true,""RoutingType"":""Trunk"",""Trunk"":{""Gateway"":{""Name"":""Alphalink"",""Type"":""Provider""},""IPRestriction"":""Any"",""TransportRestriction"":""Any"",""Groups"":[]},""Number"":""logisync"",""Groups"":[]}",
483,2025-06-25 16:23:47.901662+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":"""",""Trunk"":""10000""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/your-url\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(this, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}"",""Trunk"":""""}"
485,2025-06-25 16:25:06.993539+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/your-url\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2?key=your-api-key\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
484,2025-06-25 16:24:47.104392+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/your-url\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(this, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/your-url\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
486,2025-06-25 16:26:19.763497+00,0,90.39.195.115,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.DN.Number);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2?key=your-api-key\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.Caller.CalledNumber);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2?key=your-api-key\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
487,2025-06-25 19:24:19.412575+00,0,176.142.161.14,1,18,"6400 CHARLAT, Jerome",logisync,"{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.Caller.CalledNumber);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://webhook.site/91f7ff95-5cad-45e8-b188-140332144bf2?key=your-api-key\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""your-api-key\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}","{""ScriptCode"":""using CallFlow.CFD;\r\nusing CallFlow;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System;\r\n\r\nnamespace logisync\r\n{\r\n    public class Main : ScriptBase<Main>\r\n    {\r\n        private LogFormatter logFormatter;\r\n        private Dictionary<string, Variable> variableMap;\r\n\r\n        public override void Start()\r\n        {\r\n            string callID = MyCall?.Caller[\""chid\""] ?? \""Unknown\"";\r\n            string logHeader = $\""logisync - CallID {callID}\"";\r\n            this.logFormatter = new LogFormatter(MyCall, logHeader, \""CallProcessing\"");\r\n            this.variableMap = new Dictionary<string, Variable>();\r\n\r\n            logFormatter.Info(\""📞 Incoming call detected!\"");\r\n            logFormatter.Info(\""Caller: \"" + MyCall.Caller.CallerID);\r\n            logFormatter.Info(\""Called: \"" + MyCall.DN.Number);\r\n\r\n            InitializeVariables(callID);\r\n            InitializeComponents();\r\n        }\r\n\r\n        private void InitializeVariables(string callID)\r\n        {\r\n            variableMap[\""session.ani\""] = new Variable(MyCall.Caller.CallerID);\r\n            variableMap[\""session.callid\""] = new Variable(callID);\r\n            variableMap[\""session.dnis\""] = new Variable(MyCall.Caller.CalledNumber);\r\n            variableMap[\""project$.api_url\""] = new Variable(\""https://agtruck.fr/transport/api/external/phone-call-event/3cx\"");\r\n            variableMap[\""project$.api_key\""] = new Variable(\""7c42fd33-8b9a-4e4b-8c9d-00596373c5ce\"");\r\n            variableMap[\""callflow$.call_payload\""] = new Variable(\r\n                \""{\\\""entryPhoneNumber\\\"":\\\""{session.ani}\\\"",\\\""recipientPhoneNumber\\\"":\\\""{session.dnis}\\\"",\\\""callId\\\"":\\\""{session.callid}\\\""}\""\r\n            );\r\n        }\r\n\r\n        private void InitializeComponents()\r\n        {\r\n            CfdAppScope scope = CfdModule.Instance.CreateScope(null, MyCall, \""logisync\"");\r\n\r\n            // Variable assignment\r\n            VariableAssignmentComponent assignPayload = scope.CreateComponent<VariableAssignmentComponent>(\""AssignPayload\"");\r\n            assignPayload.VariableName = \""callflow$.call_payload\"";\r\n            assignPayload.VariableValueHandler = () =>\r\n            {\r\n                return \""{\\\""entryPhoneNumber\\\"":\\\""\"" + variableMap[\""session.ani\""].Value +\r\n                       \""\\\"",\\\""recipientPhoneNumber\\\"":\\\""\"" + variableMap[\""session.dnis\""].Value +\r\n                       \""\\\"",\\\""callId\\\"":\\\""\"" + variableMap[\""session.callid\""].Value + \""\\\""}\"";\r\n            };\r\n            assignPayload.Start(null, variableMap, null, null).Wait();\r\n\r\n            // HTTP request\r\n            WebInteractionComponent httpRequest = scope.CreateComponent<WebInteractionComponent>(\""SendToAPI\"");\r\n            httpRequest.HttpMethod = System.Net.Http.HttpMethod.Post;\r\n            httpRequest.ContentType = \""application/json\"";\r\n            httpRequest.Timeout = 30000;\r\n            httpRequest.UriHandler = () =>\r\n            {\r\n                return variableMap[\""project$.api_url\""].Value + \""?key=\"" + variableMap[\""project$.api_key\""].Value;\r\n            };\r\n            httpRequest.ContentHandler = () =>\r\n            {\r\n                return (string)variableMap[\""callflow$.call_payload\""].Value;\r\n            };\r\n            httpRequest.Start(null, variableMap, null, null).Wait();\r\n\r\n            scope.Dispose();\r\n        }\r\n    }\r\n}""}"
489,2025-06-30 08:14:12.880654+00,0,91.165.186.164,2,7,4999 Koesio,"6400 CHARLAT, Jerome","{""Enable2FA"":false,""Require2FA"":false,""MyPhoneShowRecordings"":false,""MyPhoneAllowDeleteRecordings"":false,""MyPhoneHideForwardings"":false,""MyPhonePush"":true,""RecordCalls"":false,""AllowOwnRecordings"":false,""RecordExternalCallsOnly"":false,""RecordEmailNotify"":false,""PrimaryGroupId"":21,""FirstName"":""Jerome"",""LastName"":""CHARLAT"",""DisplayName"":""CHARLAT, Jerome"",""EmailAddress"":""jcharlat@jnjdevelopment.fr"",""Mobile"":"""",""WebMeetingFriendlyName"":""jeromecharlat"",""WebMeetingApproveParticipants"":false,""SendEmailMissedCalls"":false,""VMEnabled"":true,""VMEmailOptions"":""None"",""VMPIN"":""551219"",""VMDisablePinAuth"":true,""VMPlayCallerID"":false,""VMPlayMsgDateTime"":""None"",""Greetings"":[],""ContactImage"":"""",""IsRegistered"":true,""CurrentProfileName"":""Available"",""QueueStatus"":""LoggedIn"",""AuthID"":""kO7Oo78PgM"",""DeskphonePassword"":""****"",""AuthPassword"":""****"",""OutboundCallerID"":"""",""ForwardingProfiles"":[{""Name"":""Custom 2"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Away"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Out of office"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Custom 1"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":false,""DisableRingGroupCalls"":false,""NoAnswerTimeout"":20,""AvailableRoute"":{""NoAnswerAllCalls"":true,""BusyAllCalls"":true,""NotRegisteredAllCalls"":true,""NoAnswerInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NoAnswerExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""BusyInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""BusyExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Available"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":false,""DisableRingGroupCalls"":false,""NoAnswerTimeout"":20,""AvailableRoute"":{""NoAnswerAllCalls"":true,""BusyAllCalls"":true,""NotRegisteredAllCalls"":true,""NoAnswerInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NoAnswerExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""BusyInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""BusyExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredInternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredExternal"":{""External"":"""",""Number"":""6400"",""To"":""VoiceMail"",""Name"":""CHARLAT, Jerome"",""Type"":""Extension"",""Tags"":[]}}}],""ForwardingExceptions"":[],""Blfs"":""<PhoneDevice><BLFS/></PhoneDevice>"",""OfficeHoursProps"":[],""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""BreakTime"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Phones"":[],""Internal"":false,""Enabled"":false,""PromptSet"":""0D767FEA-10A3-4ba4-8A57-FE74BDABE4E5"",""HideInPhonebook"":false,""Tags"":[],""PinProtected"":false,""PinProtectTimeout"":60,""CallScreening"":false,""AllowLanOnly"":true,""SIPID"":"""",""MS365SignInEnabled"":true,""MS365ContactsEnabled"":true,""MS365CalendarEnabled"":true,""MS365TeamsEnabled"":true,""GoogleSignInEnabled"":true,""GoogleContactsEnabled"":true,""GoogleCalendarEnabled"":true,""EnableHotdesking"":false,""SRTPMode"":""SRTPDisabled"",""PbxDeliversAudio"":false,""EmergencyLocationId"":"""",""EmergencyAdditionalInfo"":"""",""CallUsRequirement"":""Both"",""CallUsEnablePhone"":false,""CallUsEnableChat"":true,""CallUsEnableVideo"":false,""ClickToCallId"":""jeromecharlat"",""Number"":""6400"",""Groups"":[{""GroupId"":21,""Number"":""6400"",""MemberName"":""CHARLAT, Jerome"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""system_owners""},""CanDelete"":true,""TranscriptionMode"":""Voicemail""}],""TranscriptionMode"":""Inherit""}",
492,2025-07-06 14:58:28.026038+00,0,91.216.43.225,1,30,4999 Koesio,Alphalink,"{""RoutingRules"":[{""CustomData"":"""",""Data"":""0987660607"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660601"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660604"",""RuleName"":""Grenoble"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660605"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660606"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660609"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660608"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8006"",""To"":""RingGroup"",""Name"":""Groupement test"",""Type"":""RingGroup"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8006"",""To"":""RingGroup"",""Name"":""Groupement test"",""Type"":""RingGroup"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660602"",""RuleName"":""Nicolas"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""Queue"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""None"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660603"",""RuleName"":""Nico"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660600"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":"""",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""ForwardAll"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}}]}","{""RoutingRules"":[{""CustomData"":"""",""Data"":""0987660607"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660601"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660604"",""RuleName"":""Grenoble"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660605"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660606"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660609"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660608"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8005"",""To"":""Queue"",""Name"":""TEST Standard"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8005"",""To"":""Queue"",""Name"":""TEST Standard"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""8005"",""To"":""Queue"",""Name"":""TEST Standard"",""Type"":""Queue"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660602"",""RuleName"":""Nicolas"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""Queue"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""None"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660603"",""RuleName"":""Nico"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660600"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":"""",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""ForwardAll"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}}]}"
493,2025-07-06 14:59:43.171228+00,0,91.216.43.225,1,14,4999 Koesio,Demo,"{""Hours"":{""Periods"":[{""DayOfWeek"":""Monday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":12,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":432000000000}},{""DayOfWeek"":""Monday"",""Start"":{""Hours"":14,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":504000000000},""Stop"":{""Hours"":17,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":612000000000}},{""DayOfWeek"":""Tuesday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":12,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":432000000000}},{""DayOfWeek"":""Tuesday"",""Start"":{""Hours"":14,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":504000000000},""Stop"":{""Hours"":18,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":648000000000}},{""DayOfWeek"":""Wednesday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":12,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":432000000000}},{""DayOfWeek"":""Wednesday"",""Start"":{""Hours"":14,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":504000000000},""Stop"":{""Hours"":19,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":684000000000}},{""DayOfWeek"":""Thursday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":12,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":432000000000}},{""DayOfWeek"":""Thursday"",""Start"":{""Hours"":14,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":504000000000},""Stop"":{""Hours"":17,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":612000000000}},{""DayOfWeek"":""Friday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":12,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":432000000000}},{""DayOfWeek"":""Friday"",""Start"":{""Hours"":14,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":504000000000},""Stop"":{""Hours"":17,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":612000000000}},{""DayOfWeek"":""Saturday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":17,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":612000000000}}]}}","{""Hours"":{""Periods"":[{""DayOfWeek"":""Monday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":12,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":432000000000}},{""DayOfWeek"":""Monday"",""Start"":{""Hours"":14,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":504000000000},""Stop"":{""Hours"":17,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":612000000000}},{""DayOfWeek"":""Tuesday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":12,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":432000000000}},{""DayOfWeek"":""Tuesday"",""Start"":{""Hours"":14,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":504000000000},""Stop"":{""Hours"":18,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":648000000000}},{""DayOfWeek"":""Wednesday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":12,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":432000000000}},{""DayOfWeek"":""Wednesday"",""Start"":{""Hours"":14,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":504000000000},""Stop"":{""Hours"":19,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":684000000000}},{""DayOfWeek"":""Thursday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":12,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":432000000000}},{""DayOfWeek"":""Thursday"",""Start"":{""Hours"":14,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":504000000000},""Stop"":{""Hours"":17,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":612000000000}},{""DayOfWeek"":""Friday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":12,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":432000000000}},{""DayOfWeek"":""Friday"",""Start"":{""Hours"":14,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":504000000000},""Stop"":{""Hours"":17,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":612000000000}},{""DayOfWeek"":""Saturday"",""Start"":{""Hours"":8,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":288000000000},""Stop"":{""Hours"":17,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":612000000000}},{""DayOfWeek"":""Sunday"",""Start"":{""Hours"":9,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":324000000000},""Stop"":{""Hours"":18,""Minutes"":0,""Seconds"":0,""Milliseconds"":0,""Ticks"":648000000000}}]}}"
494,2025-07-06 15:00:42.008867+00,0,91.216.43.225,1,30,4999 Koesio,Alphalink,"{""RoutingRules"":[{""CustomData"":"""",""Data"":""0987660607"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660601"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660604"",""RuleName"":""Grenoble"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660605"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660606"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660609"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660608"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8005"",""To"":""Queue"",""Name"":""TEST Standard"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8005"",""To"":""Queue"",""Name"":""TEST Standard"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""8005"",""To"":""Queue"",""Name"":""TEST Standard"",""Type"":""Queue"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660602"",""RuleName"":""Nicolas"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""Queue"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""None"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660603"",""RuleName"":""Nico"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660600"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":"""",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""ForwardAll"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}}]}","{""RoutingRules"":[{""CustomData"":"""",""Data"":""0987660607"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""8008"",""To"":""IVR"",""Name"":""SVI_NICOLAS"",""Type"":""IVR"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660601"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8001"",""To"":""Queue"",""Name"":""Lyon Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660604"",""RuleName"":""Grenoble"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8003"",""To"":""Queue"",""Name"":""Grenoble Agence"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660605"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8004"",""To"":""Queue"",""Name"":""Commerce"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660606"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2005"",""To"":""Extension"",""Name"":""Pepin, Jimmy"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660609"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4444"",""To"":""RoutePoint"",""Name"":""lecturecsv.Main"",""Type"":""RoutePoint"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660608"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""4999"",""To"":""Extension"",""Name"":""Koesio"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""4999"",""To"":""Extension"",""Name"":""Koesio"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":""4999"",""To"":""Extension"",""Name"":""Koesio"",""Type"":""Extension"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660602"",""RuleName"":""Nicolas"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""Queue"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""8000"",""To"":""None"",""Name"":""Valence Accueil"",""Type"":""Queue"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660603"",""RuleName"":""Nico"",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""2000"",""To"":""Extension"",""Name"":""Guiraud, Nicolas"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":""0987660600"",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""BasedOnDID"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""Extension"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}},{""CustomData"":"""",""Data"":"""",""RuleName"":"""",""CallType"":""AllCalls"",""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Condition"":""ForwardAll"",""AlterDestinationDuringOutOfOfficeHours"":true,""AlterDestinationDuringHolidays"":false,""OfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""OutOfOfficeHoursDestination"":{""External"":"""",""Number"":""6000"",""To"":""Extension"",""Name"":""Test"",""Type"":""Extension"",""Tags"":[]},""HolidaysDestination"":{""External"":"""",""Number"":"""",""To"":""None"",""Tags"":[]},""TrunkDN"":{""Type"":""ExternalLine"",""Hidden"":false,""Name"":""Alphalink"",""Number"":""10000"",""MemberOf"":[],""Tags"":[]}}]}"
496,2025-08-20 13:10:37.716482+00,0,91.216.43.27,0,7,4999 Koesio,"1002 casque, test",,"{""Enable2FA"":false,""Require2FA"":false,""MyPhoneShowRecordings"":false,""MyPhoneAllowDeleteRecordings"":false,""MyPhoneHideForwardings"":false,""MyPhonePush"":true,""RecordCalls"":false,""AllowOwnRecordings"":false,""RecordExternalCallsOnly"":false,""RecordEmailNotify"":false,""PrimaryGroupId"":21,""FirstName"":""test"",""LastName"":""casque"",""DisplayName"":""casque, test"",""EmailAddress"":""test@test.fr"",""Mobile"":"""",""WebMeetingFriendlyName"":""testcasque"",""WebMeetingApproveParticipants"":false,""SendEmailMissedCalls"":true,""VMEnabled"":true,""VMEmailOptions"":""Notification"",""VMPIN"":""179899"",""VMDisablePinAuth"":false,""VMPlayCallerID"":false,""VMPlayMsgDateTime"":""None"",""Greetings"":[],""ContactImage"":"""",""IsRegistered"":false,""CurrentProfileName"":""Available"",""QueueStatus"":""LoggedIn"",""AuthID"":""KiZLQ8PGxR"",""DeskphonePassword"":""****"",""AuthPassword"":""****"",""OutboundCallerID"":"""",""ForwardingProfiles"":[{""Name"":""Custom 2"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Away"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Out of office"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Custom 1"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":false,""DisableRingGroupCalls"":false,""NoAnswerTimeout"":20,""AvailableRoute"":{""NoAnswerAllCalls"":true,""BusyAllCalls"":true,""NotRegisteredAllCalls"":true,""NoAnswerInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NoAnswerExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""BusyInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""BusyExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Available"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":false,""DisableRingGroupCalls"":false,""NoAnswerTimeout"":20,""AvailableRoute"":{""NoAnswerAllCalls"":true,""BusyAllCalls"":true,""NotRegisteredAllCalls"":true,""NoAnswerInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NoAnswerExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""BusyInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""BusyExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]}}}],""ForwardingExceptions"":[],""Blfs"":""<PhoneDevice><BLFS/></PhoneDevice>"",""OfficeHoursProps"":[],""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""BreakTime"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Phones"":[],""Internal"":false,""Enabled"":true,""PromptSet"":""0D767FEA-10A3-4ba4-8A57-FE74BDABE4E5"",""HideInPhonebook"":false,""Tags"":[],""PinProtected"":false,""PinProtectTimeout"":60,""CallScreening"":false,""AllowLanOnly"":true,""SIPID"":"""",""MS365SignInEnabled"":true,""MS365ContactsEnabled"":true,""MS365CalendarEnabled"":true,""MS365TeamsEnabled"":true,""GoogleSignInEnabled"":true,""GoogleContactsEnabled"":true,""GoogleCalendarEnabled"":true,""EnableHotdesking"":false,""SRTPMode"":""SRTPDisabled"",""PbxDeliversAudio"":false,""EmergencyLocationId"":"""",""EmergencyAdditionalInfo"":"""",""CallUsRequirement"":""Both"",""CallUsEnablePhone"":false,""CallUsEnableChat"":true,""CallUsEnableVideo"":false,""ClickToCallId"":""testcasque"",""Number"":""1002"",""Groups"":[{""GroupId"":21,""Number"":""1002"",""MemberName"":""casque, test"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""users""},""CanDelete"":true,""TranscriptionMode"":""Voicemail""}],""TranscriptionMode"":""Inherit""}"
497,2025-08-20 13:11:18.926952+00,0,91.216.43.27,1,7,4999 Koesio,"1002 casque, test","{""Phones"":[]}","{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T54W"",""MacAddress"":""44DBD2CFC7D0"",""Interface"":""labo.koesio-telecom.fr"",""ProvisioningLinkLocal"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMU"",""PCMA"",""G722"",""G729""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""English"",""TimeZone"":"""",""ProvisionType"":""SBC"",""SbcName"":""g9IVVZtKkpoA"",""RemoteSpmHost"":"""",""RemoteSpmPort"":0,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW MMM DD (Mon Jan 15)"",""TimeFormat"":""24-hour clock"",""Secret"":"""",""IsSBC"":true,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}"
498,2025-08-20 15:35:41.519559+00,0,91.216.43.27,1,7,4999 Koesio,"1002 casque, test","{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T54W"",""MacAddress"":""44DBD2CFC7D0"",""Interface"":""labo.koesio-telecom.fr"",""ProvisioningLinkLocal"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMU"",""PCMA"",""G722"",""G729""],""Firmware"":""T5XW-96.87.0.16.rom"",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""English"",""TimeZone"":"""",""ProvisionType"":""SBC"",""SbcName"":""g9IVVZtKkpoA"",""RemoteSpmHost"":"""",""RemoteSpmPort"":0,""XferType"":""BXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""WWW MMM DD (Mon Jan 15)"",""TimeFormat"":""24-hour clock"",""Secret"":"""",""IsSBC"":true,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}","{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T54W"",""MacAddress"":""44DBD2CFC7D0"",""Interface"":""labo.koesio-telecom.fr"",""ProvisioningLinkLocal"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMA"",""G729"",""G722"",""PCMU""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""French"",""TimeZone"":""GMT+1 France(Paris)"",""ProvisionType"":""SBC"",""SbcName"":""g9IVVZtKkpoA"",""RemoteSpmHost"":"""",""RemoteSpmPort"":0,""XferType"":""AttXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""DD MMM YYYY (15 Jan 2017)"",""TimeFormat"":""24-hour clock"",""PowerLed"":""Both (Voicemail and Missed calls)"",""Backlight"":""15 seconds"",""ScreenSaver"":""15 seconds"",""Secret"":"""",""IsSBC"":true,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}"
499,2025-08-20 16:09:35.699606+00,0,91.216.43.27,1,7,4999 Koesio,"1002 casque, test","{""Phones"":[{""TemplateName"":""yealinkT4x.ph.xml"",""Name"":""Yealink T54W"",""MacAddress"":""44DBD2CFC7D0"",""Interface"":""labo.koesio-telecom.fr"",""ProvisioningLinkLocal"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""ProvisioningLinkExt"":""https://labo.koesio-telecom.fr/provisioning/0tcm2mdi3n76"",""Settings"":{""Codecs"":[""PCMA"",""G729"",""G722"",""PCMU""],""Firmware"":"""",""FirmwareLang"":"""",""LocalRTPPortEnd"":0,""LocalRTPPortStart"":0,""LocalSipPort"":0,""OwnBlfs"":false,""PhoneLanguage"":""French"",""TimeZone"":""GMT+1 France(Paris)"",""ProvisionType"":""SBC"",""SbcName"":""g9IVVZtKkpoA"",""RemoteSpmHost"":"""",""RemoteSpmPort"":0,""XferType"":""AttXfer"",""RingTone"":""Ring 1"",""QueueRingTone"":""Ring 6"",""DateFormat"":""DD MMM YYYY (15 Jan 2017)"",""TimeFormat"":""24-hour clock"",""PowerLed"":""Both (Voicemail and Missed calls)"",""Backlight"":""15 seconds"",""ScreenSaver"":""15 seconds"",""Secret"":"""",""IsSBC"":true,""CustomLogo"":""3CXLogo"",""LogoFileExtensionAllowed"":["".png""],""LogoDescription"":""Format .png, width 480, height 272, bitdepth 24"",""IsLogoCustomizable"":true,""LlDpInfo"":{""Configurable"":true,""Value"":true},""VlanInfos"":[{""Configurable"":true,""Type"":""Wan"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7},{""Configurable"":true,""Type"":""Pc"",""Enabled"":false,""VlanId"":1,""VlanIdMin"":1,""VlanIdMax"":4094,""PriorityConfigurable"":true,""Priority"":0,""PriorityMin"":0,""PriorityMax"":7}],""AllowCustomQueueRingtones"":false,""CustomQueueRingtones"":[]}}]}","{""Phones"":[]}"
500,2025-08-20 16:10:25.62076+00,0,91.216.43.27,2,7,4999 Koesio,"1002 casque, test","{""Enable2FA"":false,""Require2FA"":false,""MyPhoneShowRecordings"":false,""MyPhoneAllowDeleteRecordings"":false,""MyPhoneHideForwardings"":false,""MyPhonePush"":true,""RecordCalls"":false,""AllowOwnRecordings"":false,""RecordExternalCallsOnly"":false,""RecordEmailNotify"":false,""PrimaryGroupId"":21,""FirstName"":""test"",""LastName"":""casque"",""DisplayName"":""casque, test"",""EmailAddress"":""test@test.fr"",""Mobile"":"""",""WebMeetingFriendlyName"":""testcasque"",""WebMeetingApproveParticipants"":false,""SendEmailMissedCalls"":true,""VMEnabled"":true,""VMEmailOptions"":""Notification"",""VMPIN"":""179899"",""VMDisablePinAuth"":false,""VMPlayCallerID"":false,""VMPlayMsgDateTime"":""None"",""Greetings"":[],""ContactImage"":"""",""IsRegistered"":true,""CurrentProfileName"":""Available"",""QueueStatus"":""LoggedIn"",""AuthID"":""KiZLQ8PGxR"",""DeskphonePassword"":""****"",""AuthPassword"":""****"",""OutboundCallerID"":"""",""ForwardingProfiles"":[{""Name"":""Away"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Out of office"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Custom 1"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":false,""DisableRingGroupCalls"":false,""NoAnswerTimeout"":20,""AvailableRoute"":{""NoAnswerAllCalls"":true,""BusyAllCalls"":true,""NotRegisteredAllCalls"":true,""NoAnswerInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NoAnswerExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""BusyInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""BusyExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Available"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":false,""DisableRingGroupCalls"":false,""NoAnswerTimeout"":20,""AvailableRoute"":{""NoAnswerAllCalls"":true,""BusyAllCalls"":true,""NotRegisteredAllCalls"":true,""NoAnswerInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NoAnswerExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""BusyInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""BusyExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredInternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""NotRegisteredExternal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]}}},{""Name"":""Custom 2"",""CustomName"":"""",""CustomMessage"":"""",""BlockPushCalls"":false,""RingMyMobile"":false,""AcceptMultipleCalls"":false,""OfficeHoursAutoQueueLogOut"":true,""DisableRingGroupCalls"":true,""NoAnswerTimeout"":20,""AwayRoute"":{""AllHoursInternal"":true,""AllHoursExternal"":true,""External"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]},""Internal"":{""External"":"""",""Number"":""1002"",""To"":""VoiceMail"",""Name"":""casque, test"",""Type"":""Extension"",""Tags"":[]}}}],""ForwardingExceptions"":[],""Blfs"":""<PhoneDevice><BLFS/></PhoneDevice>"",""OfficeHoursProps"":[],""Hours"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""BreakTime"":{""Type"":""OfficeHours"",""IgnoreHolidays"":false,""Periods"":[]},""Phones"":[],""Internal"":false,""Enabled"":true,""PromptSet"":""0D767FEA-10A3-4ba4-8A57-FE74BDABE4E5"",""HideInPhonebook"":false,""Tags"":[],""PinProtected"":false,""PinProtectTimeout"":60,""CallScreening"":false,""AllowLanOnly"":true,""SIPID"":"""",""MS365SignInEnabled"":true,""MS365ContactsEnabled"":true,""MS365CalendarEnabled"":true,""MS365TeamsEnabled"":true,""GoogleSignInEnabled"":true,""GoogleContactsEnabled"":true,""GoogleCalendarEnabled"":true,""EnableHotdesking"":false,""SRTPMode"":""SRTPDisabled"",""PbxDeliversAudio"":false,""EmergencyLocationId"":"""",""EmergencyAdditionalInfo"":"""",""CallUsRequirement"":""Both"",""CallUsEnablePhone"":false,""CallUsEnableChat"":true,""CallUsEnableVideo"":false,""ClickToCallId"":""testcasque"",""Number"":""1002"",""Groups"":[{""GroupId"":21,""Number"":""1002"",""MemberName"":""casque, test"",""Name"":""Demo"",""Type"":""Extension"",""Tags"":[],""Rights"":{""RoleName"":""users""},""CanDelete"":true,""TranscriptionMode"":""Voicemail""}],""TranscriptionMode"":""Inherit""}",
507,2025-09-01 15:26:02.237507+00,0,91.165.186.164,1,95,4999 Koesio,,"{""AccessRestricted"":false,""IpWhitelist"":[]}","{""AccessRestricted"":true,""IpWhitelist"":[""91.165.186.164""]}"
509,2025-09-01 16:52:41.254693+00,0,91.165.186.164,1,95,4999 Koesio,,"{""AccessRestricted"":true}","{""AccessRestricted"":false}"
510,2025-09-01 19:17:28.222668+00,0,91.165.186.164,1,95,4999 Koesio,,"{""AccessRestricted"":false}","{""AccessRestricted"":true}"
511,2025-09-01 19:18:19.828732+00,0,92.184.112.165,18,1001,4999 Koesio,Web Client,,
512,2025-09-01 19:21:27.641221+00,0,91.216.43.225,1,95,4999 Koesio,,"{""AccessRestricted"":true}","{""AccessRestricted"":false}"
513,2025-09-01 19:22:18.983537+00,0,91.216.43.225,1,95,4999 Koesio,,"{""AccessRestricted"":false}","{""AccessRestricted"":true}"
514,2025-09-01 19:22:21.777528+00,0,91.216.43.225,18,1001,4999 Koesio,Web Client,,
515,2025-09-02 07:44:23.142339+00,0,91.165.186.164,1,95,4999 Koesio,,"{""AccessRestricted"":true}","{""AccessRestricted"":false}"
516,2025-09-12 09:39:36.02723+00,0,91.165.186.164,18,1001,4999 Koesio,Web Client,,
517,2025-10-03 12:39:39.822896+00,0,91.216.43.225,1,86,"2000 Guiraud, Nicolas",New 20.0 Update 7 RC2,,
