unit ami_client_interfaces; {< Interfaces used to represent AMI Clients.} { This file is part of AMIProxyPal. AMIProxyPal is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Foobar. If not, see . } {$mode objfpc}{$H+} interface uses Classes, SysUtils; type // ----------------------------------------------------------------- // Interfaces // ----------------------------------------------------------------- {: Represents an interface for clients connecting to the proxy and consuming AMI services through the proxy. } IAMIClient = interface ['{4EC684C8-F5DE-4532-92AB-9CF9F34079F6}'] {: Add packets coming from Asterisk to client. } procedure AddOutgoing(APacket: string); {: Get incoming requests from the client. Should be called repeatedly until it returns null string (''). } function GetIncoming: string; {: Locks via TCriticalSection to lock the object } procedure Lock; {: Unlocks via TCriticalSection } procedure Unlock; {: Checks if client will accept event type.} function AcceptEvent(const APacket, AEvent, APerms: string): boolean; {: Returns and removes from the list, an out going record.} function GetOutgoing:string; {: Adds an incoming message to the list. } procedure AddIncoming(APacket: string); end; implementation end.