<> <> <> DIRECTORY BasicTime USING [ GMT, nullGMT ], Lark USING [ KeyTable], LarkPlay USING [ ToneSpec], MBQueue USING [ Queue ], Pup USING [ nullSocket, Socket ], PupSocket USING [ Socket ], RefID USING [ ID ], Thrush USING [ AlertKind, CallUrgency, ConversationID, ConvEvent, Credentials, InterfaceSpec, NetAddress, NB, none, nullID, PartyID, PartyType, Reason, ROPE, SHHH, SmartsID, StateID, StateInConv ], ThParty USING [ NameReq, SmartsInterfaceRecord, SmartsProperties ] ; ThPartyPrivate: CEDAR DEFINITIONS = { <> <> PartyData: TYPE = REF PartyBody; PartyBody: TYPE = RECORD [ type: Thrush.PartyType_, -- Must be specified. numConvs: NAT _ 0, enabled: BOOL_FALSE, -- must be TRUE for party to be visible to anybody. partyActive: BOOL _ FALSE, -- if TRUE, party is active in exactly one conversation name: Thrush.ROPE, <> <> <> outgoing: Thrush.ROPE _ NIL, -- * reservedBy: Thrush.PartyID _ NULL, -- ** reservationTime: BasicTime.GMT _ BasicTime.nullGMT, -- *** <> actionInterfaces: LIST OF REF Thrush.InterfaceSpec _ NIL -- * ]; <<* Set at GetParty time to called party number. This number is just what's needed to complete the call, with all alternatives removed. *x* in the number indicates the need for a pause of x 100 ms ticks.>> <<** Since GetParty custom-tailors a trunk party for the specific outgoing call before initiating a conversation, need a way to make sure that the same party does start the conversation. This field is also used to reserve a service party for a time before the party enters a conversation.>> <<*** This is the time at which a service party is reserved through a call to GetParty. The reservation is honored (the party isn't assigned to another caller, even though it is idle) for some reasonable amount of time, to allow the reserving client to engage it in a conversation. >> SmartsData: TYPE=REF SmartsBody; <> SmartsBody: TYPE = RECORD [ properties: ThParty.SmartsProperties, type: Thrush.PartyType_$telephone, interface: ThParty.SmartsInterfaceRecord, -- an RPC or direct interface shh: Thrush.SHHH, -- outgoing encryption handle; should be one for each Party-Smarts pair? For now, callee in shh is RName associated of Party that creates smarts. notifications: MBQueue.Queue, -- pending party->smarts notifications pupSocket: PupSocket.Socket _ NIL, <> failed: BOOL_ FALSE, -- when TRUE, smarts has already been deregistered and will vanish when last report has been made. enablesParty: BOOL _ FALSE -- when TRUE, we're contributing to party.numEnabled ]; ConversationData: TYPE = REF ConversationBody; ConversationBody: TYPE = RECORD [ convID: Thrush.ConversationID_NULL, subject: Thrush.ROPE _ NIL, urgency: Thrush.CallUrgency_NIL, alertKind: Thrush.AlertKind_NIL, timeOfID: BasicTime.GMT, -- time of last report to anyone startTime: BasicTime.GMT, conferenceHost: Thrush.NetAddress_[[0],[0], Pup.nullSocket], keyTable: Lark.KeyTable _ NIL, -- current key table for this conversation keyUses: ARRAY [0..20B) OF INT _ ALL[0], -- use counts for key table cStateBilateral: ConvState _ NIL, -- if non-NIL, a ConvState that is asserting a restriction to a bilateral conversation numParties: NAT_0, numActive: NAT_0, numIdle: NAT_0, numReportsOut: NAT_0 -- reports scheduled but not completed ]; ConvState: TYPE = REF ConvStateBody; <> ConvStateBody: TYPE = RECORD [ state: Thrush.StateInConv _ $neverWas, stateID: Thrush.StateID _ 0, intendedPartyID: Thrush.PartyID _ Thrush.nullID, <> time: BasicTime.GMT_NULL ]; outsideRingTune: LarkPlay.ToneSpec; <> MakeServiceRname: PROC[serviceName: Thrush.ROPE] RETURNS [serviceRname: Thrush.ROPE, serviceRnameAtom: ATOM]; <.Lark", as a ROPE and as a corresponding ATOM. This is a procedure because the service name is stored, but several clients need the atom or rope values.>> GetCurrentParty: PROC[shh: Thrush.SHHH_Thrush.none, smartsID: Thrush.SmartsID] RETURNS [nb: Thrush.NB, partyID: Thrush.PartyID]; RegisterLocal: PROC[ shh: Thrush.SHHH_Thrush.none, <> <> rName: Thrush.ROPE_NIL, type: Thrush.PartyType_ $individual, <> clonePartyID: Thrush.PartyID_Thrush.nullID, <> <> <> <> interfaceRecord: ThParty.SmartsInterfaceRecord _ NIL, <> smartsID: Thrush.SmartsID _ Thrush.nullID, <> properties: ThParty.SmartsProperties ] RETURNS [ nb: Thrush.NB, credentials: Thrush.Credentials ]; <> <> AssignSmartsID: PROC RETURNS [smartsID: Thrush.SmartsID]; <> DoDescribeParty: PROC[party: ThPartyPrivate.PartyData, nameReq: ThParty.NameReq] RETURNS[ description: Thrush.ROPE ]; GetRnameFromParty: PROC[party: ThPartyPrivate.PartyData, nameReq: ThParty.NameReq_$current] RETURNS[ nb: Thrush.NB, rName: Thrush.ROPE_NIL, rAtom: ATOM_NIL ]; DoAdvance: PROC [ credentials: Thrush.Credentials, intendedPartyID: Thrush.PartyID _ Thrush.nullID, state: Thrush.StateInConv, reportToAll: BOOL_FALSE, reason: Thrush.Reason_NIL, comment: Thrush.ROPE_NIL, newInConv: BOOL, -- if TRUE, party must not be in the conversation yet . . . and vice versa bilateral: BOOL_FALSE ] RETURNS [nb: Thrush.NB, convEvent: Thrush.ConvEvent]; AlertOne: PROC[ credentials: Thrush.Credentials, calledPartyID: Thrush.PartyID, intendedPartyID: Thrush.PartyID_Thrush.nullID ] RETURNS [ nb: Thrush.NB ]; GetConvState: PROC[ conv: ConversationData, party: PartyData, createOK: BOOL_FALSE] RETURNS [convState: ConvState_NIL]; SetPoaching: PROC[party: PartyData, callingParty: PartyData_NIL]; <> MakeSubstitution: PROC[oldParty: PartyData, newParty: PartyData]; <> GetPupSocket: PROC[partyID: Thrush.PartyID] RETURNS [PupSocket.Socket]; <<See earlier discussion about sockets. This gets the socket from the $voiceTerminal smarts associated with the specified party. If any.>> VoiceParty: PROC[party: PartyData] RETURNS [voiceParty: PartyData ]; PartyConflict: PROC[party: PartyData, targetParty: PartyData] RETURNS [isConflict: BOOL]; <> <> <> <> <> <> UnsealConv: PROC[convID: Thrush.ConversationID] RETURNS [ conv: ConversationData ]; UnsealParty: PROC[partyID: Thrush.PartyID] RETURNS[party: PartyData]; UnsealSmarts: PROC[smartsID: Thrush.SmartsID] RETURNS[party: SmartsData]; UnsealConversation: PROC[ conv: ConversationData ]; NewId: PUBLIC PROC RETURNS [ Pup.Socket ]; <<>> }. <> <> <> <<>> <> <> <> <> < serviceName>> <> <> <> <<>> <> < ID (RefID's)>> <> <> <> <> <<>> <> <> <> <<>>