DIRECTORY Atom USING [GetPName], BluejaySmarts USING [infos, JayInfoBody], Commander USING [ CommandProc, Register ], CommandTool USING [ NextArgument ], IO USING [GetInt, RIS], Jukebox USING [ CloseJukebox, CreateJukebox, EOF, Error, Handle, MissingChirp, OpenJukebox ], MBQueue USING [ Create ], Nice USING [ View ], RecordingServiceRegister, RefID USING [ nullID ], Rope USING [Cat], RPC USING [ExportFailed], ThParty USING [ Enable, Register, RegisterServiceInterface ], Thrush USING [ Credentials, InterfaceSpec, NB, ROPE, SHHH ], VoiceRopeDB USING [Error, Handle, Open], VoiceRopeServerRpcControl USING [ExportInterface], VoiceUtils USING [ CmdOrToken, CurrentPasskey, FindWhere, OwnNetAddress, Problem, RegisterWhereToReport, Report, WhereProc ] ; RecordingServiceRegisterImpl: CEDAR PROGRAM IMPORTS Atom, BluejaySmarts, Commander, CommandTool, IO, Jukebox, MBQueue, Nice, RecordingServiceRegister, Rope, RPC, ThParty, VoiceRopeDB, VoiceRopeServerRpcControl, VoiceUtils EXPORTS RecordingServiceRegister = { jayShh: PUBLIC Thrush.SHHH; interfaceIsImported: PUBLIC BOOLEAN_FALSE; encryptionRequested: PUBLIC BOOLEAN _ TRUE; numParties: PUBLIC NAT_0; haveJuke: PUBLIC BOOL_TRUE; jukebox: PUBLIC Jukebox.Handle; database: PUBLIC VoiceRopeDB.Handle; defaultNumSmarts: NAT = 5; -- number of smarts created by default PD: TYPE = RECORD [ doReports: BOOL_FALSE, doNice: BOOL_FALSE, jayInitialized: BOOL_FALSE ]; pd: REF PD _ NEW[PD_[]]; voiceRopeSpec: Thrush.InterfaceSpec _ [ interfaceName: [type: "VoiceRopeServer"], serviceID: RefID.nullID]; Init: Commander.CommandProc = { numTrunks: NAT _ defaultNumSmarts; nb: Thrush.NB; bluejayInstance, thrushInstance, jukeboxName, databaseName, serverPassword: Thrush.ROPE; credentials: Thrush.Credentials; bluejayInstance _ CommandTool.NextArgument[cmd]; IF bluejayInstance#NIL THEN numTrunks _ IO.GetInt[IO.RIS[bluejayInstance]]; jukeboxName _ VoiceUtils.CmdOrToken[cmd:cmd, key: "BluejayJukeboxName", default: "Strowger.Jukebox"]; databaseName _ VoiceUtils.CmdOrToken[cmd:cmd, key: "VoiceRopeDBName", default: "VoiceRopeDB.df"]; bluejayInstance _ VoiceUtils.CmdOrToken[cmd:cmd, key: "BluejayServerInstance", default: "Strowger.Lark"]; thrushInstance _ VoiceUtils.CmdOrToken[cmd:cmd, key:"ThrushClientServerInstance", default: "Strowger.Lark"]; serverPassword _ VoiceUtils.CmdOrToken[cmd: cmd, key: "BluejayServerPassword", default: "MFLFLX"]; IF pd.jayInitialized THEN RETURN; VoiceUtils.RegisterWhereToReport[ReportBluejay, $Bluejay]; VoiceUtils.RegisterWhereToReport[ReportBluejay, $VoiceRope]; haveJuke_TRUE; TRUSTED { jukebox _ Jukebox.OpenJukebox[name: jukeboxName! Jukebox.Error => IF reason= NoJukebox THEN { haveJuke_FALSE; CONTINUE; }]; IF ~haveJuke THEN { Jukebox.CreateJukebox[jukeboxName, 5000, 100]; jukebox _ Jukebox.OpenJukebox[jukeboxName]; }; }; haveJuke_TRUE; database _ VoiceRopeDB.Open[databaseName ! VoiceRopeDB.Error => { VoiceUtils.Problem[Rope.Cat[Atom.GetPName[ec]," - ",explanation], $VoiceRope]; GOTO InitFailed; } ]; [nb, credentials] _ RecordingServiceRegister.BluejayRegister[bluejayInstance, thrushInstance, serverPassword]; IF nb#$success THEN GOTO InitFailed; { voiceRopeSpec.interfaceName.instance _ NIL; -- created that way. ThParty assigns one. voiceRopeSpec.serviceID _ credentials.smartsID; [nb, voiceRopeSpec] _ ThParty.RegisterServiceInterface[credentials: credentials, interfaceSpecPattern: voiceRopeSpec]; SELECT nb FROM $success, $stateMismatch => NULL; ENDCASE => GOTO CantExportVoice; VoiceRopeServerRpcControl.ExportInterface[ voiceRopeSpec.interfaceName, bluejayInstance, VoiceUtils.CurrentPasskey[serverPassword]!RPC.ExportFailed => GOTO CantExportVoice]; EXITS CantExportVoice => VoiceUtils.Problem["Couldn't export VoiceRopeServer from RecordingService"]; }; VoiceUtils.Report["Bluejay Smarts and VoiceRope Service initialized and exported, ThParty imported", $Bluejay]; FOR i: NAT IN [0..numTrunks) DO IF i#0 THEN { [nb, credentials] _ ThParty.Register[ shh: jayShh, interface: ["Foo"], clonePartyID: credentials.partyID, properties: [ role: $voiceTerminal, netAddress: VoiceUtils.OwnNetAddress[]] ]; IF nb#$success THEN ERROR; voiceRopeSpec.serviceID _ credentials.smartsID; [nb,] _ ThParty.RegisterServiceInterface[credentials: credentials, interfaceSpecPattern: voiceRopeSpec]; IF nb#$success THEN ERROR; }; IF ThParty.Enable[shh: jayShh, smartsID: credentials.smartsID]#$success THEN ERROR; -- <> -- BluejaySmarts.infos[numParties]_ NEW[BluejaySmarts.JayInfoBody _ [credentials: credentials, shh: jayShh, notifications: MBQueue.Create[]]]; numParties_numParties+1; ENDLOOP; pd.jayInitialized _ TRUE; EXITS InitFailed => TRUSTED { VoiceUtils.Problem["Bluejay: initialization failed", $Bluejay]; IF haveJuke THEN jukebox _ Jukebox.CloseJukebox[jukebox! Jukebox.Error, Jukebox.MissingChirp, Jukebox.EOF=>CONTINUE]; jayShh_NIL; }; }; ReportBluejay: VoiceUtils.WhereProc = TRUSTED { s_VoiceUtils.FindWhere[$System, NIL]; }; ViewCmd: Commander.CommandProc = { Nice.View[pd, "Bluejay PD"]; }; Commander.Register["VuJay", ViewCmd, "Program Management variables for Bluejay"]; Commander.Register["VRS", Init, "VRS (all defaulted) -- Start voice recording service\n VRS 5 ///Morley/Morley.jukebox ///Morley/VoiceRopeDB.df Morley.Lark Morley.Lark MFLFLX"]; }. ŠRecordingServiceRegisterImpl.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Doug Terry, November 18, 1986 5:38:01 pm PST The voice recording service consists of two components: BluejaySmarts and VoiceRopeServer. BluejaySmarts manages conversations between clients and Bluejay, the voice file server; that is, it speaks ThSmarts protocol. The VoiceRopeServer provides the operations for recording and playing voice in addition to those for editing and expressing interests in voice ropes. For each BluejaySmarts that gets registered with Thrush, exactly one VoiceRopeServer service interface is registered as well. Initialize anything that has to be set up on the Jay side. Export/Import interfaces, create first Jay party and smarts. Get Jay Parties Debugging nonsense Doug Terry, July 30, 1986 11:19:26 am PDT Moved registration from BluejaySmarts to this module so that BluejaySmarts need not reference VoiceRopeServer. changes to: DIRECTORY, RecordingServiceRegister, Init Doug Terry, July 30, 1986 11:53:43 am PDT changes to: DIRECTORY, RecordingServiceRegister, Init Doug Terry, October 8, 1986 10:10:10 am PDT changes to: RecordingServiceRegister Doug Terry, November 18, 1986 3:55:46 pm PST Now exports RecordingServiceRegister. changes to: RecordingServiceRegisterImpl, Init, DIRECTORY Doug Terry, November 18, 1986 5:38:01 pm PST changes to: RecordingServiceRegisterImpl ΚΜ˜šœ!™!Icodešœ Οmœ1™Jšœžœžœž œ˜=Kšœ žœ˜(Kšœžœ˜2Jšœ žœl˜|J˜J˜—šΠblœž ˜+Jšžœ.žœz˜±Jšžœ˜ Jšœ˜J˜Jšœžœžœ˜Jšœžœžœ˜*Jšœžœžœ˜+Jšœ ž œ˜Jšœ žœžœžœ˜Jšœ žœ˜Jšœ žœ˜$J˜JšœžœΟc&˜BJ˜šžœžœžœ˜Jšœ žœžœ˜Jšœžœžœ˜Jšœžœž˜J˜—Jš œžœžœžœžœ˜J˜˜'J˜C—J˜šΟnœ˜Jšœ žœ˜"Jšœ žœ˜JšœSžœ˜XJ˜ Jšœ0˜0Jš žœžœžœ žœžœžœ˜Kšœ ˜ JšœW˜W—šœ˜JšœR˜R—šœ˜J˜W—šœ˜Jšœ[˜[—˜J˜Q—Jšžœžœžœ˜!J˜šœ:™:J™—J˜:J˜