ConversationID:
TYPE = Thrush.ConversationID;
nullConvID: ConversationID = Thrush.nullConvID;
NB: TYPE = Thrush.NB;
nullID: RefID.ID = Thrush.nullID;
PartyID: TYPE = Thrush.PartyID;
Reason: TYPE = Thrush.Reason;
ROPE: TYPE = Thrush.ROPE;
SHHH: TYPE = Thrush.SHHH;
lock: MONITORLOCK;
PD:
TYPE =
RECORD [
doPollingTimeouts: BOOL¬TRUE,
pollDefault: INT ¬ 300, -- 5 minutes minimum between probes when disconnected
timeoutInitiating: NAT ¬ 11
];
pd: REF PD; -- This is exported from the PhoenixSmartsImpl
OpenConversations: TYPE = LIST OF ConvDesc;
ConvDesc: TYPE = REF ConvDescBody;
ConvDescBody:
TYPE =
RECORD
[
PhSmarts level information.
info: PhoenixInfo,
situation: Thrush.ConvEventBody,
cInfo: ThParty.ConversationInfoRec,
partyInfo: ThParty.PartyInfo,
myPriority: Rope.ROPE,
Derived values
convMedia: ATOM¬NIL,
expectedMedia: ATOM¬NIL,
actualMedia: ATOM¬NIL,
isConference: BOOL ¬ FALSE,
doingAudio: BOOL ¬ FALSE,
doingVideo: BOOL ¬ FALSE,
For use by PhSwitch level implementation.
stateAye: Thrush.StateInConv ¬ $neverWas,
toneBuf: TonePlay.AudioBuf ¬ NIL,
xmitStream: NetStreamInfoBody,
Because Mesa won't let you finish a list with a comma.
tail: INT¬0
];
LinkState: TYPE ~ { neverWas, unlinked, linked };
NetStreamInfo:
TYPE ~
REF NetStreamInfoBody;
NetStreamInfoBody:
TYPE ~
MACHINE DEPENDENT RECORD [
fd: AudioLibrary.FD ¬ pseudostdin,
vtAddress: AudioLibrary.IPAddress, -- Of the transmitter
vtDummy: AudioLibrary.IPPort ¬ [0,0], -- (keep the debugger completely happy)
vtPort: AudioLibrary.IPPort, -- of this stream.
linkDummy: [0..03FFFFFFFH] ¬ 0, -- more debugger
linkState: LinkState ¬ neverWas
];
PhoenixInfo: TYPE = REF PhoenixInfoBody;
PhoenixInfoBody:
TYPE =
MONITORED
RECORD [
-- Per Finch instance: one, for now
smartsID: Thrush.SmartsID¬nullID,
partyID: PartyID ¬ nullID,
shh: SHHH¬NIL,
conversations: OpenConversations ¬ NIL,
myName: ThSmartsRpcControl.InterfaceName ¬ [],
myRName: ROPE ¬ NIL,
myPassword: RPC.EncryptionKey ¬ NULL,
prevThrushInstance: ROPE ¬ NIL,
pollCondition: CONDITION,
nextScheduledCheck: INT¬0,
lastRemoteRemark: ROPE ¬ NIL, -- print each remote remark once only
These values are derived from lower-level values.
enabled: BOOL¬FALSE, -- all levels are willing for connection to be maintained.
connected: BOOL ¬ FALSE -- connection is established, and we're registered with Thrush
];
phoenixInfo: PhoenixInfo; -- global description of what's going on.
Procedures exported by PhoenixSmartsImpl
Problem: PROC [comment: ROPE, info: PhoenixInfo, v1: IO.Value ¬ [null[]]];
Report: PROC [comment: ROPE, info: PhoenixInfo, v1: IO.Value ¬ [null[]], where: ATOM ¬ $Smarts];
Procedures exported by PhoenixRegisterImpl
InitPhoenixSmarts:
PROC [
thrushInstance: Thrush.
ROPE¬
NIL];
Initialize, then register the specified procedures via RegisterForReports.
UnInitPhoenixSmarts: PROC[disable: BOOL¬TRUE];
PhoenixIsRunning: PROC RETURNS [phoenixIsEnabled: BOOL, phoenixIsRunning: BOOL];
RecordSystemStateFromSmartsReport: PROC[nb: NB ¬ NIL, remark: Rope.ROPE, connected: BOOL, enabled: BOOL, voicePath: BOOL, remoteRemark: Rope.ROPE ] RETURNS[echoNB: NB];
Poke:
PROC;
If enabled but not connected, tries to get connected, best way.
Procedures exported by ThPhoenixPrivateImpl
ForgetConv:
PROC [cDesc: ConvDesc];
Delete the conversation from the open conversations list. This procedure is called
when the conversation terminates and a transition to the idle state is made.
GetConv:
PROC [info: PhoenixInfo, credentials: Thrush.Credentials,
createOK: BOOL ¬ FALSE] RETURNS [cDesc: ConvDesc];
Try to locate a description for outr involvement into the credentials.convID (maybe
NullConvID where the purpose is to create a new, unassigned cDesc).
DBInfo: PROC[partyID: Thrush.PartyID, attribute: ATOM ¬ NIL, prevRNAtom: ATOM ¬ NIL] RETURNS [rName: Thrush.ROPE¬NIL, rNAtom: ATOM¬NIL, value: Thrush.ROPE¬NIL];
}.