DIRECTORY BasicTime USING [ GMT --, nullGMT-- ], DESFace USING [ Key, nullKey ], GVBasics USING [ Password ], Lark USING [ ConnectionSpec, KeyTable, Machine, noMachine, VoiceSocket ], LarkPlay USING [ ToneSpec ], Rope USING [ ROPE ], RPC USING [ Conversation, ShortROPE, unencrypted ], SafeStorage USING [ Type, unspecType ] ; Thrush: CEDAR DEFINITIONS = { PartyHandle: TYPE = ThHandle; ConversationHandle: TYPE = Epoch; nullConvHandle: ConversationHandle = LOOPHOLE[LONG[0]]; SmartsHandle: TYPE = ThHandle; VoiceSocket: TYPE = Lark.VoiceSocket; Machine: TYPE = Lark.Machine; noMachine: Machine = Lark.noMachine; Epoch: TYPE = BasicTime.GMT; epoch: Epoch; -- things with this epoch in them were created during this incarnation ROPE: TYPE= RPC.ShortROPE; Rname: TYPE = ROPE; Password: TYPE = GVBasics.Password; nullPassword: Password = ALL[0]; NetAddress: TYPE = Machine; TBD: TYPE=CARDINAL; -- <> Time: TYPE = BasicTime.GMT; Priorities: TYPE = LIST OF REF ANY; pERROR: -- PROGRAMMING -- ERROR; ServerError: ERROR[code: ServerProblem_unknown]; ServerProblem: TYPE = { unknown, inconsistentStructures, hiLevFault }; StateInConv: TYPE = { idle, -- Not really in the conversation (ever, or any more.) reserved, -- TBD at party level; restrict some operations pending outgoing conn. parsing, -- TBD at party level; may restrict additional operations. initiating, -- You are the calling party; attempt to contact the other party is in underway. pending, -- You are the called party; you are deciding whether to bother your user. maybe, -- You are the calling party; an attempt to arouse the other user is in progress. ringing, -- You are the called party; you are attempting to arouse your user. canActivate, -- You may become active in this conversation whenever you can get out of the one you may already be active in. active, -- You are active in this conversation. inactive, -- You have put this conversation on "hold." any -- Used in queries only }; StateID: TYPE = NAT; Credentials: TYPE = RECORD [ partyID: PartyHandle, smartsID: SmartsHandle, convID: ConversationHandle_nullConvHandle, stateID: StateID_0 ]; ConvEvent: TYPE = REF ConvEventBody; ConvEventBody: TYPE = RECORD [ credentials: Credentials, -- of the initiator of the event; smartsID may be null state: StateInConv _ idle, -- the state of this party in this conversation. reason: Reason _ wontSay, -- for rejection, acceptance, or conditional acceptance urgency: CallUrgency_normal, -- urgency supplied in connection attempt during this event. alertKind: AlertKind _ standard, -- connection type hint spec: Lark.ConnectionSpec _ NIL, -- if StatInConv is active or canActivate. keyTable: Lark.KeyTable _ NIL, -- whenever there's a spec intervalSpecs: IntervalSpecs _ NIL, -- if non-NIL, a SetInterval is being specified. proseSpecs: ProseSpecs _ NIL, -- if non-NIL, a SetProse is being specified. ringTune: LarkPlay.ToneSpec _ NIL, -- if non-NIL, the ringing tune to use (to voiceTerminal smarts only) address: ROPE_NIL, -- calling trunks and the like: external addressing information. time: Time _ NULL, comment: Rope.ROPE _ NIL -- any human-sensible comment associated with the event. ]; EventSequence: TYPE = REF EventSequenceBody; EventSequenceBody: TYPE = RECORD [ s: SEQUENCE size: NAT OF ConvEvent ]; Reason: TYPE = { wontSay, -- no reason needed. terminating, -- there was a reason for this connection, but it's over now, by me. withdrawing, -- would like to leave, with right to return. noAnswer, -- Alert only: we tried, honest. notFound, -- called party not found busy, -- called party is active in another conversation and/or doesn't wish to accept this one. absent, -- called party is known to be unavailable for extended period notImportantEnough, -- connection rejected because claimed urgency was too low. noCircuits, -- call rejected due to system resource overload noParticular, -- rejected for good reason, but can't say what it is. error -- System problem caused rejection. -- }; NB: TYPE = { success, -- call succeeded, party may be in new state. stateMismatch, -- the most common problem; your information's out of date. invalidTransition, -- you can't go from the state you're in to the one you're requesting. notInConv, -- you're not a party to this conversation, and call requires it. noSuchConv, -- named conversation doesn't exist. noSuchParty, -- named (own) party doesn't exist. partyNotEnabled, -- named (own) party does not have a voice path yet. noSuchSmarts, -- get the drift? noSuchParty2, -- second named (called) party doesn't exist. narcissism, -- attempt to connect to self rejected <> convNotActive, -- activity requested that is only satisfiable if requesting party active convStillActive -- can't destroy it if remaining connections are not orphans. }; Disposition: TYPE = {actedAndStop, actedAndPass--<>--, pass, willAlwaysPassThisRequest}; CallUrgency: TYPE= {junk, ifConvenient, normal, important, urgent, fire}; AlertKind: TYPE = { queryOnly, standard, intercom, whoKnows }; NumberClass: TYPE = {public, intelnet}; PartyType: TYPE = {individual, trunk, service}; Tune: TYPE = INT; -- the index of a "tune" or similar utterance identification. nullTune: Tune = -1; newTune: Tune = -2; VoiceTime: TYPE = INT; -- A sample number or sample count. VoiceInterval: TYPE = RECORD [ start: VoiceTime_0, -- first sample within tune to play or record. length: VoiceTime_-1 -- number of samples: -1 to play to the end. -- ]; VoiceDirection: TYPE = { play, record }; IntSpecType: TYPE = { request, started, finished }; IntID: TYPE = RECORD [ stateID: StateID _ 0, -- supplied by ThParty as interval is accepted reqID: CARDINAL _ 0 -- supplied by requester to disambiguate intervals in the same rqst ]; nullIntID: IntID = []; IntervalSpec: TYPE = REF IntervalSpecBody; IntervalSpecBody: TYPE = RECORD [ tune: Tune_newTune, interval: VoiceInterval_[], keyIndex: [0..17B] _ 0, type: IntSpecType _ request, direction: VoiceDirection, intID: IntID _ nullIntID, queueIt: BOOLEAN _ TRUE, changeNoted: BOOLEAN_FALSE -- For use by some clients. ]; IntervalSpecs: TYPE = LIST OF IntervalSpec; ProseSpec: TYPE = REF ProseSpecBody; ProseSpecBody: TYPE = RECORD [ prose: Rope.ROPE, type: IntSpecType _ request, direction: VoiceDirection, intID: IntID _ nullIntID, queueIt: BOOLEAN _ TRUE, changeNoted: BOOLEAN_FALSE -- For use by some clients. ]; ProseSpecs: TYPE = LIST OF ProseSpec; RingEnable: TYPE = { off, -- Incoming calls do not make noise. offTimed, -- Incoming calls will not make noise until a specified later time. subdued, -- Incoming calls will make less of a racket subduedTimed, -- Incoming calls will make less of a racket until a specified later time. on, -- Incoming calls make noise. noChange -- for use as procedure parameter }; ThHandle: TYPE=LONG CARDINAL; Enhandle: PROC[r: REF] RETURNS [ThHandle]; -- handle valid until killed. Rehandle, H: PROC[r: REF] RETURNS [ThHandle] = INLINE { RETURN[LOOPHOLE[r]]; }; Dehandle: PROC[h: ThHandle, type: SafeStorage.Type_SafeStorage.unspecType, insist: BOOLEAN_FALSE] RETURNS [LONG UNSPECIFIED]; KillHandle: PROC[h: ThHandle, type: SafeStorage.Type_SafeStorage.unspecType]; nullHandle: ThHandle = LOOPHOLE[NIL[REF], LONG CARDINAL]; HandleFault: ERROR[h: ThHandle]; SHHH: TYPE = RPC.Conversation; unencrypted, none: SHHH = RPC.unencrypted; EncryptionKey: TYPE = DESFace.Key; nullKey: EncryptionKey = DESFace.nullKey; }. ’Thrush.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Last modified by D. Swinehart, July 21, 1985 11:28:31 am PDT Basic Thrush Types Parties, Smarts, Conversations Scalars Conversation State Values A party is a member of a conversation in one of the following states: reserved and parsing states are for Smarts benefit. Treat more or less like idle. Sequence number of state transition within conversation. Used as an index into the conversation log, and as a unique id to control Smarts->Party interactions. The basic Smarts->Party informational packet. ConvEvents describe the progress of parties in conversations. They are used as entries in the log of events for a conversation, labels on the arcs describing the current state of parties in a conversation, and informational values provided to Smarts in Progress reports to describe situations. (Why things happened) Non-rejections, ongoing Rejections, of various degrees of severity Report success of Smarts->Party calls Used in Party->Smarts calls to control "distribution". actedAndStop: I did it. Don't consult any other Smarts. actedAndPass: I did it. Consult others, but they should take no action, and you should pay no attention to their results, if any. pass: I can't do it this time, keep trying. willAlwaysPassThisRequest: I can't ever do this one. If all Smarts pass, let the caller know; that may or may not be OK. Conversation Guidance Values How important is this call? As parameters to ThParty.Alert and ThSmarts.Alert: queryOnly: is it likely that Alert would succeed? conversation argument can be null. standard: ring the phone, or whatever recipient would like. intercom: try to get through without ringing. whoKnows: TBD . . . it's early innings, yet. Party type identification, back door stuff Tunes: control of recording and playback Prose: control of text-to-speech-synthesis service Tones: control ring tune generation Utility Types A ThHandle is a sanitized REF, which can be safely stored in other address spaces. It must be "Dehandled" before it can refer to the storage it designates. Enhandle assures that the REF survives. KillHandle removes the association between the handle and the target REF, and reduces the reference count to the target by 1. Rehandle is a semi-safe Enhandle; for it to work, the caller must know that the REF arg was obtained by a Dehandle of a still-valid ThHandle. If it doesn't work, the next Dehandle fails. Clients should define various handle types equal to Thrush.ThHandle. For legibility. If r is a REF to some concrete type, a runtime version of that type will have to be supplied to Dehandle to get the ref back. Can be used if one obtained r from Dehandle, or knows it was obtained that way. The next Dehandle will check the handle's validity again. Client can present virtually any value as a candidate handle. If it is not a currently valid handle, or if the target does not satisfy the handle's concrete type, the operation fails. Failure is indicated by returning NIL if insist is FALSE, otherwise by raising Thrush.HandleFault. Handle is no longer valid. Encryption types Swinehart, May 15, 1985 9:55:57 am PDT Cedar 6.0, addition of prose (text-to-speech) types. Κ©˜šœ ™ Icodešœ Οmœ1™Jšœ ŸF˜Qšœ Ÿ:˜DJ™R—Jšœ ŸP˜\Jšœ ŸJ˜TJšœŸQ˜YJšœ ŸD˜NJšœ Ÿo˜|Jšœ Ÿ'˜0Jšœ Ÿ,˜7JšœŸ˜J˜—J˜J™Ÿšœ žœžœ˜J˜—J™-šœ žœžœ˜Jšœ˜J˜Jšœ*˜*J˜J˜—J™J™¦Jšœ žœžœ˜$šœž œ˜JšœŸ6˜PJšœŸ0˜KJšœŸ7˜RJšœŸ<˜YJšœ!Ÿ˜8Jšœžœ,˜KJšœžœŸ˜9JšœžœŸ0˜TJšœžœŸ-˜KJšœžœŸE˜hJšœ žœžœŸ@˜UJšœ žœ˜JšœžœžœŸ8˜RJšœ˜J˜—Jšœžœžœ˜,šœžœžœ˜"Jšœžœžœžœ ˜%J˜—šœžœ˜™Jšœ Ÿ˜—J˜™Jšœ ŸCœ˜QJšœ Ÿ-˜:Jšœ Ÿ ˜*—J˜™*Jšœ Ÿ˜#JšœŸY˜_JšœŸ>˜FJšœŸ;˜OJšœ Ÿ0˜šœ2™2J™UJ™;J™-J™,—J™—™*J™Jšœ žœ˜'Jšœ žœ ˜/J˜—šœ(™(J˜JšœžœžœŸ=˜OJšœ˜Jšœ˜Jšœ žœžœŸ#˜:šœžœžœ˜JšœŸ.˜BJšœŸ/œ˜G—Jšœžœ˜(Jšœ žœ"˜3šœžœžœ˜JšœŸ.˜DJšœžœŸC˜WJ˜—J˜J˜Jšœžœžœ˜*šœžœžœ˜!J˜J˜J˜J˜Jšœ˜J˜Jšœ žœž˜Jšœ žœžœŸ˜6Jšœ˜—J˜šœžœžœžœ˜+J˜——šœ2™2J˜Jšœ žœžœ˜$šœžœžœ˜Jšœ žœ˜J˜Jšœ˜J˜Jšœ žœž˜Jšœ žœžœŸ˜6Jšœ˜—J˜šœ žœžœžœ ˜%J˜——šœ#™#J™šœ žœ˜JšœŸ$˜*Jšœ ŸC˜MJšœ Ÿ,˜5JšœŸJ˜XJšœŸ˜#Jšœ Ÿ!˜*J˜—J˜—šœ ™ J˜JšœR™RJšœH™HJšœ¦™¦J™»J˜šœ žœžœžœ˜JšœU™UJ˜—š Οnœžœžœžœ Ÿ˜Hšœ~™~J™——š  œžœžœžœžœžœžœ˜OJ™ŠJ™—š œžœ<˜JJšœ žœžœ˜šžœžœž œ˜JšœΈ™ΈJšœb™b—J˜—š  œžœ=˜MJšœ™J™—Jš œžœžœžœžœžœ˜9Jšœ žœ˜ J˜J˜—šœ™J˜Jšžœžœžœ˜Jšœžœžœ ˜*Jšœžœ˜"J˜)—J˜K™™&K™4—K™—…—\2§