<> <> <> <> <<>> DIRECTORY IO, NamesRPC USING [ StartConversation ], RecordingServiceRegister, RPC USING [ AuthenticateFailed, EncryptionKey, ImportFailed, VersionRange ], ThParty USING [ Register ], ThPartyRpcControl, Thrush USING [ Credentials, NB, nullID, PartyID, ROPE, SmartsID, unencrypted ], ThSmarts, ThSmartsRpcControl USING [ ExportInterface, InterfaceName ], ThVersions USING [ GetThrushVR, JayVersion, JayVR ], VoiceUtils USING [ CurrentPasskey, OwnNetAddress, ReportFR ] ; BluejayRegisterImpl: CEDAR PROGRAM IMPORTS RecordingServiceRegister, IO, NamesRPC, RPC, ThParty, ThPartyRpcControl, ThSmartsRpcControl, ThVersions, VoiceUtils EXPORTS RecordingServiceRegister = { OPEN IO; BluejayRegister: PUBLIC PROC [bluejayInstance, thrushInstance, serverPassword: Thrush.ROPE] RETURNS [nb: Thrush.NB, credentials: Thrush.Credentials] = { myName: ThSmartsRpcControl.InterfaceName _ [ type: "ThSmarts.Lark", instance: bluejayInstance, version: ThVersions.JayVR]; serverPasskey: RPC.EncryptionKey _ VoiceUtils.CurrentPasskey[serverPassword]; thVR: RPC.VersionRange = ThVersions.GetThrushVR; <> <<>> myName _ [ type: "ThSmarts.Lark", instance: bluejayInstance, version: ThVersions.JayVR]; ThSmartsRpcControl.ExportInterface[ interfaceName: myName, user: bluejayInstance, password: serverPasskey]; RecordingServiceRegister.jayShh _ IF NOT RecordingServiceRegister.encryptionRequested THEN Thrush.unencrypted ELSE NamesRPC.StartConversation [ caller: bluejayInstance, callee: thrushInstance --rName--, key: serverPasskey, level: --<>--CBCCheck ! RPC.AuthenticateFailed=>GOTO InitFailed]; <> ThPartyRpcControl.ImportInterface[ interfaceName: [type: "ThParty.Lark", instance: thrushInstance, version: thVR] ! RPC.ImportFailed=> IF why=wrongVersion THEN { VoiceUtils.ReportFR["Bluejay version %d too old; import failed", $Bluejay, NIL, card[ThVersions.JayVersion]]; GOTO InitFailed; }]; RecordingServiceRegister.interfaceIsImported_TRUE; <<>> <> [nb, credentials] _ ThParty.Register[ shh: RecordingServiceRegister.jayShh, rName: "recording", type: $service, interface: myName, properties: [role: $voiceTerminal, netAddress: VoiceUtils.OwnNetAddress[]] ]; IF nb#$success THEN GOTO InitFailed; EXITS InitFailed => RecordingServiceRegister.interfaceIsImported_FALSE; }; }. <> <> <> <> < service, Jay => Recording>> <> <> <> <> <> <> <> <> <> <> <<>>