<> <> <> <> DIRECTORY BasicTime USING [ GMT --, nullGMT-- ], DESFace USING [ Key, nullKey ], GVBasics USING [ Password ], Lark USING [ Machine, noMachine, VoiceSocket ], RefID USING [ ID, nullID ], Rope USING [ ROPE ], RPC USING [ Conversation, ShortROPE, unencrypted ] ; Thrush: CEDAR DEFINITIONS = { <> PartyID: TYPE = RefID.ID; SmartsID: TYPE = RefID.ID; nullID: RefID.ID = RefID.nullID; ConversationID: TYPE = Epoch; nullConvID: ConversationID = LOOPHOLE[LONG[0]]; <> 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; nullPassword: GVBasics.Password = ALL[0]; NetAddress: TYPE = Machine; <> <> StateInConv: TYPE = { neverWas, -- has not been in conversation yet. idle, -- Not really in the conversation (ever, or any more.) failed, -- State to go into to make busy signals, error tones, and so on, when can't find requested party, or when called party rejects. 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. notified, -- You are the called party; you are deciding whether to bother your user. ringback, -- 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." }; notReallyInConv: StateInConv = $failed; <> <Party interactions.>> StateID: TYPE = NAT; <Party informational packet.>> Credentials: TYPE = RECORD [ partyID: PartyID _ nullID, smartsID: SmartsID _ nullID, convID: ConversationID_nullConvID, state: StateInConv _ $neverWas, stateID: StateID_0 ]; <<>> <> ConvEvent: TYPE = REF ConvEventBody; ConvEventBody: TYPE = RECORD [ self: Credentials, -- of the receiver of the report other: Credentials, -- of the initiator of the event; smartsID may be null time: BasicTime.GMT _ NULL, -- when the event causing this report occurred reason: Reason _ NIL, -- ($wontSay) for rejection, acceptance, or conditional acceptance comment: Rope.ROPE _ NIL -- any human-sensible comment associated with the event. ]; Reason: TYPE = ATOM; <<{>> <<(Why things happened, among them)>> <<$wontSay=NIL, -- 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>> <<$dying, -- one of the participating parties is being destroyed>> <<$noParticular, -- rejected for good reason, but can't say what it is.>> <<$error -- System problem caused rejection. -->> <<};>> <Party calls>> NB: TYPE = ATOM; <<{>> <<$success, -- call succeeded, party may be in new state.>> <<>> <> <<$stateMismatch, -- the most common problem; your information's out of date.>> <<$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.>> <<$partyAlreadyActive, -- Not allowed to be active in two conversations>> <<$convIdle, -- not allowed to return to a conversation everyone has abandoned!>> <<$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.,>> <<...,>> <> <<$noIdentSupplied, -- not enough information to turn name or number into party, and so on.>> <<$noEntryFound, -- no RName information found in white pages data base for named individual.>> <<$noTrunkParty, -- corresponding to supplied party>> <<$couldntAuthenticate, -- password verification problem during initialization>> <<$couldntConnect, -- interface import or other similar problem during initialization>> <<$noNameAvailable, -- can't find the name of a party>> <<$interfaceError, -- call had an invalid parameter or combination of parameters>> <<};>> <> <> CallUrgency: TYPE= ATOM; -- { $junk, $ifConvenient, $normal=NIL, $important, $urgent, $fire}; AlertKind: TYPE = ATOM; -- { $queryOnly, $standard=NIL, $intercom, $background, ... }; <> <> <> <> <> <<>> <> <<>> PartyType: TYPE = ATOM; -- { $individual, $telephone, $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; <> SHHH: TYPE = RPC.Conversation; unencrypted, none: SHHH = RPC.unencrypted; EncryptionKey: TYPE = DESFace.Key; nullKey: EncryptionKey = DESFace.nullKey; }. <<>> <> <> <> <> <> <> <> <> <<>> <<>> <<>> <<>>