<> <> <> <> <> DIRECTORY Atom USING [ PropList ], BasicTime USING [ GMT ], GVBasics USING [ Password ], LarkFeepRpcControl USING [ InterfaceRecord ], MBQueue USING [ Queue ], RefID USING [ ID ], Rope USING [ ROPE ], RPC USING [ EncryptionKey ], ThParty USING [ PartyInfo ], Thrush USING [ ActionReport, ConversationID, ConvEventBody, InterfaceSpec, NB, nullConvID, nullID, PartyID, Reason, ROPE, SHHH, SmartsID, StateInConv ], ThSmartsRpcControl ; FinchSmarts: CEDAR DEFINITIONS = { <> <<>> ConversationID: TYPE = Thrush.ConversationID; nullConvID: ConversationID = Thrush.nullConvID; NB: TYPE = Thrush.NB; nullID: RefID.ID = Thrush.nullID; WhoOriginated: TYPE = { unknown, us, them }; PartyID: TYPE = Thrush.PartyID; Reason: TYPE = Thrush.Reason; ROPE: TYPE = Thrush.ROPE; SHHH: TYPE = Thrush.SHHH; FinchInfo: TYPE = REF FinchInfoBody; FinchInfoBody: TYPE = MONITORED RECORD [ smartsID: Thrush.SmartsID_nullID, partyID: PartyID _ nullID, shh: SHHH_NIL, conversations: LIST OF ConvDesc -- of ConvDescs --, requests: MBQueue.Queue, stateChange: CONDITION, myName: ThSmartsRpcControl.InterfaceName _ [], myRName: ROPE _ NIL, myPassword: RPC.EncryptionKey _ NULL, prevThrushInstance: ROPE _ NIL ]; ConvDesc: TYPE = REF ConvDescBody; ConvDescBody: TYPE = RECORD [ <> situation: Thrush.ConvEventBody, -- amalgam of useful info from last-reported event <> whoOriginated: WhoOriginated _ unknown, ultimateState: Thrush.StateInConv _ idle, -- last state reached (except for idle) <> <> <> <> startTime: BasicTime.GMT_NULL, subject: ROPE_NIL, numParties: NAT_0, numActive: NAT_0, numIdle: NAT_0, partyInfo: ThParty.PartyInfo_NIL, -- Complete description as of some recent time feepInterfaceSpec: Thrush.InterfaceSpec, feepInterface: LarkFeepRpcControl.InterfaceRecord, <> clientData: REF _ NIL, <> << but this field is cleared once the ConvDesc leaves the FinchInfo.conversations Queue.>> props: Atom.PropList _ NIL, << Client-specific values, such as information used by synthesizer code and such. Placed here as a convenience for such services.>> originatorRecorded: BOOL_FALSE, reportComplete: BOOL_FALSE ]; <<>> <> InitFinchSmarts: PROC [thrushInstance: Thrush.ROPE_NIL]; FinchIsRunning: PROC RETURNS [finchIsRunning: BOOL]; UninitFinchSmarts: PROC[problem: Thrush.ROPE_NIL, nb: Thrush.NB_NIL]; <> PlaceCall: PROC [ convID: Thrush.ConversationID _ nullConvID, rName: ROPE_NIL, number: ROPE_NIL, useNumber: BOOL_FALSE]; <> <> <> <> <> <> <> AnswerCall: PROC[convID: ConversationID]; DisconnectCall: PROC[ convID: ConversationID, reason: Thrush.Reason_$terminating, comment: ROPE_NIL, newState: Thrush.StateInConv _ $idle -- Can also be $failed, to terminate with fast-busy and such. ]; <> <> Feep: PROC[convID: ConversationID, feepString: ROPE]; GetNumbersForRName: PROC[rName: ROPE] RETURNS [fullRName: ROPE, number: ROPE, homeNumber: ROPE]; <> <<>> VoiceConnect: PROC [ serviceName: ROPE, convID: Thrush.ConversationID _ nullConvID ] RETURNS [ nb: NB_$success, cDesc: ConvDesc_NIL ]; <> LookupServiceInterface: PROC [ serviceName: ROPE, interfaceName: ROPE, cDesc: ConvDesc_NIL ] RETURNS [ nb: NB_$success, shhh: Thrush.SHHH, interfaceSpec: Thrush.InterfaceSpec ]; <> <> IdentifyVisitor: PROC[visitor, password: Rope.ROPE, complain: BOOL _ TRUE] RETURNS [nb: NB_$success]; <> ReleaseVisitor: PROC[visitor, password: Rope.ROPE]; <> <<>> <> <> ReportSystemStateProc: TYPE = PROC[ on: BOOL ]; <> ReportConversationStateProc: TYPE = PROC[ nb: NB, cDesc: ConvDesc, remark: ROPE_NIL ]; <> ReportRequestStateProc: TYPE = PROC[ cDesc: ConvDesc, actionReport: Thrush.ActionReport, actionRequest: REF ] RETURNS [betterActionRequest: REF]; <> <> <<>> RegisterForReports: PROC [s: ReportSystemStateProc _ NIL, c: ReportConversationStateProc _ NIL, r: ReportRequestStateProc _ NIL, before: BOOL _ TRUE]; <> <<>> UnRegisterForReports: PROC [s: ReportSystemStateProc _ NIL, c: ReportConversationStateProc _ NIL, r: ReportRequestStateProc _ NIL]; <> <<>> ReportConversationState: PROC [nb: NB, cDesc: ConvDesc, remark: Rope.ROPE]; <> }. <<>> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <<>> <<>> <> <> <> <> <<>> <<>>