ThPartyPrivate.mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
last modified by Swinehart, May 31, 1986 4:10:54 pm PDT
DIRECTORY
BasicTime USING [ GMT ],
Lark USING [ KeyTable],
LarkPlay USING [ ToneSpec],
MBQueue USING [ Queue ],
Pup USING [ nullSocket, 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 = {
Definitions
PartyData: data representing an individual, trunk, or voice recording within Thrush
PartyData: TYPE = REF PartyBody;
PartyBody: TYPE = RECORD [
type: Thrush.PartyType←, -- Must be specified.
numConvs: NAT ← 0,
enabled: BOOLFALSE, -- must be TRUE for party to be visible to anybody.
partyActive: BOOLFALSE, -- if TRUE, party is active in exactly one conversation
name: Thrush.ROPE,
For services, this remains the "idle service" rName for use when party goes idle.
For trunks, this is the rName of the owner of the trunk; for other parties, this is the rName of the individual the party represents.
Fields used by trunk parties
outgoing: Thrush.ROPE NIL, -- *
reservedBy: Thrush.PartyID ← NULL, -- **
Registered Service action interfaces
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 smarts does start the conversation.
SmartsData: TYPE=REF SmartsBody;
Implementors say SmartsBody: PUBLIC TYPE=ThPartyPrivate.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
failed: BOOLFALSE, -- when TRUE, smarts has already been deregistered and will vanish when last report has been made.
enablesParty: BOOLFALSE -- when TRUE, we're contributing to party.numEnabled
];
ConversationData: TYPE = REF ConversationBody;
ConversationBody: TYPE = RECORD [
convID: Thrush.ConversationID←NULL,
subject: Thrush.ROPENIL,
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
numParties: NAT𡤀,
numActive: NAT𡤀,
numIdle: NAT𡤀,
numReportsOut: NAT𡤀   -- reports scheduled but not completed
];
ConvState: TYPE = REF ConvStateBody;
The state of a party in a conversation
ConvStateBody: TYPE = RECORD [
state: Thrush.StateInConv ← $neverWas,
stateID: Thrush.StateID ← 0,
sockID: Pup.Socket,
time: BasicTime.GMTNULL
];
outsideRingTune: LarkPlay.ToneSpec;
Procedures
MakeServiceRname: PROC[serviceName: Thrush.ROPE]
RETURNS [serviceRname: Thrush.ROPE, serviceRnameAtom: ATOM];
Service Name is the formal descriptor of one of the voice services, such as "Recording", "Text-to-Speech", and so on. The result is "idle.<serviceName>.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←$success, partyID: Thrush.PartyID←Thrush.nullID];
GetStdRingInfo: PROC [partyID: Thrush.PartyID];
SetStdRingInfo: PROC [partyID: Thrush.PartyID, update: BOOLFALSE];
RegisterLocal: PROC[
shh: Thrush.SHHH←Thrush.none,
Can't combine with ThParty.Register, because RPC complains about interfaceRecord param.
Description of party
rName: Thrush.ROPENIL,
type: Thrush.PartyType← $individual,
Or ID of party to replicate (used to provide multiple instances of services)
clonePartyID: Thrush.PartyID←Thrush.nullID,
Identification of smarts implementation -- requires either:
RPC Interface allowing an instance to be imported
See ThParty.Register
Or Local Interface record matching that produced by RPC
interfaceRecord: ThParty.SmartsInterfaceRecord ← NIL,
Kind of Smarts being registered, and from what host
properties: ThParty.SmartsProperties
] RETURNS [
nb: Thrush.NB, credentials: Thrush.Credentials ];
nb will indicate something about what went wrong if anything did; if nb=$success,
credentials contains the resulting PartyID and SmartsID.
FindOtherParty: PROC[myPartyID: Thrush.PartyID, conv: ConversationData]
RETURNS[partyID: Thrush.PartyID, conference: BOOL];
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.ROPENIL, rAtom: ATOMNIL ];
DoAdvance: PROC [
credentials: Thrush.Credentials,
state: Thrush.StateInConv,
reportToAll: BOOLFALSE,
reason: Thrush.Reason←NIL,
comment: Thrush.ROPENIL,
newInConv: BOOL, -- if TRUE, party must not be in the conversation yet . . . and vice versa
originatingParty: PartyData←NIL -- for ThPartyOpsImpl.Alert, only
] RETURNS [nb: Thrush.NB, convEvent: Thrush.ConvEvent];
MakeSubstitution: PROC[oldParty: PartyData, newParty: PartyData];
If both parties exist, either a poacher is arriving or leaving. In either case, the oldParty might be involved in conversations that the new party should inherit. Arrange for that here.
PartyAvailable: PROC[ownParty: PartyData←NIL, party: PartyData] RETURNS [nb: Thrush.NB];
Utilities
Special ID-management operations
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 ];
}.
Swinehart, May 15, 1985 6:01:06 pm PDT
Cedar 6.0
changes to: PartyBody (incoming phone number removed), DIRECTORY
Swinehart, May 20, 1985 1:16:41 pm PDT
PartyBody is not a variant record any more.
changes to: PartyBody
Swinehart, May 22, 1985 10:32:47 am PDT
serviceNameAtom => serviceName
changes to: PartyBody
Swinehart, May 22, 1985 10:41:26 am PDT
changes to: MakeServiceRname, GetStdRingInfo, SetStdRingInfo, MakeServiceRname
Swinehart, October 25, 1985 5:52:58 pm PDT
Handle => ID (RefID's)
changes to: DIRECTORY, nullID, PartyBody, ConversationBody, CFRec, GetCurrentParty, GetPartySmarts, GetStdRingInfo, SetStdRingInfo, FindOtherParty, DoDescribeParty, DoAdvance, RegisterLocal, DehandleConv, DehandleParty, DehandleSmarts
Swinehart, November 7, 1985 11:57:15 am PST
Remove several fields from these data structures, move socket ID to ConversationBody, modify CFRef.
changes to: SmartsBody, ConversationBody, CFRec, outsideRingTune
Swinehart, May 17, 1986 5:30:43 pm PDT
Cedar 6.1
changes to: DIRECTORY, ConvStateBody