DIRECTORY BasicTime USING [ GMT ], RPC USING [ EncryptionKey ], Thrush USING [ CallUrgency, ConversationHandle, ConvEventBody, EncryptionKey, EventSequence, IntervalSpec, NB, newTune, nullConvHandle, nullHandle, PartyHandle, Reason, ROPE, SHHH, SmartsHandle, StateInConv, ThHandle, Tune, VoiceInterval ], ThSmartsRpcControl ; FinchSmarts: CEDAR DEFINITIONS = { ConversationHandle: TYPE = Thrush.ConversationHandle; nullConvHandle: Thrush.ConversationHandle = Thrush.nullConvHandle; NB: TYPE = Thrush.NB; nullHandle: Thrush.ThHandle = Thrush.nullHandle; Orig: TYPE = { unknown, us, them }; PartyHandle: TYPE = Thrush.PartyHandle; Reason: TYPE = Thrush.Reason; ROPE: TYPE = Thrush.ROPE; SHHH: TYPE = Thrush.SHHH; FinchInfo: TYPE = REF FinchInfoBody; FinchInfoBody: TYPE = MONITORED RECORD [ smartsID: Thrush.SmartsHandle_Thrush.nullHandle, partyID: Thrush.PartyHandle _ Thrush.nullHandle, shh: SHHH_NIL, conversations: ConvDesc_NIL, currentConvID: ConversationHandle _ nullConvHandle, thProcess: PROCESS_NIL, thAction: CONDITION, apprise: BOOL_FALSE, bluejayConnection: BOOL_FALSE, myName: ThSmartsRpcControl.InterfaceName _ [], myRName: ROPE _ NIL, myPassword: RPC.EncryptionKey _ NULL, serverInstanceName: ROPE _ NIL, serverInstance: ROPE_NIL, ReportSystemState: PROC[ on: BOOL ], ReportConversationState: PROC[ nb: NB, cDesc: ConvDesc, remark: ROPE_NIL ] ]; ConvDesc: TYPE = REF ConvDescBody; ConvDescBody: TYPE = RECORD [ cState: Thrush.ConvEventBody, -- amalgam of useful info from reported events desiredState: Thrush.StateInConv_any, -- what we're aiming for desiredPartyID: PartyHandle_NULL, desiredReason: Reason_wontSay, desiredComment: ROPE_NIL, desiredInterval: Thrush.IntervalSpec_NIL, desiredKey: Thrush.EncryptionKey_NULL, currentRecordIntervalSpec: Thrush.IntervalSpec _ NIL, newIntervals: LIST OF Thrush.IntervalSpec _ NIL, iTail: LIST OF Thrush.IntervalSpec _ NIL, newEvent, newSpec, newKeys, newAddress: BOOL _FALSE, signallingStarted: BOOL_FALSE, descValid: BOOL_FALSE, desireKey: BOOL_FALSE, clientData: REF _ NIL, -- only known use: FinchTool uses to store Viewer pointer next, prev: ConvDesc_NIL, otherPartyID: PartyHandle _ nullHandle, otherPartyDesc: ROPE_ NIL, startTime: BasicTime.GMT_NULL, originator: Orig _ unknown, conference: BOOL_FALSE, completed: BOOL_FALSE, failed: BOOL_FALSE ]; InitFinchSmarts: PROC [ ReportSystemState: PROC[ on: BOOL ], ReportConversationState: PROC[ nb: NB, cDesc: ConvDesc, remark: ROPE_NIL ] ]; FinchIsRunning: PROC RETURNS [finchIsRunning: BOOL]; UninitFinchSmarts: PROC[problem: BOOL_FALSE]; PlaceCall: PROC [ convID: Thrush.ConversationHandle _ Thrush.nullConvHandle, rName: ROPE_NIL, number: ROPE_NIL, urgency: Thrush.CallUrgency_normal, useNumber: BOOL_FALSE]; AnswerCall: PROC[convID: Thrush.ConversationHandle]; DisconnectCall: PROC[ convID: Thrush.ConversationHandle, reason: Thrush.Reason_terminating, comment: ROPE_NIL ]; GetHistory: PROC[ convID: Thrush.ConversationHandle, toState: INT_0 -- i.e., all-- ] RETURNS [ s: Thrush.EventSequence ]; GetRname: PROC[partyID: Thrush.PartyHandle] RETURNS [ rName: ROPE]; RecordReason: TYPE = { ok, abandoned, failed, hopeless }; RecordTune: PROC[ useTune: Thrush.Tune_Thrush.newTune, useInterval: Thrush.VoiceInterval_[] ] RETURNS[ reason: RecordReason, -- << wouldn't need if only "ok" and "failed/hopeless" are supported.>> tune: Thrush.Tune, interval: Thrush.VoiceInterval_NULL, key: Thrush.EncryptionKey_NULL ]; StopTune: PROC[ reason: RecordReason_ok -- other valid value: abandon (recording only: supported?) ]; PlaybackTune: PROC [ tune: Thrush.Tune, interval: Thrush.VoiceInterval_[], key: Thrush.EncryptionKey, queueIt: BOOL_FALSE ]; GetConvDesc: PROC[convID: ConversationHandle] RETURNS [cDesc: ConvDesc]; DequeueInterval: PROC[cDesc: ConvDesc] RETURNS [ int: Thrush.IntervalSpec_NIL ]; }. °FinchSmarts.mesa Last Edited by: Swinehart, November 11, 1983 1:19 pm Types Call backs Switching data Client Data Initialization Whenever a toggle occurs, so does this procedure. Client-relevant changes in conversation state are reported in gory detail; FinchSmarts is allowed to invent parts of it (e.g., reason and remark fields) Expect ReportSystemState, followed by some number of ReportConversationStates, soon. No more than one client should call this procedure, at present. Call Management Uses specified conversation, creates a new one or uses one that's in a sufficiently idle state. Interpretation of rName and number -- evaluate until action can be taken: rName exists in switching system (has an Etherphone, usually) and ~use#: call that party. number#NIL: rName is simply a description; call by number rName=NIL or use#: invalid parameters rName exists in obsolete directory and ~use#: use the resulting number all tests fail: no such party. Recording and Playback ok: something was recorded abandoned: user or client program asked to abandon the recording (supported?) failed: something went wrong, but may not next time. hopeless: will continue to fail until somebody does something creative. convID: Thrush.ConversationHandle _ Thrush.nullConvHandle, --vestigial until I figger it out This procedure waits until the recording is complete. While it is running, calls to the registered procedures may occur to inform the user of what's happening. Client is responsible for arranging process structures so that there is a process available to call StopTune while a call to RecordTune is still pending. convID should be defaulted convID: Thrush.ConversationHandle _ Thrush.nullConvHandle, --vestigial until I figger it out Terminates recording or playback of tune, if any. Causes any pending RecordTune to terminate and return. convID: Thrush.ConversationHandle _ Thrush.nullConvHandle, --vestigial until I figger it out Conversation Access Êš˜J™J™4J˜šÏk ˜ J˜Jšœœ˜šœ˜ JšœœœC˜ã—J˜J˜J˜—šœ œ˜"J˜—™J™˜5J˜B—Jšœ˜J˜0Jšœœ˜#Jšœ'˜'J˜Jšœœ˜Jšœœ œ˜J˜Jšœ œœ˜$šœœ œœ˜(J˜0J˜0Jšœœœ˜J˜Jšœœ˜J˜3Jšœ œœ˜Jšœ œ˜Jšœ œœ˜Jšœœœ˜J˜Jšœ.˜.Jšœ œœ˜Jšœ œœ˜%Jšœœœ˜Jšœœœ˜J™ JšÏnœœœ˜$Jš žœœœœœ˜JJ˜J˜—Jšœ œœ˜"šœœœ˜J™JšœÏc.˜MJšœ&Ÿ˜>Jšœœ˜!J˜Jšœœœ˜Jšœ%œ˜)Jšœ!œ˜&Jšœ1œ˜5Jšœœœœ˜0Jšœœœœ˜)Jšœ(œ˜4Jšœœœ˜Jšœ œœ˜Jšœ œœ˜J˜J™ Jšœ œœŸ9˜PJšœœ˜Jšœ'˜'Jšœœœ˜Jšœœœ˜J˜Jšœ œœ˜Jšœ œ˜Jšœœ˜J˜—J™—™J˜šžœœ˜šžœœœ˜$J™1—š žœœœœœ˜JJšœ˜™˜—Jšœ˜JšœT™TJ™?—J˜Jšžœœœœ˜4J˜Jšžœœ œœ˜.J˜—™J˜šž œœ˜Jšœ:˜:Jšœœœ˜Jšœœ˜Jšœ#˜#Jšœ œœ˜J™_™IJ™YJ™9J™%J™FJ™—J˜—šž œœ$˜4J˜—šžœœ˜Jšœ"˜"J˜"Jšœ œ˜Jšœ˜—J˜šž œœ.œŸœ˜TJšœ˜$—J˜Jšžœœœ œ˜CJ˜—™J˜šœœ'˜9J™J™MJ™4J™G—J˜šž œœ˜Jšœ\™\J˜$J˜$Jšœ˜Jšœ˜JšœŸG˜]J˜Jšœœ˜$Jšœ˜J˜Jšœ†Ïbœž œ™»Jš œ™—J˜šžœœ˜Jšœ\™\JšœŸ:˜RJšœ˜J™i—J˜šž œœ˜Jšœ\™\Jšœ˜J˜"J˜Jšœ œ˜Jšœ˜—J˜—™Jšž œœœ˜HJ˜Jšžœœœœ˜PJ˜—J˜J™J™—…—J