{"id":16675923,"url":"https://github.com/willitscale/oai-mitel-inter-tel-library","last_synced_at":"2025-07-08T20:12:57.293Z","repository":{"id":72985816,"uuid":"43208567","full_name":"willitscale/OAI-Mitel-Inter-Tel-Library","owner":"willitscale","description":"C# Mitel 5000 CP and Inter-Tel Axxess OAI Toolkit Integration","archived":false,"fork":false,"pushed_at":"2019-10-24T01:55:35.000Z","size":146,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-19T21:49:49.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willitscale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-26T14:33:17.000Z","updated_at":"2022-09-18T10:28:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"667f7b18-24dd-444c-bfb7-08674e1b0c56","html_url":"https://github.com/willitscale/OAI-Mitel-Inter-Tel-Library","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2FOAI-Mitel-Inter-Tel-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2FOAI-Mitel-Inter-Tel-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2FOAI-Mitel-Inter-Tel-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2FOAI-Mitel-Inter-Tel-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willitscale","download_url":"https://codeload.github.com/willitscale/OAI-Mitel-Inter-Tel-Library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243339545,"owners_count":20275710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T13:08:26.394Z","updated_at":"2025-03-13T04:27:49.807Z","avatar_url":"https://github.com/willitscale.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"## C# Mitel 5000 CP and Inter-Tel Axxess OAI Toolkit Integration\n\n### Requirements\n\nI designed this around the \"System OAI Toolkit Specifications Manual – Issue 10.20, January 2011\", with this in mind some modifications may be required for previous revisions of the API which I may implement in due course.\n\n### Basic instantiation using sockets\n\nThe following example will simply show you how to get the library to connect to your PBX or \n\n#### Prerequisites\n```csharp\nusing OAI.Sequences;\nusing OAI.Configuration;\nusing OAI.Threads;\n```\n\n#### Your initialisation\n```csharp\n// Define your config setup \"HOST\", PORT, \"APPLICATION NAME\", \u003cOPTIONAL\u003e\"PASSWORD\", \u003cOPTIONAL\u003e TYPE\nOAIConfig config = new OAIConfig(\"my-pbx-or-gateway.example.com\", 12345, \"OAI Desktop Client\");\n\n// Specify the connection sequence you want to use when connecting\nOAIGlobalSequence sequence = new OAIGlobalSequence();\n\n// Initialise the OAI socket with your configuration and sequence\nOAISocket socket = new OAISocket(config,sequence);\n\n// Create a thread for the socket\nThread OAIClient = new Thread(new ThreadStart(socket.Run));\n\n// Start the socket thread\nOAIClient.Start();\n```\n### Real Time Event Listening and additional threading \n\nIf you would like to use real time event notification then you will need additional threads to listen for the desired events.\n\nWhen utilizing additional threads for the OAI library be mindful that the application needs to be in a \"ACTIVE\" state which can be derived from the [OAI.Activity.OAIRunning](https://github.com/willitscale/OAI-Mitel-Inter-Tel-Library/blob/master/OAI/Activity/OAIRunning.cs).Active attribute.\n\n#### Sample Call Event Listening Thread\n```csharp\nusing System;\nusing System.Threading;\n\nusing OAI.Activity;\nusing OAI.Queues.Changes;\nusing OAI.Queues;\n\nnamespace OAI.Threads\n{\n    public class OAICallListener\n    {\n        public event EventHandler\u003cstring\u003e CallEvent;\n\n        public void Run()\n        {\n            for (;;)\n            {\n                // Application has stopped so kill the thread!\n                if (!OAIRunning.Active)\n                {\n                    return;\n                }\n\n                if (!OAICallChangeQueue.Relay().Available())\n                {\n                    Thread.Sleep(100);\n                    continue;\n                }\n\n                string evt = OAICallChangeQueue.Relay().Line;\n\n                CallEvent(this, evt);\n            }\n        }\n    }\n}\n\n```\n\n#### Sample Agent Event Listening Thread\n\n```csharp\nusing System;\nusing System.Threading;\n\nusing OAI.Activity;\nusing OAI.Queues.Changes;\n\nnamespace OAI.Threads\n{\n    public class OAIAgentListener\n    {\n        public event EventHandler\u003cstring\u003e AgentEvent;\n\n        public void Run()\n        {\n            for (;;)\n            {\n                // Application has stopped so kill the thread!\n                if (!OAIRunning.Active)\n                {\n                    return;\n                }\n\n                if (!OAIAgentChangeQueue.Relay().Available())\n                {\n                    Thread.Sleep(100);\n                    continue;\n                }\n\n                string evt = OAIAgentChangeQueue.Relay().Line;\n\n                AgentEvent(this, evt);\n            }\n        }\n    }\n}\n```\n\n#### Sample Device Event Listening Thread\n\n```csharp\nusing System;\nusing System.Threading;\n\nusing OAI.Activity;\nusing OAI.Queues.Changes;\n\nnamespace OAI.Threads\n{\n    public class OAIDeviceListener\n    {\n        public event EventHandler\u003cstring\u003e DeviceEvent;\n\n        public void Run()\n        {\n            for (;;)\n            {\n                // Application has stopped so kill the thread!\n                if (!OAIRunning.Active)\n                {\n                    return;\n                }\n\n                if (!OAIDeviceChangeQueue.Relay().Available())\n                {\n                    Thread.Sleep(100);\n                    continue;\n                }\n\n                string evt = OAIDeviceChangeQueue.Relay().Line;\n\n                DeviceEvent(this, evt);\n            }\n        }\n    }\n}\n```\n\n\n#### Sample Debugging Event Listening Thread\n\nYou can access the debugging of the library which gets written to the Debugger Queue. As a side note this debugger queue is never flushed and I will in the future add a debug flag to the config to prevent this causing a memory leak for applications that never poll the queue.\n\n```csharp\nusing System;\nusing System.Threading;\n\nusing OAI.Activity;\nusing OAI.Queues;\n\nnamespace OAI.Threads\n{\n    public class DebuggerQueueThread\n    {\n        public event EventHandler\u003cstring\u003e DebuggingEvent;\n\n        public void Run()\n        {\n            for (;;)\n            {\n                // Application has stopped so kill the thread!\n                if (!OAIRunning.Active)\n                {\n                    return;\n                }\n\n                if (!OAIDebuggerQueue.Relay().Available())\n                {\n                    Thread.Sleep(100);\n                    continue;\n                }\n\n                string evt = OAIDebuggerQueue.Relay().Line;\n\n                DebuggingEvent(this, evt);\n            }\n        }\n    }\n}\n```\n\n### Accessing the data captured by the library\n\nData can be accessed directly by the controllers, although it is advised that you do not modify this data outside of the library as it may have unpredicted results which could cause instability in the application and phone system.\n\n#### Controller\n\nThe controllers are what should be used by external applications in finding out information about calls, agents, devices, nodes and trunks. You are able to access a singular instance or all of the models bound to the controller in one of two ways.\n\n##### Controller Peeking\n\nController peaking is a way of accessing a model inside the controller without removing the model from the controller.\n\n###### Sample Prerequisites\n\n```csharp\nusing OAI.Controllers;\nusing OAI.Models;\n```\n\n###### Sample Peeking\n\n```csharp\nString AgentID = \"5555\";\nOAIAgentModel agent = OAIAgentsController.Relay().Peek(AgentID);\n\nif (null == agent)\n{\n  // Agent doesn't exist in the controller\n}\nelse\n{\n  // Agent exists within the controller\n}\n```\n\n##### Controller Popping\n\nController popping is a way of accessing a model inside the controller and then sequentially removing that model from the controller on call.\n\n##### Controller Pushing\n\nYou should avoid pushing to the controller at all costs as this may cause unexpected results.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillitscale%2Foai-mitel-inter-tel-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillitscale%2Foai-mitel-inter-tel-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillitscale%2Foai-mitel-inter-tel-library/lists"}